Numerical Methods 15
Numerical Methods 15
In this method, the derivatives appearing in the differential equation and the
boundary conditions are replaced by their finite-difference approximations
and the resulting linear system of equations are solved by any standard
procedure. These roots are the values of the required solution at the pivotal
points.
The finite difference approximations to the various derivatives are derived
under:
h2 00 h3
y (x + h) = y (x) + hy 0 (x) + y (x) + y 000 (x) + .... (1)
2! 3!
and
h2 00 h3
y (x − h) = y (x) − hy 0 (x) + y (x) − y 000 (x) + .... (2)
2! 3!
1h i
y 0 (x) = y (x) − y (x − h) + o(h)
h
which is the backward difference approximations of y 0 (x) with an error of
the order h.
1h i
y 0 (x) = y (x + h) − y (x − h) + o(h2 )
2h
which is the central difference approximation of y 0 (x) with an error of the
order h2 . Clearly this central difference approximation y 0 (x) is better than
forward or backward difference approximation and hence should be preferred.
1h i
y 00 (x) = y (x + h) − 2y (x) + y (x − h) + o(h2 )
h2
which is the central difference approximation of y 00 (x).
Similarly we can derive central difference approximation to higher deriva-
tives.
(yi+1 − yi−1 )
4(1 + xi2 )(yi+1 − 2yi + yi−1 ) − 2xi 1
+ xi2 yi = xi2
2× 2
(4 + 4x12 + 2x1 )y0 + (−8 − 7x12 )y1 + (4 + 4x12 − 2x1 )y2 = x12
(4 + 4x22 + 2x2 )y1 + (−8 − 7x22 )y2 + (4 + 4x22 − 2x2 )y3 = x22
⇒ 10y1 − 15y2 + 6y3 = 1(∵ x2 = 1) (7)
(4 + 4x32 + 2x3 )y2 + (−8 − 7x32 )y3 + (4 + 4x32 − 2x3 )y4 = x32
⇒ 16y2 − 23.75y3 + 10y4 = 2.25 (∵ x3 = 1.5) (8)
(4 + 4x42 + 2x4 )y3 + (−8 − 7x42 )y4 + (4 + 4x42 − 2x4 )y5 = x42
⇒ −36y4 + 24y3 + 16y5 = 4 (∵ x4 = 2) (9)
(4 + 4x52 + 2x5 )y4 + (−8 − 7x52 )y5 + (4 + 4x52 − 2x5 )y6 = x52
⇒ 34y4 − 51.75y5 + 24y6 = 6.25 (∵ x5 = 2.5) (10)
(4 + 4x62 + 2x6 )y5 + (−8 − 7x62 )y6 + (4 + 4x62 − 2x6 )y7 = x62
⇒ 46y5 − 71y6 + 34y7 = 9 (∵ x6 = 3) (11)
(4 + 4x72 + 2x7 )y6 + (−8 − 7x72 )y7 + (4 + 4x72 − 2x7 )y8 = x72
⇒ 60y6 − 93.75y7 = −79.95 (∵ x7 = 3.5) (12)
9.75 −4
0 0 0 0 0 y1 29.75
10 −15 6 0 0 0 0 y2 1
0
16 −23.75 10 0 0 0 y3 2.25
0
0 24 −36 16 0 0 y4 = 4
0
0 0 34 −51.75 24 0 y5 6.25
0 0 0 0 46 −71 34 y6 9
0 0 0 0 0 60 −93.75 y7 −79.95
−−−∗−−−∗−−−∗−−−
−−−∗−−−∗−−−∗−−−
at i=2,
at i=3,
y0 = 0 (31)
Since
1
yi0 =
(yi+1 − yi−1 )
2h
1
∵ for i = 0, 0 = y00 = (y1 − y−1 )
2h
⇒ y−1 = y1 (32)
y4 = 2y3 − y2 (33)
Also
1
yi000 = (yi+2 − 2yi+1 + 2yi−1 − yi−2 )
2h3
∵ for i = 3, 0 = y3000 = 1
(y
2h3 5
− 2y4 + 2y2 − y1 ) i.e.,
Using Eq. (33) and Eq. (34), the equation (30) reduces to
−−−∗−−−∗−−−∗−−−