Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Numerical differentiation: First derivatives

and second order derivatives, Richardson


extrapolation, Numerical integration
Dr. Chandrashekhar Nishad
Department of Mathematics,
Aryabhatta College,
University of Delhi.
Email: shekhar.nish@gmail.com

1 Non-uniform Nodal Points i.e. for unequal


nodal points
The interval [a, b] is divided as a = x0 < x1 < x2 < · · · xn = b into unequal
sub-intervals such as [x0 , x1 ], [x1 , x2 ], [x2 , x3 ] · · · [xn−1 , xn ]

1.1 Linear interpolation


We use linear interpolation, we have;
x − x1 x − x0
P1 (x) = f0 + f1
x0 − x1 x1 − x0
Differentiate w.r.t. ”x” we have
f1 − f0
f ′ (x) ≈ P1′ (x) = which is same ∀x ∈ [x0 , x1 ] (1)
x1 − x0
x0 −x1 ′′ x1 −x0 ′′
with the error E1′ (x0 ) = 2
f (ξ), & E1′ (x1 ) = 2
f (ξ), x0 < ξ < x1

1
1.2 Quadratic interpolation
For quadratic interpolation, we have
(x − x1 )(x − x2 ) (x − x0 )(x − x2 )
P2 (x) = f (x0 ) + f (x1 )+
(x0 − x1 )(x0 − x2 ) (x1 − x0 )(x1 − x2 )
(x − x0 )(x − x1 )
f (x2 ); i = 1, 2, ..., n
(x2 − x0 )(x2 − x1 )
Differentiate w.r.t. ”x” we have
2x− x1 − x2 2x − x0 − x2
f ′ (x) = P2′ (x) = f0 + f1 +
(x0 − x1 )(x0 − x2 ) (x1 − x0 )(x1 − x2 )
2x − x0 − x1
f2 (2)
(x2 − x0 )(x2 − x1 )

which is same ∀x ∈ [x0 , x2 ] with the error at the tabular point x0 is written
as
1 1
E ′′ (x0 ) = (2x0 − x1 − x2 )f ′′′ (ξ) + (x0 − x1 )(x0 − x2 )[f iv (η1 ) + f iv (η2 )]
3 24
where x, η1 , η2 ∈ (x0 , x2 )

2 Uniform Nodal Points i.e. for equal nodal


points
The interval [a, b] is divided as a = x0 < x1 < x2 < · · · xn = b into equal
sub-intervals such as [x0 , x1 ], [x1 , x2 ], [x2 , x3 ] · · · [xn−1 , xn ] each of equal length
h = xn −x
n
0
.

2.1 Linear interpolation


Using equation (1) we have
f1 − f0 x1 − x0
f ′ (x0 ) ≈ P1′ (x0 ) = where h =
h n
and also
f1 − f0
f ′ (x1 ) ≈ P1′ (x1 ) =
h
2
Error
f1 − f0
= f ′ (x0 )−1/h f (x0 ) + hf ′ (x0 ) + h2 /2f ′′ (ξ) − f (x0 )
 
E1′ (x0 ) = f ′ (x0 )−
h
so that
E1′ (x0 ) = −h/2f ′′ (ξ), x0 < ξ < x1
Similarly
E ′ (x1 ) = h/2f ′′ (η), x0 < η < x1

2.2 Quadratic interpolation


Using equation (2) we have,
1
f ′ (x0 ) ≈ P2′ (x0 ) = [−3f0 +4f1 −f2 ] by putting x1 = x0 +h, x2 = x0 +2h
2h
1
f ′ (x1 ) ≈ P2′ (x0 ) = [f2 − f0 ]
2h
and
1
f ′ (x2 ) ≈ P2′ (x0 ) = [f0 − 4f1 + 3f2 ]
2h
with errors
1
E2′′ (x0 ) = f ′′ (x0 ) − [f (x0 ) − 2f (x1 ) + f (x2 )]
h2
= −hf ′′′ (ξ1 ), x0 < ξ1 < x1

