You are on page 1of 21

VARDHAMAN COLLEGE OF ENGINEERING, HYDERABAD

An Autonomous Institute Affiliated to JNTUH

A6002 – NUMERICAL METHODS AND CALCULUS


Handout # 4
Numerical Differentiation and Integration
Introduction:
Numerical Differentiation:
Numerical differentiation is the process of evaluating a derivative of an unknown function
y f ( x) at some assigned values of x from the given set of values ( xi , yi ) i 0,1, 2,3.... n

Where the values of xi are equispaced.

dy d 2 y
Suppose it is required to evaluate ,
dx dx2
at some point.

If the point is near the beginning of the table, use Newton’s forward Interpolation formula. (NFIF)
If the point is near the end of the table, use Newton’s backward Interpolation formula. (NBIF)
1.Derivative using Newton’s Forward Interpolation Formula (NFIF):
Let the function y f ( x) take the values y0 , y1 , y2 ,.... yn corresponding to the equally spaced values

x0 , x0 h, x0 2h,...., x0 nh of x.

To evaluate f ( x) for x x0 ph, where p is any real number,


p ( p 1) 2 p ( p 1)( p 2) 3 p ( p 1)( p 2)( p 3) 4
y ( x) y0 p y0 2! y0 3! y0 4! y0
p ( p 1)( p 2)...( p ( n 1)) n x x0
+.........+ n! y0 ,where p h
........(1)

Differentiating (1) w.r.t p ,We get


dy 2p 1 3 p2 6p 2 4 p3 18 p 2 22 p 6
dp
y0 2
2
y0 6
3
y0 24
4
y0 ...

dp 1
Differentiating (1) w.r.t x. ,We obtain
dx h
dy dy dp 1 dy
Now
dx dp dx h dp

dy 1 2p 3 p2 6 p 2 4 p3 18 p2 22 p 6
... .......... 2
1 2 3 4
y0 y0 y0 y0
dx h 2 6 24

dy
equation (2) gives the value of dx at any point of x which may be anywhere in the interval

Again differentiating (2) w.r.t x. ,We get


d2y d dy d dy . dp d dy . 1
dx2 dx dx dp dx dx dp dx h

Dept. of Freshman Engineering Page 1 of 6


d2y 1 6 p2 18 p 11
dx2 h2
2
y0 p 1 3
y0 12
4
y0 ... .......... 3

Special case:
At x x0 , p 0 . We, get

dy dy 1 1 1 1
dx x x dx p 0 h
y0 2
2
y0 3
3
y0 4
4
y0 ...
0

d2 y 1 11 5
dx2 x x h2
2
y0 3
y0 12
4
y0 6
5
y0 ...
0

2.Newton’s Backward Interpolation Formula (NBIF):


Let the function y f ( x) take the values y0 , y1 , y2 ,.... yn corresponding to the equally spaced values

x0 , x0 h, x0 2h,...., x0 nh of x.

To evaluate f ( x) for x xn ph, where p is any real number,


p ( p 1) 2 p ( p 1)( p 2) 3 p ( p 1)( p 2)( p 3) 4
y ( x) yn p yn 2! yn 3! yn 4! yn
p ( p 1)( p 2)...( p ( n 1)) n x xn
+.........+ n! yn , where p h
Differentiating (1) w.r.t p ,We have
dy 2p 1 3 p2 6 p 2 4 p3 18 p2 22 p 6
dp
yn 2
2
yn 6
3
yn 24
4
yn ...

dp 1
Differentiating (1) w.r.t x. ,We obtain
dx h
dy dy dp 1 dy
Now
dx dp dx h dp

dy 1 2p 1 3 p2 6 p 2 4 p3 18 p2 22 p 6
dx h
yn 2
2
yn 6
3
yn 24
4
yn ... ........ 2

dy
equation (2) gives the value of dx at any point of x which may be anywhere in the interval

Again differentiating (2) w.r.t x. ,We get


d2y d dy d dy . dp d dy . 1
dx2 dx dx dp dx dx dp dx h

d2y 1 6 p2 18 p 11
dx2 h2
2
yn p 1 3
yn 12
4
yn ... .......... 3

Special case:
At x x0 , p 0 . We, get

dy dy 1 1 1 1
dx x x dx p 0 h
yn 2
2
yn 3
3
yn 4
4
yn ...
0

Dept. of Freshman Engineering Page 2 of 6


d2 y 1 11 5
dx2 x x h2
2
yn 3
yn 12
4
yn 6
5
yn ...
0

Example.4.1.1. Find the first and second derivatives of f x at x 1.5 for the given data

x 1.5 2.0 2.5 3.0 3.5 4.0


y 3.375 7 13.625 24 38.875 59
Solution. The difference table is given below:
x y y 2
y 3
y 4
y 5
y

1.5 x0 3.625 y0
3.625 y0
2
2.0 7 3 y0
3
6.625 0.75 y0
4
2.5 13.625 3.75 0 y0
5
10.375 0.75 0 y0
3.0 24 4.5 0
14.875 0.75
3.5 38.875 5.25
20.125
4 59

