Holooly Plus Logo

Question 5.58: Solve the boundary value problem y″ + (1 + x²) y + 1 = 0, y ......

Solve the boundary value problem

y″ + (1 + x²) y + 1 = 0, y (± 1) = 0

with step lengths h = 0.5, 0.25 and extrapolate. Use a second order method.

Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

Replacing x by -x, the boundary value problem remains unchanged. Thus, the solution of the problem is symmetrical about the y-axis. It is sufficient to solve the problem in the interval [0,1]. The nodal points are given by

x_{n}=n h, n=0,1,2, \ldots \ldots ., N

where N h=1.

The second order method gives the difference equation

\frac{1}{h^{2}}\left[y_{n-1}-2 y_{n}+y_{n+1}\right]+\left(1+x_{n}^{2}\right) y_{n}+1=0,

or -y_{n-1}+\left[2-\left(1+x_n^2\right) h^2\right] y_n-y_{n+1}=h^2, n=0,1,2, \ldots \ldots, N.

The boundary condition gives y_{N}=0.

For h=1 / 2, N=2, we have

\begin{array}{ll} n=0: & -y_{-1}+(7 / 4) y_{0}-y_{1}=1 / 4, \\ n=1: & -y_{0}+(27 / 16) y_{1}-y_{2}=1 / 4. \end{array}

Due to symmetry y_{-1}=y_{1} and the boundary condition gives y_{2}=0.

The system of linear equations is given by

\left[\begin{array}{cc} 7 / 4 & -2 \\ -1 & 27 / 16 \end{array}\right]=\left[\begin{array}{l} y_{0} \\ y_{1} \end{array}\right]=\frac{1}{4}\left[\begin{array}{l} 1 \\ 1 \end{array}\right]

whose solution is y_{0}=0.967213, y_{1}=0.721311.

For h=1 / 4, N=4, we have the system of equations

\left[\begin{array}{cccc} 31 / 16 & -2 & 0 & 0 \\ -1 & 495 / 256 & -1 & 0 \\ 0 & -1 & 123 / 64 & -1 \\ 0 & 0 & -1 & 487 / 256 \end{array}\right]\left[\begin{array}{l} y_{0} \\ y_{1} \\ y_{2} \\ y_{3} \end{array}\right]=\frac{1}{16}\left[\begin{array}{l} 1 \\ 1 \\ 1 \\ 1 \end{array}\right]

Using the Gauss-elimination method to solve the system of equations, we obtain

y_{0}=0.941518, y_{1}=0.880845, y_{2}=0.699180, y_{3}=0.400390.

Using the extrapolation formula

y(x)=\frac{1}{3}\left(4 y_{h / 2}-y_{h}\right),

the extrapolated values at x=0,0.5 are obtained as

y_{0}=0.932953, y_{1}=0.691803 \text {. }

Related Answered Questions