1
E2′′ (x1 ) = f ′′ (x1 ) − [f (x0 ) − 2f (x1 ) + f (x2 )]
h2
h2 iv
= − f (ξ2 ), x0 < ξ2 < x1
12

1
E2′′ (x2 ) = f ′′ (x2 ) − [f (x0 ) − 2f (x1 ) + f (x2 )]
h2
= hf ′′′ (ξ3), x0 < ξ3 < x1

First Order approximation of 1st differentiation


fk+1 − fk fk − fk−1
f ′ (xk ) = and f ′ (xk ) =
h h
3
Second Order approximation of 1st differentiation
fk+1 − fk−1
f ′ (xk ) =
2h
First Order approximation of 2nd differentiation
fk+2 − 2fk+1 + fk fk − 2fk−1 + fk−2
f ′′ (xk ) = and f ′′ (xk ) =
h2 h2
Second Order approximation of 2nd differentiation
fk−1 − 2fk + fk+1
f ′′ (xk ) =
h2
Exercise: Given the following values of f (x) = ln x, find the approximate
value of f ′ (2.0) using every methods and f ′′ (2.0) using all methods for second
derivative.
i 0 1 2
xi 2.0 2.2 2.6
f (xi ) 0.69315 0.78846 0.95551

Ef (x) = f (x + h)
= f (x) + hf ′ (x) + h2 /2!f ′′ (x) + h3 /3!f ′′′ (x) + · · ·
h2 D 2 h3 D 3
 
= 1 + hD + + + · · · f (x)
2! 3!
= ehD f (x)
⇒ E = ehD where the differential operator D = d/dx
⇒ hD = log E = log(1 + ∆) = ∆ − 1/2∆2 + 1/3∆3 · · ·
= log E = − log(1 − ▽) = ▽ + 1/2▽2 + 1/3▽3 + · · ·
and
δ = (E 1/2 − E −1/2 ) = (ehD/2 − e−hD/2 ) = 2 sinh(hD/2)
 
δ 1
⇒ hD = 2 sinh −1
= δ − 2 δ3 + · · ·
2 2 3!
 
1 1 2 1 3


h 
 ∆f k − 2
∆ f k + 3
∆ − · · ·
1 1 2 1 3


f (xk ) = h n k 2▽f + ▽ fk + 3
▽ fok · · ·
 δfk − 122 δ 3 fk + · · ·
1

h 2 3!

4
Similarly for second derivatives
 
1 2 3 11 4

 h2 ∆ fk − ∆ fk + 12 ∆ − · ·
 ·
f ′′ (xk ) = h12 ▽2 fk + ▽3 fk + 11
12
▽4 fk · · ·
1  2 1 4 1 6

δ fk − 12 δ fk + 90 δ fk − · · ·

h2

Please solve the above example using these formulae also construct the
table as given in previous notes.

3 Extrapolation Methods
By this method we combines the computed values obtained by using a certain
method with different step sizes.
Let g(h) denotes the approximate value of g, obtained by using a method
of order p, with step size h and g(qh) denote the value of g obtained by using
the same method of order p, with step size qh. We have

g(h) = g + chp + O(hp+1)

g(qh) = g + cq p hp + O(hp+1)
Eliminating c from the above equations, we get
q p g(h) − g(qh)
g= + O(hp+1)
qp − 1
Thus we obtain
q p g(h) − g(qh)
g (1) (h) = = g + O(hp+1) (3)
qp − 1
which is of order p + 1. This technique of combining two computed values
obtained by using the same method with two different step sizes, to obtain a
higher order method is called the Extrapolation method or Richardson’s
extrapolation.
To illustrate this procedure we consider the method
f1 − f−1 f (x0 + h) − f (x0 − h)
f ′ (x0 ) = = using Taylor series we have (4)
2h 2h
f ′′′ (x0 ) 2 f v (x0 ) 4 f vii (x0 ) 6
= f ′ (x0 ) + h + h + h +···
3! 5! 7!
5
The local truncation error is obtained as
f (x0 + h) − f (x0 − h)
E ′ (x0 ) = f ′ (x0 ) −
2h
v vii
f (x0 ) 2 f (x0 ) 4 f (x0 ) 6
′′′
=− h − h − h −···
3! 5! 7!
′′′ (x v (x vii (x
Now taking c1 = − f 3!
0)
, c2 = − f 5!
0)
, c3 = − f 7!
0)
,···
therefore
E ′ (x0 ) = c1 h2 + c2 h4 + c3 h6 + · · ·
Let g(x) = f ′ (x0 ) be the quantity which is to be obtained and g(h/2r ) denote
the approximate value of g(x) obtained by using (4) with the step length
h/2r , r = 0, 1, 2, 3, .... Thus we have