x x0
Here x 1.5, x0 1.5, and h 0.5 so that p 0
h
Using Newton’s Forward Interpolation Formula
p( p 1) 2 p( p 1)( p 2) 3
y ( x) y0 p y0 2! y0 3! y0 ......
Differentiating w.r.t x. ,We get
dy 1 2p 1 3 p2 6 p 2
dx h
y0 2
2
y0 6
3
y0 ... ..... 1

At x x0 , p 0 . We, get

dy 1 1 1 1
dx x x h
y0 2
2
y0 3
3
y0 4
4
y0 ...
0

dy 1 1 3 1 0.75 1 0
dx x 1.5 0.5 3.625 2 3 4
4.75

i.e y 1.5 4.75

Again differentiating 1 w.r.t x. ,We get

d2y 1 2 3 6 p2 18 p 11 4
y0 p 1 y0 12 y0 ...
dx2 h2

Dept. of Freshman Engineering Page 3 of 6


At x x0 , p 0 . We, get

d2y 1 11 5
h2
2
y0 3
y0 4
y0 5
y0 ...
dx2 x x 12 6
0

d2y 1 11 5
3 0.75 0 0 9
dx2 x 1.5 0.5
2 12 6

i.e y 1.5 9

dy d2y
Hence 4.75 and dx2 9
dx x 1.5 x 1.5

dy d 2 y
Example.4.1.2. From the following table,find the values of , at x 2.03
dx dx2
1.96x 1.98 2.00 2.02 2.04
y 0.7825 0.7739 0.7651 0.7563 0.7473
Solution. The difference table is given below:
x y y 2
y 3
y 4
y

1.96 0.7825
-0.0086
1.98 0.7739 -0.0002
-0.0088 0.0002
4
2.00 0.7651 0 0.0004 y0
3
-0.0088 0.0002 yn
2
2.02 0.7563 0.0002 yn
0.0090 yn
2.04 0.7473 yn
x x0 2.03 2.04
Here x 2.03, xn 2.04, and h 0.02 so that p 0.5
h 0.02
Using Newton’s Backward Interpolation Formula
p ( p 1) p ( p 1)( p 2) p ( p 1)( p 2)( p 3)
y ( x) yn p yn 2!
2
yn 3!
3
yn 4!
4
yn .. 1
Differentiating (1) w.r.t x. ,We get
dy 1 2p 1 3 p2 6 p 2 4 p3 18 p2 22 p 6
dx h
yn 2
2
yn 6
3
yn 24
4
yn ...

3 2
dy 1 2 0.5 1 3 0.5
2
6 0.5 2 4 0.5 18 0.5 22 0.5 6
dx 0.02 0.0090 2 0.0002 6 0.0002 24 0.0004

dy
0.4488
dx x 2.3

Again differentiating 1 w.r.t x. ,We get

Dept. of Freshman Engineering Page 4 of 6


d2y 1 6 p2 18 p 11
h2
2
yn p 1 3
yn 12
4
yn ...
dx2

d2y 1 6 0.5
2
18 0.5 11
0.0002 0.5 1 0.0002 12 0.0004
dx2 0.02
2

d2y
1.0417
dx2 x 2.3

dy d2y
Hence 0.4488 and dx2 1.0417
dx x 2.3 x 2.3

Exercise 3
1. The following data gives the velocity of a particle for 20 seconds at an interval of 5 seconds. Find the
initial acceleration of the entire data.[ Hint a= dv
dt t 0
]

Time t (sec) 0 5 10 15 20

Velocity v(m / sec) 0 3 14 69 228

2. The population of a certain town is given below the values


Year 1931 1941 1951 1961 1971
Population 40.62 60.80 71.95 103.56 132.65
(in Lakhs)
Estimate the rate of growth of the population in the year 1961
3. Find the first and second derivatives of the function tabulated below at the point x 1.1
x 1.0 1.2 1.4 1.6 1.8 2.0
y 0 0.128 0.544 1.296 2.432 4.000
4. From the following table, find the values of y 0 , y 0

x 0 1 2 3 4 5
y 4 5 15 7 6 2
5. The distance covered by an athlete for 50 meters is given by the following table
Time (sec) 0 1 2 3 4 5 6

Velocity (meter ) 0 2.5 8.5 15.5 24.5 36.5 50

Determine the speed of the athlete at t=5 sec. correct to two decimals
6. The following data reveals the velocity of a body during the specified time t.
Find the acceleration at t=1.1
Time (t) 1.0 1.1 1.2 1.3 1.4
Velocity (v) 43.1 47.7 52.1 56.4 60.8

Dept. of Freshman Engineering Page 5 of 6


0
7. Find the value of sec 31 from the following table

in degrees 310 320 330 340


tan 0.6008 0.6249 0.6494 0.6745

Answers

1. a= dv
dt t 0 =1m/s
2
2. dy
dx
3.86Lakhs
x 1961
d2y
3. dy 0.615 and dx2 1.0417
dx x 1.1 x 2.3

4. y 0 27.9 and y 0 117.67 5. 13.13 m/sec


6. 44.92 m/sec 7 . 0.6009

Dept. of Freshman Engineering Page 6 of 6

You might also like