Unit 5
Unit 5
𝑥 − 𝑥0
𝑢= , 𝑥= 𝑥 0 + 𝑢h
h
' 1
y ( x) y 0
2u 1 2
y0
(3u 2 6u 2) 3
y0
(4u 3 18u 2 22u 6) 4
y0 ...............
h 2! 3! 4!
1 3 2u 3 4
y "' ( x) y 0 y 0 .......... .......... .......... .....
h3 2
Derivatives at x = x0 (i.e) u = 0
1 1 2 1 3 1 4
y ' ( x0 ) y y y y .......... ....
h
0 0 0 0
2 3 4
1 2 3 11 4
y" ( x0 ) 2 y 0 y 0 y 0 ...............
h 12
1 3 3 4
y" ' ( x0 ) y y .......... .......... .
h 3
0 0
2
Newton’s backward difference formula to compute derivatives
1
y ' ( x) y n
2 v 1 2 y n
3v 2
6 v 23 y n
( 4v 3
18v 2
22v 6) 4
y n .........
h 2 6 24
1 2 3 ( 6v 2
18v 11) 4
y" ( x) 2 y n (v 1) y n y n ............
h 12
1 3 12v 18 4
y" ' ( x) 3 y n y n .......... .
h 12
Derivatives at x = xn (i.e) v = 0
1 1 2 1 3 1 4
y ' ( xn ) y y y y .........
h
n n n n
2 3 4
1 2 3 11 4
y" ( x n ) 2 y n y n 12 y n ............
h
1 3 3 4
y" ' ( x n ) 3 y n y n ...........
h 2
Central difference formula for computing the derivation at x = x0
11 1 3 3 1 5 5
y ' ( x0 ) (y 0 y 1 ) ( y 1 y 2 ) ( y 2 y 3 ) .......
h2 12 60
1 2 1 4
y" ( x0 ) 2 y 1 12 y 2 ................
h
1 1 3 3
y" ' ( x0 ) 3 2 ( y 1 y 2 ) .......... ..
h
Example 1:
Compute f’(0) and f’(4) , f”(4) from the data using newton’ s method .
x 0 1 2 3 4
y 1 2.718 7.381 20.086 54.598
Solution:
Here x0 = 0 & xn = 4
y’(x) at x = x0 (i.e) x = 0
x y Δy Δ2y Δ3y Δ4y
0 1
1.718
1 2.718 2.945
4.663 5.097
2 7.381 8.042 8.668
12.705 13.765
3 20.086 21.807
34.512
4 54.598
1 1 1 1
f ' (0) 1.718 (2.945) (5.097) (8.668)
1 2 3 4
= 1.718 – 1.4725 + 1.699 – 2.167
= - 0.2225
Derivatives at x = xn here xn = 4
1 1 1 1
y ' ( x n ) y n 2 y n 3 y n 4 y n .........
h 2 3 4
1 1 1 1
f ' (4) 34.512 (21.807) (13.765) (8.668) .........
1 2 3 4
1 2 3 11 4
y" ( xn ) 2 y n y n y n .......... ..
h 12
1 11
f " ( 4) 2 21.807 13.765 12 (8.668)
1
= 43.5177
Example:
Given that
x: 1.0 1.1 1.2 1.3 1.4 1.5 1.6
y: 7.989 8.403 8.781 9.129 9.451 9.750 10.031
Find dy d2y
& 2
at ( a ) x 1.1(b) x 1.6
dx dx
Solution:
x y y 2 y 3 y 4 y 5 y 6 y
1.0 7.989
0.414
1.1 8.403 – 0.036
0.378 0.006
1.2 8.781 – 0.030 – 0.002
0.348 0.004 0.001
1.3 9.129 – 0.026 – 0.001 0.002
0.322 0.003 0.003
1.4 9.451 – 0.023 0.002
0.299 0.005
1.5 9.750 -0.018
0.281
1.6 10.031
dy 1 1 1 1 1 1
y0 2 y0 3 y0 4 y0 5 y0 6 y0 ..............
dx x x0 h 2 3 4 5 6
d2y 1 11 5 137 6
2 2 2 y 0 3 y 0 4 y 0 . 5 y 0 y 0 ..............
dx x x0 h 12 6 180
dy 1 1 1 1 1
0 . 378 ( 0 . 03) ( 0 . 004 ) ( 0 . 001) ( 0 . 003) 3.952
dx x 1.1 0.1 2 3 4 5
d2y 1 11 5
2 2 0. 03 ( 0 . 004 ) ( 0 . 001) . ( 0 . 003) 3.74
dx x 1.1 ( 0 .1) 12 6
dy 1 1 2 1 3 1 4
y n y n y n y n .........
dx x xn h 2 3 4
d2y 1 2 3 11 4
2
2
y n y n y n .......... ..
dx x xn h 12
dy 1 1 1 1 1 1
0.281 ( 0.018) (0.05) (0.002) (0.003) (0.002) 2.75
dx x 1.6 0.1 2 3 4 5 6
d2y 1 11 5 137
2
2 0 .018 0 . 005 ( 0 . 002) ( 0 . 003) ( 0 . 002) 0.715
dx x 1.6 (0.1) 12 6 180
Example:
The population of a certain town is given below.Find the rate of growth of the
population in 1931,1941,1961 and 1971.
x0 = 1931,x1 = 1941,………….
x x0 1931 1931
u 0
h 10
dy dy 1 1 2 1 3 1 4 1 5 1 6
y 0 y 0 y 0 y 0 y 0 y 0 ..............
dx dx h
x 1931 u 0 2 3 4 5 6
1 1 1 1
20.18 ( 1.03) (5.49) ( 4.47)
10 2 3 4
1
20.18 0.515 1.83 1.1175
10
2.36425
If x = 1941,
x x0 1941 1931
u 1
h 10
Putting u = 1 in
dy 1
y0
2u 1 2
y0
(3u 2 6u 2) 3
y0
(4u 3 18u 2 22u 6) 4
y0 ...............
dx h 2! 3! 4!
We get
dy 1 1 1 1
u 1 20.18 ( 1.03) (5.49) ( 4.47)
dx 10 2 6 12
1
20.18 0.515 0.915 0.3725
10
1.83775
Note:
If we neglect the data against 1931 and take 1941 as x0 we have
1 1 1
19.15 4.46 (1.02)
10 2 3
1.7260
To get f’(1971),we use the formula,
dy 1 1 2 1 3 1 4
y y y y .........
dx x xn h
n n n n
2 3 4
dy 1 1 1 1
29.09 (5.48) (1.02) ( 4.47) .........
dx x 1971 10 2 3 4
dy 1
(31.0525) 3.10525
dx 1971 10
To get f’(1961),we use
x xn 1961 1971
v 1
h 10
dy dy 1 2v 1 2 3v 2 6v 2 3
ny y n y n .............
1961 dx v 1 h
dx 2 6 v 1
1 1 1 1
29.09 5.48 (1.02) ( 4.47)
10 2 6 12
1
29.09 2.74 0.17 0.3725
10
2.65525
Example:
Find the first and second derivative of the function tabulated below at x = 0.6
Solution:
Since x = 0.6 is in the middle of the table, we will use stirling’s formula.
X y Dy D2y D3y D4y
0.4 1.5836
0.2138
0.5 1.7974 0.0330
0.2468 0.0035
0.6 2.0442 0.0365 0.0003
0.2833 0.0038
0.7 2.3275 0.0403
0.3236
0.8 2.6511
By stirling’s formula,
dy 11 1 3 3 1 5 5
( y y ) ( y y ) ( y y ) .......
dx x x0 h 2
0 1 1 2 2 3
12 60
1 1 1
( 0 .2833 0 .2468) ( 0. 0038 0 . 0035)
0.1 2 12
dy
100.26505 0.0006083
dx x 0.6
2.64442
d2y 1 2 1 4
2 2 y 1 y 2 .......... ...
dx x x 0 h 12
d2y 1 1
2 0 . 0365 ( 0 . 0003) .......... ...
dx x 0.6 ( 0 . 01) 12
3.6475
Example:
Obtain the value of f’(0.04) using Bessel’s formula given the table below.
Solution:
Since x = 0.04 is in the middle of the table we use central difference formula
0.01 -3 0.1023
0.0024
0.02 -2 0.1047 0.0
0.0024 0.0001
-
0.03 -1 0.1071 0.0001 0.0001
0.0025 0.0 0.0
-
0.04 0 0.1096 0.0001 0.0001
-
0.0026 0.0001
0.05 1 0.1122 0.0
0.0026
0.06 2 0.1148
Since
x x0 x 0.04
u
h 0.01
1 1 1 1
y ' ( x0 ) 0 . 0026 ( 0 0. 0001) ( 0 .0001 ) ( 0 . 0001 )
0.01 4 12 24
1
24 0.0026 0.0006 0.0003
0.24
f ' (0.04) 0.25625
Numerical Integration:
Trapezoidal Rule:
x0 nh
h
y ( x)dx y0 y n 2( y1 y 2 ........ y n 1 )
x0
2
Simpson’s 1/3 rd rule:
x0 nh
h
y ( x)dx y 0 y n 4( y1 y3 ........) 2( y 2 y 4 ........)
x0
3
Solution:
0
h
10 10
x 0 2 3 4 5 6 7 8 9
10 10 10 10 10 10 10 10 10
y 0 0.3090 0.5878 0.8090 0.9511 1 0.9511 0.8090 0.5878 0.3090 0
Trapezoidal Rule:
x0 nh
h
y ( x)dx y0 yn 2( y1 y2 ........ yn 1 )
x0
2
10 0 0 2(0.3090 0.5878 0.8090 0.9511 1 0.9511 0.8090 0.5878 0.3090)
2
20
1.9817(nearly )
Simpson’s 1/3 rd rule:
x0 nh
h
y ( x)dx y0 y n 4( y1 y3 ........) 2( y 2 y 4 ........)
x0
3
10 0 0 2(0.5878 0.9511 0.9511 0.5878) 4(0.3090 0.8090 1 0.8090 0.3090)
3
30
2.0001(nearly )
Simpson’s 3/8 th rule:
x0 nh
3h
y ( x)dx y0 y n 3( y1 y 2 y 4 ........) 2( y3 y6 y9 ........)
x0
8
3
10 0 0 3(0.3090 0.5878 0.9511 1 0.8090 0.5878) 2(0.8090 0.9511 0.3090)
8
3
80
Actual integration:
cos cos 0 ( 1) 1 1 1 2
Solution:
Range = 6 – 0 = 6
Dividing the range into 6 equal parts
b a 6 0
h 1
n 6
x 0 1 2 3 4 5 6
1 1.0(y0) 0.5(y1) 0.2(y2) 0.1(y3) 0.058824(y4) 0.038462(y5) 0.027027(y6)
f ( x)
1 x2
Trapezoidal Rule:
x0 nh
h
y ( x ) dx y 0 y n 2( y1 y 2 ........ y n 1 )
x0
2
1
1 0.027027 2(0.5 0.2 0.1 0.058824 0.038462)
2
1.41079950
Simpson’s 1/3 rd rule:
6
dx h
2
y 0 y n 4( y1 y3 ........) 2( y 2 y 4 ........)
0
1 x 3
1
1 0.027027 2(0.2 0.058824) 4(0.5 0.1 0.038462)
3
1
1.027027 0.517648 2.553848
3
1.36617433
Simpson’s 3/8 th rule:
6
dx 3h
2
y0 y n 3( y1 y 2 y 4 ........) 2( y3 y6 y9 ........)
0
1 x 8
3
1 0.027027 3(0.5 0.2 0.058824 0.038462) 2(0.1)
8
1.35708188
Actual integration:
6
dx
0 1 x 2
tan 1
(
x ) 0
6
tan 1
6 tan 1
0 tan 1
6 0 tan 1
6 1.40564765
Here the value by trapezoidal rule is closer to the actual value than the value
by simpson’s rule.
Home work: .
1
dx using Trapezoidal rule with h = 0.2.Hence obtain an
Evaluate 1 x 2 approximate value of
0
6
dx by using (i) Trapezoidal Rule (ii)Simpson’s rule,Also checkup
Evaluate
1 x the results with actual integration.
0
Gaussian Quatrature:
Two point Gaussian quatrature formula
We change the limit of the given integral
b
f ( x)dx
a
to (-1,-1) by using the transformation
a b b a
x t
2 2
b 1
(i.e) f ( x)dx f (t )dt 1 f (t1 ) 2 f (t 2 )
a 1
where1 2 1
1 1
t1 , t 2
3 3
1
1 1
(i.e) f (t )dt f ( ) f ( )
1 3 3
Three point Gaussian quatrature formula:
Here we change the limit (a,b) as (-1,1) by using the transformation
ba b a
x t
2 2
b 1
then f ( x)dx f (t )dt A1 f (t1 ) A2 f (t 2 ) A3 f (t 3 )
a 1
whereA1 A3 0.5555
A2 0.8888
t1 0.7745, t 2 0, t 3 0.7745
Example: 1
dx
Evaluate
1
1 x 2 by using Gaussian two point formula.
Solution:
Here there is no need to use the transformation because the limit of the given
integral is already (-1,1)
By directly applying Gaussian two point formula
f (t )dt
1
1 f (t1 ) 2 f (t 2 )
where1 2 1
1 1
t1 , t2
3 3
1
Heref (t )
1 t 2
1 1 1 1 1 3
f( )
3 1
2
1 3 1 4 4
1 1
3 3 3
3
1
dx 1 1
1
1 x 2
f
3
f (
3
)
3 3 6 3
4 4 4 2
Example:
2
Evaluate sin xdx
0
by using Gaussian two point formula.
Solution:
Here a = 0,b =
2
Transformation x to t as
Here
f (t ) sin (1 t )
4
1 1
f sin (1 )
3 4 3
3 1
sin sin 1.5773
4 3 4
sin 0.7854 (1.5773)
sin(1.23881142) 0.9454
1 1
f ( ) sin 1
3 4 3
3 1
sin sin 0.4227
4
3 4
sin 0.7854 0.4227
sin( 0.33198858) 0.3259
2
1 1
Therefore sin xdx f f
0
4 3 3
1 1
f f
4 3 3
0.9454 0.3259
4
0.7854 1.2713 0.99848
Example: 5
dx
Use Gaussian three point formula evaluate
1
x
Solution:
Here a=1 ,b = 5
ba b a
x t
2 2
5 1 5 1
t
2 2
6 4
t
2 2
x 3 2t
dx 2dt
5 1 1
dx 2dt dt
1
x
1
3 2t
2
1
3 2t
2 A1 f (t1 ) A2 f (t 2 ) A3 f (t 3 )
20.5555 f (0.7745) 0.8888 f (0) 0.5555 f ( 0.7745)
1
f (t )
3 2t
1 1
f (t1 ) f (0.7745) 0.21983
3 2(0.7745) 4.549
1 1
f (t 2 ) f ( 0.7745) 0.68918
3 2( 0.7745) 1.451
1 1
f (0) 0.3333
30 3
5
dx
Therefore 20.5555(0.21983) 0.8888(0.3333) 0.5555(0.68918)
1
x
20.12212 0.29626 0.38284
20.80122 1.60244.
Example:
2 2
x 2x 1
Evaluate
0
1 ( x 1) 4
dx by using Gaussian Three Point formula.
Solution:
Given a = 0 , b = 2
Transformation
ba b a
x t
2 2
20 2 0
t
2 2
2 2
t
2 2
x 1 t
dx dt
2
x 2 2x 1
1
1 t 2(1 t ) 1 dt
2
0
1 ( x 1) 4
dx
1
1 (1 t 1) 4
1
t 2 1 2t 2 2t 1
4
dt
1
1 (t 2)
A1 f (t1 ) A2 f (t 2 ) A3 f (t 3 )
0.5555 f (0.7745) 0.8888 f (0) 0.5555 f ( 0.7745)
t 2 4t 4
f (t )
1 (t 2) 4
004 4 4 4
f ( 0) 4
4
0.23529
1 ( 0 2) 1 2 1 16 17
(0.7745) 2 4(0.7745) 4 7.69785
f (0.7745) 4
0.12775
1 (0.7745 2) 60.2569
( 0.7745) 2 4( 0.7745) 4 1.50185
f ( 0.7745) 4
0.46132
1 ( 0.7745 2) 3.25555
2
x 2 2x 1
4
dx 0.5555(0.12775) 0.8888(0.23529) 0.5555(0.46132)
0
1 ( x 1)
0.07097 0.20913 0.25626
0.53636
Double integrals using Trapezoidal and Simpson’s(both 1/3rd and 3/8th rule)
Trapezoidal Rule:
the odd positions on the boundary except the corners)+4(sum of the values of f
rows of the matrix except the boundary row}+{8(sum of the values of f at odd
Solution:
1 1
x 2
y 2
4
0.1416 0.1381 0.1524 0.1679 0.1838 0.2462 0.3077 0.3902)
4 ( 0 . 3331 0. 2839 0 . 2426 0 . 2082 0 .1821 0 . 2079 0 . 2375 0 . 2710
0.2221 0.1991 0.1779 0.1587)
0.01251.025 6.6642 10.8964
0.0125 18.5856
0.23232
Example:
1.4 2.4
dxdy using Trapezoidal rule and simpson’s rule and verify your
Evaluate
1 2 xy result by actual integration.
Solution:
Divide the range of x and y into 4 equal parts
b a 2.4 2 0.4
h 0.1
n 4 4
1 .4 1 0 .4
k 0.1
4 4
1
f ( x, y )
xy
y
x 2 2.1 2.2 2.3 2.4
1 0.5 0.4762 0.4545 0.4348 0.4167
1.1 0.4545 0.4329 0.4132 0.3953 0.3788
1.2 0.4167 0.3968 0.3788 0.3623 0.3472
1.3 0.3846 0.3663 0.3497 0.3344 0.3205
1.4 0.3571 0.3401 0.3247 0.3106 0.2976
Trapezoidal rule:
I = hk/4[(Sum of the four corner values)+2(sum of the values of f at the
remaining nodes on the boundary)+4(sum of the values of f at the inner
nodes)]
0.5 0.4167 0.2976 0.3571
1.42.4
dxdy (0.1)(0.1) 2(0.4762 0.4545 0.4348 0.3788 0.3472 0.3205
1 2
xy
4 0.3106 0.3247 0.3401 0.3846 0.4167 0.4545)
4 ( 0. 4329 0 . 4132 0 . 3953 0. 3968 0 . 3788 0 . 3623 0 . 3663 0 . 3497 0 . 3344 )
0.01
1.5714 9.2864 13.7188 0.0614
4
Simpson’s rule:
I = hk/9[(sum of the values of f at the four corners)+2(sum of the
values of f at the odd positions on the boundary except the
corners)+4(sum of the values of f at the even positions on the
boundary except the corners)+{4(sum of the values of f at odd
positions)+8(sum of values of f at even positions)on the odd rows
of the matrix except the boundary row}+{8(sum of the values of f
at odd positions)+16(sum of the values of f at even positions)on
the even rows of the matrix except the boundary row}
y x 2 2.1 2.2 2.3 2.4
1
y 2 1
y
1 .4
1
log( 2.4) log 2 dy
1
y
log( 2.4) log 2 (log y )1
1.4