g(h) = g(x) + c1 h2 + c2 h4 + c3 h6 + · · ·

h c1 h2 c2 h4 c3 h6
g( ) = g(x) + + + +··· (5)
2 4 16 64
h c1 h2 c2 h4 c3 h6
g( 2 ) = g(x) + + + +···
2 16 256 4096
Eliminating c1 from the above equation we obtain
4g(h/2) − g(h)
g (1) (h) =
3
c2 h4 5c3 h6
= g(x) − − −···
4 16

4g(h/22) − g(h/2)
g (1) (h/2) =
3
c2 h4 5c3 h6
= g(x) − − −··· (6)
64 1024
Thus g (1) (h), g (1) (h/2), · · · given by (6) are O(h4 ) approximations to g(x),
Eliminating c2 from (6), we have

42 g (1) (h/2) − g (1) (h) 1


g (2) (h) = 2
+ c3 h6 + · · · (7)
4 −1 64
which gives an O(h6 ) approximation.

6
Table 1: Extrapolation Table
Order Second Fourth Sixth Eighth
h g(h)
4g(h/2)−g(h)
h/2 g(h/2) g (1) (h) = 3
4g(h/22 )−g(h/2) 42 g (1) (h/2)−g (1) (h)
h/22 g(h/22) g (1) (h/2) = 3
g (2) (h) = 42 −1
4g(h/23 )−g(h/22 ) 42 g (1) (h/22 )−g (1) (h/2)
h/23 g(h/23) g (1) (h/22 ) = 3
g (2) (h/2) = 42 −1
g (3) (h) =
43 g (2) (h/2)−g (2) (h)
43 −1

Thus the successive higher order results can be obtained from the formula

4m g (m−1) (h/2) − g (m−1) (h)


g (m) (h) = , m = 1, 2, 3, ... (8)
4m − 1
where g (0) (h) = g(h)

Exercise: The following table of values is given:


x -1 1 2 3 4 5 7
f (xi ) 1 1 16 81 256 625 2401
Using the formula f ′ (x1 ) = f (x2 )−f
2h
(x0 )
and Richardson’s extrapolation, find
f (3).

4 General Newton-Cotes Formulas

Z b
f (x)dx = In (f ) Newton-Cotes formula
a
Z b X n
!
= Ln,i (x)f (xi ) dx
a i=0
n
X Z b 
= Ln,i (x)dx f (xi )
i=0 a

Xn
= wi f (xi )
i=0

7
Rb Pn
where wi = a
Ln,i (x)dx and i=0 Ln,i (x)f (xi ) is Lagrange Polynomial where

(x − x0 )(x − x1 )(x − x2 ) · · · (x − xi−1 )(x − xi+1 ) · · · (x − xn )


Ln,i (x) =
(xi − x0 )(xi − x1 )(xi − x2 ) · · · (xi − xi−1 )(xi − xi+1 ) · · · (xi − xn )

4.1 Closed Newton-Cotes Formulas


For closed Newton-Cotes formulas include end points a and b of the integra-
tion.
1. Trapezoid rule: for this method taking n = 1 so x0 = a & x1 = b
Z b
f (x)dx = w0 f (x0 ) + w1 f (x1 ) = w0 f (a) + w1 f (b)
a

