Use the shooting method to solve the mixed boundary value problem
\begin{gathered} u^{\prime \prime}=u-4 x e^{x}, 0<x<1, \\ u(0)-u^{\prime}(0)=-1, u(1)+u^{\prime}(1)=-e. \end{gathered}
Use the Taylor series method
\begin{aligned} & u_{j+1}=u_{j}+h u_{j}^{\prime}+\frac{h^{2}}{2} u_{j}^{\prime \prime}+\frac{h^{3}}{6} u_{j}^{\prime \prime \prime} . \\ & u_{j+1}^{\prime}=u_{j}^{\prime}+h u_{j}^{\prime \prime}+\frac{h^{2}}{2} u_{j}^{\prime \prime \prime} \end{aligned}
to solve the initial value problems. Assume h=0.25. Compare with the exact solution u(x)=x(1-x) e^{x}.
We assume the solution in the form
u(x)=u_{0}(x)+\mu_{1} u_{1}(x)+\mu_{2} u_{2}(x)
where u_{0}(x), u_{1}(x) and u_{2}(x) satisfy the differential equations
\begin{aligned} & u_{0}^{\prime \prime}-u_{0}=-4 x e^{x}, u_{1}^{\prime \prime}-u_{1}=0 ,\\ & u_{2}^{\prime \prime}-u_{2}=0. \end{aligned}
The initial conditions may be assumed as
\begin{array}{ll} u_{0}(0)=0, & u_{0}^{\prime}(0)=0, \\ u_{1}(0)=1, & u_{1}^{\prime}(0)=0, \\ u_{2}(0)=0, & u_{2}^{\prime}(0)=1. \end{array}
We solve the three, second order initial value problems
\begin{array}{ll} u_{0}^{\prime \prime}=u_{0}-4 x e^{x}, & u_{0}(0)=0, u_{0}^{\prime}(0)=0, \\ u_{1}^{\prime \prime}=u_{1} . & u_{1}(0)=1, u_{1}^{\prime}(0)=0, \\ u_{2}^{\prime \prime}=u_{2}, & u_{2}(0)=0, u_{2}^{\prime}(0)=1 \end{array}
by using the given Taylor series method with h=0.25. We have the following results. (i) i=0, u_{0,0}=0, u_{0,0}^{\prime}=0.
Therefore, we obtain
\begin{aligned} & u_{0}(0.25) \approx u_{0,1}=-0.01042, \quad u_{0}^{\prime}(0.25) \approx u_{0,1}^{\prime}=-0.12500 ,\\ & u_{0}(0.50) \approx u_{0,2}=-0.09917, \quad u_{0}^{\prime}(0.50) \approx u_{0,2}^{\prime}=-0.65315, \\ & u_{0}(0.75) \approx u_{0,3}=-0.39606, \quad u_{0}^{\prime}(0.75) \approx u_{0,3}^{\prime}=-1.83185 ,\\ & u_{0}(1.00) \approx u_{0,4}=-1.10823, \quad u_{0}^{\prime}(1.00) \approx u_{0,4}^{\prime}=-4.03895. \end{aligned}
(ii) i=1, u_{1,0}=1, u_{1,0}^{\prime}=0.
\begin{aligned} u_{1, j}^{\prime \prime} & =u_{1, j}, u_{1, j}^{\prime \prime \prime}=u_{1, j}^{\prime}, j=0,1,2,3 . \\ u_{1, j+1} & =u_{1, j}+h u_{1, j}^{\prime}+\frac{h^{2}}{2} u_{1, j}+\frac{h^{3}}{6} u_{1, j}^{\prime} \\ & =\left(1+\frac{h^{2}}{2}\right) u_{1, j}+\left(h+\frac{h^{3}}{6}\right) u_{1, j}^{\prime}=1.03125 u_{1, j}+0.25260 u_{1, j}^{\prime} \\ u_{1, j+1}^{\prime} & =u_{1, j}^{\prime}+h u_{1, j}+\frac{h^{2}}{2} u_{1, j}^{\prime} \\ & =h u_{1, j}+\left(1+\frac{h^{2}}{2}\right) u_{1, j}^{\prime}=0.25 u_{1, j}+1.03125 u_{1, j}^{\prime} \end{aligned}
Hence,
\begin{array}{ll} u_{1}(0.25) \approx u_{1,1}=1.03125, & u_{1}^{\prime}(0.25) \approx u_{1,1}^{\prime}=0.25, \\ u_{1}(0.50) \approx u_{1,2}=1.12663, & u_{1}^{\prime}(0.50) \approx u_{1,2}^{\prime}=0.51563, \end{array}
\begin{array}{ll} u_{1}(0.75) \approx u_{1,3}=1.29209, & u_{1}^{\prime}(0.75) \approx u_{1,3}^{\prime}=0.81340, \\ u_{1}(1.00) \approx u_{1,4}=1.53794, & u_{1}^{\prime}(1.00) \approx u_{1,4}^{\prime}=1.16184. \end{array}
(iii) i=2, u_{2,0}=0, u_{2,0}^{\prime}=1.
u_{2, j}^{\prime \prime}=u_{2, j}, u_{2, j}^{\prime \prime \prime}=u_{2, j}^{\prime}, j=0,1,2,3 .
Since the differential equaton is same as for u_{1}, we get
\begin{aligned} u_{2, j+1} & =1.03125 u_{2, j}+0.25260 u_{2, j}^{\prime} \\ u_{2, j+1}^{\prime} & =0.25 u_{2, j}+1.03125 u_{2, j}^{\prime} \end{aligned}
From the given boundary conditions, we have
\begin{gathered} a_{0}=a_{1}=1, b_{0}=b_{1}=1, \gamma_{1}=-1, \gamma_{2}=-e. \\ \mu_{1}-\mu_{2}=-1 \\ {\left[u_{1}(1)+u_{1}^{\prime}(1)\right] \mu_{1}+\left[u_{2}(1)+u_{2}^{\prime}(1)\right] \mu_{2}=-e-\left[u_{0}(1)+u_{0}^{\prime}(1)\right]} \end{gathered}
or 2.69978 \mu_{1}+2.71185 \mu_{2}=2.42890.
Solving these equations, we obtain \mu_{1}=-0.05229, \mu_{2}=0.94771.
We obtain the solution of the boundary value problem from
u(x)=u_{0}(x)-0.05229 u_{1}(x)+0.94771 u_{2}(x) .
The solutions at the nodal points are given in the Table 5.1. The maximum absolute error which occurs at x=0.75, is given by
max. abs. error = 0.08168.
Alternative
Here, we solve the initial value problems
\begin{aligned} & u_{1}^{\prime \prime}-u_{1}=-4 x e^{x}, u_{1}(0)=0, u_{1}^{\prime}(0)=-\left(\gamma_{1} / a_{1}\right)=1, \\ & \left.u_{2}^{\prime \prime}-u_{2}=-4 x e^{x}, u_{2}(0)=1, u_{2}^{\prime}(0)=\left[\left(a_{0}-\gamma_{1}\right)\right) / a_{1}\right]=2. \end{aligned}
Using the given Taylor’s series method with h=0.25, we obtain (as done earlier)
\begin{aligned} u_{i, j+1} & =1.03125 u_{i, j}+0.25260 u_{i, j}^{\prime}-\left(0.13542 x_{j}+0.01042\right) e^{x_{j}} \\ u_{i, j+1}^{\prime} & =0.25 u_{i, j}+1.03125 u_{i, j}^{\prime}-2\left(0.5625 x_{j}+0.0625\right) e^{x_{j}} \\ i & =1,2 \text { and } j=0,1,2,3 . \end{aligned}
Using the initial conditions, we obtain
\begin{array}{ll} u_{1}(0.25) \approx u_{1,1}=0.24218, & u_{1}^{\prime}(0.25) \approx u_{1,1}^{\prime}=0.90625, \\ u_{1}(0.50) \approx u_{1,2}=0.42182, & u_{1}^{\prime}(0.50) \approx u_{1,2}^{\prime}=0.47348 ,\\ u_{1}(0.75) \approx u_{1,3}=0.42579, & u_{1}^{\prime}(0.75) \approx u_{1,3}^{\prime}=-0.53976 ,\\ u_{1}(1.00) \approx u_{1,4}=0.06568, & u_{1}^{\prime}(1.00) \approx u_{1,4}^{\prime}=-2.50102 ,\\ u_{2}(0.25) \approx u_{2,1}=1.52603, & u_{2}^{\prime}(0.25) \approx u_{2,1}^{\prime}=2.18750, \\ u_{2}(0.50) \approx u_{2,2}=2.06943, & u_{2}^{\prime}(0.50) \approx u_{2,2}^{\prime}=2.11573, \\ u_{2}(0.75) \approx u_{2,3}=2.53972, & u_{2}^{\prime}(0.75) \approx u_{2,3}^{\prime}=1.56571, \\ u_{2}(1.00) \approx u_{2,4}=2.77751, & u_{2}^{\prime}(1.00) \approx u_{2,4}^{\prime}=0.19872. \end{array}
Using the boundary condition at x=1, we obtain, on using (5.98),
\lambda=\frac{\gamma_2-\left[b_0 \phi_2(b)+b_1 \phi_2^{\prime}(b)\right]}{\left[b_0 \phi_1(b)+b_1 \phi_1^{\prime}(b)\right]-\left[b_0 \phi_2(b)+b_1 \phi_2^{\prime}(b)\right]} (5.98)
\lambda=\frac{-e-\left[u_{2}(1)+u_{2}^{\prime}(1)\right]}{\left[u_{1}(1)+u_{1}^{\prime}(1)\right]-\left[u_{2}(1)+u_{2}^{\prime}(1)\right]}=\frac{-5.69451}{-2.43534-2.97623}=1.05228.
Hence, we have
u(x)=\lambda u_{1}(x)+(1-\lambda) u_{2}(x)=1.05228 u_{1}(x)-0.05228 u_{2}(x)
Substituting x=0.25,0.5,0.75 and 1.0 , we get
\begin{aligned} & u(0.25) \approx 0.17506, u(0.50) \approx 0.33568, \\ & u(0.75) \approx 0.31527, u(1.00) \approx-0.07609. \end{aligned}
These values are same as given in the Table except for the round off error in the last digit.
Table 5.1. Solution of Problem 5.55. | ||
x_j | Exact : u(x_j) | u_j |
0.25 | 0.24075 | 0.17505 |
0.50 | 0.41218 | 0.33567 |
0.75 | 0.39694 | 0.31526 |
1.00 | 0.0 | -0.07610 |