b b
x−b b−a
Z Z
w0 = L1,0 (x)dx = dx =
a a a−b 2
and
b b
x−a b−a
Z Z
w1 = L1,1 (x)dx = dx =
a a b−a 2
Z b
f (x)dx = w0 f (x0 ) + w1 f (x1 )
a
b
b−a b−a b−a
Z
f (x)dx = f (a) + f (b) = [f (a) + f (b)]
a 2 2 2
Z b  
b−a
f (x)dx = [f (a) + f (b)]
a 2
Composite Trapezoid rule: Interval [a, b] is divided into n sub-intervals
such as [a = x0 , x1 ], [x1 , x2 ], [x2 , x3 ] · · · [xn−1 , xn = b]. All sub-intervals are
equal distance h = b−a n
Z b Z x1 Z x2 Z xn
f (x)dx = f (x)dx + f (x)dx + · · · + f (x)dx
a x0 x1 xn−1

h
[(f (x0 ) + f (x1 )) + (f (x1 ) + f (x2 )) + (f (x2 ) + f (x3 )) + · · · + (f (xn−1 ) + f (xn ))]
2
Z b  
h
f (x)dx = [f (a) + 2(f (x1 ) + f (x2 ) + f (x3 ) · · · + f (xn−1 )) + f (b)]
a 2

8
Simpson’s one-three rule: for this method taking n = 2 so that the
intervals contains three nodal points x0 , x1 , x2 are [x0 , x2 ] & h = b−a
2
and
x0 = a, x1 = a + h = (a + b)/2 & x2 = a + 2h = b
Z b
f (x)dx = w0 f (x0 )+w1 f (x1 )+w2 f (x2 ) = w0 f (a)+w1 f ((a+b)/2)+w3 f (b)
a

b b
(x − (a + b)/2)(x − b) (b − a)/2
Z Z
w0 = L2,0 (x)dx = dx =
a a (a − (a + b)/2)(a − b) 3
4 b−a
b b

(x − a)(x − b)
Z Z
2
w1 = L2,1 (x)dx = dx =
a a ((a + b)/2 − a)((a + b)/2 − b) 3
Z b Z b b−a

(x − a)(x − (a + b)/2) 2
w2 = L2,2 (x)dx = dx =
a a (b − a)(b − (a + b)/2) 3

Z b
f (x)dx = w0 f (x0 ) + w1 f (x1 ) + w2 f (x2 )
a
b−a b−a b−a
   
4

2 2 b−a 2
= f (a) + f + f (b)
3 3 2 3
b−a

2
= [f (a) + f ((a + b)/2) + f (b)]
3
   
h a+b
= f (a) + 4f + f (b)
3 2

Composite Simpson’s one-three rule: We need three nodal points for


this method. Interval [a, b] is divided into even number 2N of sub-intervals of
equal length. Sub-intervals are taken as [a = x0 , x2 ], [x2 , x4 ], [x4 , x6 ] · · · [x2N −2 , x2N =
b]. All sub-intervals are equal distance h = b−a2N
.
Z b Z x2 Z x4 Z x2N
f (x)dx = f (x)dx + f (x)dx + · · · + f (x)dx
a x0 x2 x2N−2

b
h
Z
f (x)dx = [(f0 + 4f1 + f2 ) + (f2 + 4f3 + f4 ) + · · · + (f2N −2 + 4f2N −1 + f2N )]
a 3
b
h
Z
f (x)dx = [f0 +4(f1 +f3 +f5 +· · ·+f2N −1 )+2(f2 +f4 +f6 +· · ·+f2N −2 )+f2N ]
a 3

9
Simpson’s three-eight rule: for this method taking n = 3 so that the
intervals contains four nodal points x0 , x1 , x2 , x3 are [x0 , x3 ] & h = b−a
3
and
x0 = a, x1 = a + h, x2 = a + 2h & x3 = a + 3h = b i.e. h = x1 − x0 , 2h =
x2 − x0 , 3h = x3 − x0
Z b
f (x)dx = w0 f (x0 ) + w1 f (x1 ) + w2 f (x2 ) + w3 f (x3 )
a

b b
(x − x1 )(x − x2 )(x − x3 )
Z Z
w0 = L3,0 (x)dx = dx
a a (x0 − x1 )(x0 − x2 )(x0 − x3 )
3h
=
8

b b
(x − x0 )(x − x2 )(x − x3 )
Z Z
w1 = L3,1 (x)dx = dx
a a (x1 − x0 )(x1 − x2 )(x1 − x3 )
9h
=
8

b b
(x − x0 )(x − x1 )(x − x3 )
Z Z
w2 = L3,2 (x)dx = dx
a a (x2 − x0 )(x2 − x1 )(x2 − x3 )
9h
=
8

b b
(x − x0 )(x − x1 )(x − x2 )
Z Z
w3 = L3,3 (x)dx = dx
a a (x3 − x0 )(x3 − x1 )(x3 − x2 )
3h
=
8

Z b
f (x)dx = w0 f (x0 ) + w1 f (x1 ) + w2 f (x2 ) + w3 f (x3 )
a
3h 9h 9h 3h
= f (a) + f (a + h) + f (a + 2h) + f (b)
8 8 8 8
3h
= [f (a) + 3f (a + h) + 3f (a + 2h) + f (b)]
8

10
Composite Simpson’s three-eight rule: We need four nodal points for
this method. Interval [a, b] is divided into 2N sub-intervals of equal length.
Sub-intervals are taken as [a = x0 , x3 ], [x3 , x6 ], [x6 , x9 ] · · · [x3N −3 , x3N = b].
All sub-intervals are equal distance h = b−a
3N
.
Z b Z x3 Z x6 Z x9 Z x3N
f (x)dx = f (x)dx +
f (x)dx + f (x)dx + · · · + f (x)dx
a x0 x6 x3 x3N−3
   
3h 3h
= (f (x0 ) + 3f (x1 ) + 3f (x2 ) + f (x3 )) + (f (x3 ) + 3f (x4 ) + 3f (x5 ) + f (x6 )) +
8 8
 
3h
···+ (f (x3N −3 ) + 3f (x3N −2 ) + 3f (x3N −1 ) + f (x3N ))
8

b
3h
Z
f (x)dx = [f (x0 ) + 3 {f (x1 ) + f (x4 ) + f (x7 ) + · · · + f (x3N −2 )} +
a 8
3 {f (x2 ) + f (x5 ) + f (x8 ) + · · · + f (x3N −1 )} +
2 {f (x3 ) + f (x6 ) + f (x9 ) + · · · + f (x3N −3 )} + f (x3N )]

4.2 Newton-Cotes open formulas


Newton-Cotes
R b open formula we do not consider the end points a and b of the
integration a f (x)dx.

Mid-point rule: The simplest open Newton-Cotes formula corresponds


to n = 0. With n = 0, h = b−a2
and only the nodal point is mid point of a
a+b
and b let it be x0 = 2 so that L0,0 = 1
Z b
f (x)dx = w0 f (x0 )
a

where Z b Z b
w0 = L0,0 (x)dx = 1dx = b − a
a a
so that
Z b
f (x)dx = w0 f (x0 ) = (b − a)f (a + h) = 2hf (a + h)
a

11
Two-point rule: Another open Newton-Cotes formula corresponds to
n = 1 interval [a, b] is divided into three sub-intervals and leave the end points
a and b. So that with n = 1, h = b−a 3
and the nodal points are x0 = a + h,
x1 = a + 2h. Z b
f (x)dx = w0 f (x0 ) + w1 f (x1 )
a
where
b b
(x − x1 ) (x − (a + 2h))
Z Z
w0 = dx = dx
a x0 − x1 a (a + h) − (a + 2h)
3
w0 = h
2
and
b b
(x − x0 ) (x − (a + h))
Z Z
w1 = dx = dx
a x1 − x0 a (a + 2h) − (a + h)
3
w1 = h
2
So that
b  
3
Z
f (x)dx = h [f (a + h) + f (a + 2h)]
a 2
Three-point rule: Another open Newton-Cotes formula corresponds to
n = 2 interval [a, b] is divided into four sub-intervals and leave the end points
a and b. So that with n = 2, h = b−a 4
and the nodal points are x0 = a + h,
x1 = a + 2h & x2 = a + 3h.
Z b
f (x)dx = w0 f (x0 ) + w1 f (x1 ) + w2 f (x2 )
a

where
b
(x − x1 )(x − x2 )
Z
w0 = dx
a (x0 − x1 )(x0 − x2 )
8
w0 = h
3
b
(x − x0 )(x − x2 )
Z
w1 = dx
a (x1 − x0 )(x1 − x2 )
4
w1 = − h
3

12
b
(x − x0 )(x − x1 )
Z
w2 = dx
a (x2 − x0 )(x2 − x1 )
8
w2 = h
3
Z b      
8 4 8
f (x)dx = h f (x0 ) − h f (x1 ) + h f (x2 )
a 3 3 3
Z b  
4
f (x)dx = h [2f (a + h) − f (a + 2h) + 2f (a + 3h)]
a 3
Four-point rule: Another open Newton-Cotes formula corresponds to
n = 3 interval [a, b] is divided into five sub-intervals and leave the end points
a and b. So that with n = 3, h = b−a 5
and the nodal points are x0 = a + h,
x1 = a + 2h, x2 = a + 3h & x3 = a + 4h.
Z b
f (x)dx = w0 f (x0 ) + w1 f (x1 ) + w2 f (x2 ) + w3 f (x3 )
a

where
b
(x − x1 )(x − x2 )(x − x3 )
Z
w0 = dx
a (x0 − x1 )(x0 − x2 )(x0 − x3 )
55
w0 = h
24
b
(x − x0 )(x − x2 )(x − x3 )
Z
w1 = dx
a (x1 − x0 )(x1 − x2 )(x1 − x3 )
5
w1 = h
24
b
(x − x0 )(x − x1 )(x − x3 )
Z
w2 = dx
a (x2 − x0 )(x2 − x1 )(x2 − x3 )
5
w2 = h
24
b
(x − x0 )(x − x1 )(x − x2 )
Z
w3 = dx
a (x3 − x0 )(x3 − x1 )(x3 − x2 )
55
w3 = h
24

13
b        
55 5 5 55
Z
f (x)dx = h f (x0 ) + h f (x1 ) + h f (x2 ) + + h f (x3 )
a 24 24 24 24
Z b  
5
f (x)dx = h [11f (a + h) + f (a + 2h) + f (a + 3h) + 11f (a + 3h)]
a 24
Please you all have to learn formulae of all methods except four-point rule.
Exercise-1: Find approximate value of
Z 1
dx
I=
0 1+x

using (i) trapezoidal rule (ii) Simpson’s one-three rule (iii) Simpson’s three-
rule.
And from above example also solve using composite rules of all methods
taking n = 6.
Also solve above example using open Newton-Cotes formula i.e. using
one-point rule, two-point rule and three-point rule.

4.3 Gaussian quadrature Method


When the nodes are not known i.e. the nodes are to be determined. Since
for any finite interval [a, b] can also be transformed to [−1, 1], using the
transformation
b−a b+a
x= t+
2 2
We consider the integral in the form
Z 1 Xn
w(x)f (x)dx = λk fk (9)
−1 k=0

where w(x) > 0, −1 ≤ x ≤ 1, is the weight function.


Gauss-Legendre Integration Methods:
Let the weight function be w(x) = 1. Then the method (9) reduced to
Z 1 n
X
f (x)dx = λk f (xk ) (10)
−1 k=0

In this case, all the nodes xk and weights λk are unknown. Consider the
following cases. One-point formula: n = 0. The formula is given by
Z 1
f (x)dx = λ0 f (x0 ) (11)
−1

14
to evaluate λ0 and x0 we have f (x) = 1 & f (x) = x,
R1
for f (x) = 1, 1dx = 2 = λ0 f (x0 ) = λ0 , ⇒ λ0 = 2
R−1
1
for f (x) = x, −1
xdx = 0 = λ0 f (x0 ) = λ0 x0 , ⇒ x0 = 0
Hence the method is given by
Z 1
f (x)dx = 2f (0) (12)
−1

Two-point formula: n = 1. The formula is given by


Z 1
f (x)dx = λ0 f (x0 ) + λ1 f (x1 ) (13)
−1

to evaluate λ0 , x0 , λ1 & x1 we have f (x) = 1, x, x2 , x3 ,


R1
for f (x) = 1, 1dx = 2 = λ0 f (x0 ) + λ1 f (x1 ) = λ0 + λ1 , ⇒ λ0 + λ1 = 2
R−1
1
for f (x) = x, xdx = 0 = λ0 x0 + λ1 x1 , ⇒ λ0 x0 + λ1 x1 = 0
R−11 2
2
for f (x) = x , −1
x dx = 32 = λ0 x20 + λ1 x21 , ⇒ λ0 x20 + λ1 x21 = 32
1
for f (x) = x3 , x3 dx = 0 = λ0 x30 + λ1 x31 , ⇒ λ0 x30 + λ1 x31 = 0
R
−1
After solving above four equations we have λ0 = λ1 = 1 and x0 = √13 , x1 =
− √13 or x0 = − √13 , x1 = √13 Hence the method is given by

1
1 1
Z
f (x)dx = f (− √ ) + f ( √ ) (14)
−1 3 3
Three-point formula: n = 2. The formula is given by
Z 1
f (x)dx = λ0 f (x0 ) + λ1 f (x1 ) + +λ2 f (x2 ) (15)
−1

to evaluate λ0 , x0 , λ1 , x1 , λ2 & x2 we have f (x) = 1, x, x2 , x3 , x4 , x5 ,


R1
for f (x) = 1, 1dx = 2 = λ0 + λ1 + λ2
R−1
1
for f (x) = x, xdx = 0 = λ0 x0 + λ1 x1 + λ2 x2
R−11 2
for f (x) = x2 , x dx = 32 = λ0 x20 + λ1 x21 + λ2 x22
R−11
for f (x) = x3 , x3 dx = 0 = λ0 x30 + λ1 x31 + λ2 x32
R−11
for f (x) = x4 , −1
x4 dx = 25 = λ0 x40 + λ1 x41 + λ2 x42
R1 5
for f (x) = x5 , −1
x dx = 0 = λ0 x50 + λ1 x51 + λ2 x52

15
After solvingqabove six equations we have λ0 = λ2 = 5/9, λ1 = 8/9 and
x1 = 0, x1 = 35 = −x0 Hence the method is given by
" r r #
1
1 3 3
Z
f (x)dx = f (− ) + 8f (0) + 5f ( ) (16)
−1 9 5 5

Note: Must all the learn formulae and also learn this the transformation
x = b−a
2
t + b+a
2
for the change of limit of given integration.
Exercise: Evaluate the integral
Z 1
dx
I=
0 1+x

using Gauss-Legendre (i) one-point (ii) two-point (iii) three point formula.

4.4 Extrapolation methods: Romberg integration


If we applied Richardson’s extrapolation procedure on integration method
then it is called Romberg integration. Consider the integral
Z b
I= f (x)dx (17)
a

The errors in the composite trapezoidal rule IT and the composite Simpson’s
rule IS can be obtained as

I = IT + c1 h2 + c2 h4 + c3 h6 + · · · (18)

I = IS + d1 h4 + d2 h6 + d3 h8 + · · · (19)
where c’s and d’s are constants independent of h. The extrapolation proce-
dure as we have done in (5) for the trapezoidal rule (18) becomes as
(m−1) (m−1)
(m) 4 m IT (h/2) − IT (h)
IT (h) = , m = 1, 2, 3, ... (20)
4m − 1
The extrapolation procedure as we have done in (5) for the trapezoidal
rule (19) becomes as
(m−1) (m−1)
(m) 4m+1 IS (h/2) − IS (h)
IS (h) = , m = 1, 2, 3, ... (21)
4m+1 − 1

16
Exercise: Find the approximate value of the integral
Z 1
dx
I=
0 1+x

using (i) Composite trapezoidal rule with 2,3,5,9 nodes and Romberg inte-
gration,
(ii) Composite Simpson’s rule with 3,5,9 nodes and Romberg integration.
Note: Kindly this example at page no. 391.

17

You might also like