0% found this document useful (0 votes)
8 views43 pages

Numerical Methods Unit 3

This document covers the topic of divided differences, focusing on interpolation techniques for unequal intervals, including properties, relations to forward differences, and formulas such as Newton's and Lagrange's. It also addresses numerical differentiation methods and how to find maxima and minima using derivatives. The aim is to provide efficient methods for constructing interpolating polynomials and estimating derivatives from tabular values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views43 pages

Numerical Methods Unit 3

This document covers the topic of divided differences, focusing on interpolation techniques for unequal intervals, including properties, relations to forward differences, and formulas such as Newton's and Lagrange's. It also addresses numerical differentiation methods and how to find maxima and minima using derivatives. The aim is to provide efficient methods for constructing interpolating polynomials and estimating derivatives from tabular values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

UNIT 3

LESSON 5
DIVIDED DIFFERENCES
CONTENTS
3.0 Aims and Objectives
3.1 Divided differences
3.1.1 Introduction
3.1.2 Properties of Divided differences
3.1.3 Relations between divided differences and forward differences
3.1.4 Newton’s divided differences formula
3.1.5 Lagrange’s formula
3.1.6 Inverse interpolation.
3.2 Numerical differentiation
3.2.1 Newton’s forward formulae to compute the derivatives
3.2.2 Newton’s backward formulae to compute the derivatives
3.2.3 Derivative using Stirling’s formulae
3.2.4 To find maxima and minima of the function given the tabular values.
3.3 Let us Sum Up
3.4 Points for Discussion
3.5 Model Answers to Check Your Progress
3.6 Exercise
3.7 Suggested References
3.0 AIMS AND OBJECTIVES
The objective is to study the interpolation techniques for unequal interval of
independent variable values. More efficient methods for constructing interpolating
polynomials and getting interpolated values by divided differences will be discussed in
this chapter. Interpolation techniques such as Lagrange and inverse interpolation are
discussed here. This chapter describes how to estimate the derivative of a function by
numerical methods. The content of this chapter explains how to find maximum and
minimum values of a function by using derivatives.

111
3.1 DIVIDED DIFFERENCES
3.1.1 Introduction
There are two disadvantages in using the Lagrangian polynomial for interpolation.
First it involves more arithmetic operations then does the divided – difference method,
Second, and more importantly, if we desire to add or subtract a point from the set used to
construct the polynomial, we essentially have to start over in the computations. The
divided – difference method avoids all of this computation.
Let the function y = f (x) take the values f ( xo ), f ( x1 ), f ( x2 ),..... f ( xn ) corresponding to

the values xo , x1 , x2 ,....xn corresponding to the values xo , x1 , x2 ,....xn of the argument x where

x − xo , x − x1 ,....xn − xn −1 need not be necessarily equal.

The first divided difference of f ( x ) for the argument xo , x1 is defined as

f ( x 0 , x1 ) (or) Δ f ( xo ) (or) [ xo , x1 ]

x1
f (x1 ) − f (x o )
∴ f ( x 0 , x1 ) = … (i)
x1 − x o

f (x 2 ) − f (x1 )
Similarly f ( x 1 , x 2 ) =
x 2 − x1

f (x 3 ) − f (x 2 )
f (x 2 , x 3 ) = and so on.
x3 − x2
Thus, for defining a first divided difference, we need the functional values corresponding
to two arguments.
The Second Divided difference of f (x) for three arguments xo , x1 , x2 is defined as

f ( x o , x 1 , x 2 ) = Δ f ( xo )

x1 x2
f ( x1 , x 2 ) − f ( x o , x 1 )
= … (ii)
x2 − xo

f ( x 2 , x 3 ) − f (x 1 , x 2 )
Similarly f ( x 1 , x 2 , x 3 ) =
x 3 − x1

112
The third divided difference of f(x) for the four arguments
f ( x1 , x 2 , x 3 ) − f ( x 0 , x 1 , x 2 )
f (x o , x 1 , x 2 , x 3 ) = …. (iii)
x3 − xo
The quantities in (i), (ii) and (iii) are called divided differences of orders 1,2,3
respectively. TABLE
Second
First divided Third divided
Argument Entry divided
difference difference
x f ( x) difference
Δ f ( x) Δ3 f ( x)
Δ 2
f (x)

xo f ( xo )

f ( xo , x1 )

x1 f ( x1 ) f ( xo , x1 , x2 )

f ( x1 , x2 ) f ( xo , x1 , x2 , x3 )

x2 f ( x2 ) f ( x1 , x2 , x3 )

f ( x2 , x3 ) f ( x1 , x2 , x3 , x4 )

x3 f ( x3 ) f ( x2 , x3 , x4 )

f ( x3 , x4 )

x4 f ( x4 )

Note: In any difference column, the value of the divided difference is got by dividing the
difference between the two adjacent values immediately to the left by the difference
between the arguments opposite to the entries on the two diagonals through that divided
difference.

113
-
-----------

3.1.2 Properties of divided differences

Property 1. The value of any divided difference is independent of the order of the
arguments. That is, the divided differences are symmetrical in all their
arguments.
f (x1 ) − f (x o ) f (x o ) − f (x1 )
f (x o , x1 ) = = = f (x1 , x o ) … (1)
x1 − x o x o − x1

f (x o ) f (x 1 ) f (x o ) f (x 1 )
Again, f (x o , x 1 ) = − = + … (2)
x o − x1 x o − x1 x o − x1 x1 − x 0

f (x 1 ) f (x o )
In the same way, f ( x 1 , x o ) = + … (3)
x1 − x o x1 − x 0

From (2) and (3), we have f ( xo , x1 ) = f ( x1 , xo )


Similarly,
f (x1 , x 2 ) − f (x o , x1 )
f (x o , x1 , x 2 ) =
x2 − xo

1 ⎡⎛ f ( x 1 ) f (x 2 ) ⎞ ⎛ f (x o ) f (x 1 ) ⎞⎤
= ⎢⎜⎜ + ⎟⎟ − ⎜⎜ + ⎟⎟⎥
x2 − xo ⎢⎣⎝ x 1 − x 2 x 2 − x 1 ⎠ ⎝ x o − x 1 x 1 − x 0 ⎠⎥⎦

1 ⎡⎛ 1 1 ⎞ f (x 2 ) f (x 0 ) ⎤
= ⎢⎜⎜ + ⎟⎟f ( x 1 ) + − ⎥
x2 − xo ⎢⎣⎝ x 1 − x 2 x 1 − x o ⎠ x 2 − x1 x 0 − x1 ⎥⎦

1 ⎡ x2 − xo f (x 2 ) f (x 0 ) ⎤
= ⎢ f (x 1 ) + − ⎥
x 2 − x o ⎣ (x 1 − x 2 )(x 1 − x o ) x 2 − x1 x 0 − x1 ⎦

f (x o ) f (x 1 ) f (x 2 )
= + + … (4)
(x o − x 1 )(x o − x 2 ) (x 1 − x 0 )(x 1 − x 2 ) (x 2 − x 0 )(x 2 − x 1 )
From (4), we find
f ( x o , x 1 , x 2 ) = f ( x 1 , x 0 , x 2 ) = f ( x 1 , x 2 , x 0 ) = ...

This shows that f ( xo , x1 , x2 ) is independent of the order of the arguments.


By mathematical induction, we can prove that
f (x o )
f ( x o , x 1 , x 2 ,...x n ) =
(x o − x 1 )(x o − x 2 )...(x o − x n )
114
f (x 1 )
+
(x 1 − x 0 )(x 1 − x 2 )...(x 1 − x n )
f (x 2 )
+ + ...
(x 2 − x 0 )(x 2 − x 1 )...(x 2 − x n )
f (x n )
+
(x n − x 0 )(x n − x 1 )...(x n − x n −1 )
This is symmetrical with respect to. any two arguments. Therefore, the divided
differences are symmetrical with respect to any two arguments.

Property 2. The operator Δ is linear.

Proof. If f ( x) and g ( x) are two functions and α , β are constants, then,

Δ[αf ( x ) + βg ( x )] =
[αf ( x 1 ) + βg( x 1 )]− [αf ( x o ) + βg( x o )]
x1 − x o

f (x 1 ) − f (x o ) g( x 1 ) − g( x o )
=α +β
x1 − x o x1 − x o

= αΔf ( x ) + βΔg( x )

Corollary 1. Setting α = β =1,


Δ[ f ( x) + g ( x)]= Δf ( x) + Δg ( x) .

Corollary 2. Setting β = 0,
Δ[αf ( x)] = αΔf ( x) .

Property 3. The nth divided differences of a polynomial of degree n are constants.


Proof. Taking f ( x) = x n where n is a positive integer,
f ( x 1 ) − f ( x o ) x 1n − x on
f (x o , x 1 ) = =
x1 − x o x1 − x 0

= x 1n −1 + x o x 1n − 2 + x o2 x 1n −3 + .... + x on −1

= a polynomial function of degree (n-1) and symmetrical in


x0 , x1 with leading coefficient 1.

115
f (x 1 , x 2 ) − f (x o , x1 )
Again, f (x o , x 1 , x 2 ) =
x2 − xo

=
(x n −1
2 + x 1 x n2 − 2 + .... + x 1n −1 ) − (x 0n −1 + x 1 x on − 2 + .... + x 1n −1 )
x2 − x0

x n2 −1 − x 0n −1 x 1 ( x n2 − 2 − x on − 2 ) x n −2 (x 2 − x 0 )
= + + .... + 1
x2 − x0 x2 − x0 x2 − x0

( ) ( )
= x n2 − 2 + x o x n2 −3 + .... + x on − 2 + x 1 x n2 −3 + x o x n2 − 4 + .... + x on −3 + .... + x 1n − 2

= polynomial of degree (n-2) and symmetrical i xo , x1 , x2 with leading


coefficient 1.
Proceeding in this way, the rth divided differences of x n will be a polynomial of
degree (n-r) and symmetrical in xo , x1 , x2 ,...xr with leading coefficient 1.

Hence nth order divided differences of x n will be a polynomial of degree n-n = 0,


with leading coefficient 1. That is, its value is 1.
That is Δn x n =1
Δn +i x n = 0 , for i = 1, 2, ….

Hence, Δn (a0 x n + a1 x n −1 + .... + an )

= Δn a0 x n + a1Δn x n −1 + .... + Δn an

= a0 .1 + 0 + 0 + .... + 0 = ao

Note: Conversely, if the nth divided difference of a polynomial is constant, then the
polynomial is of degree n.

3.1.3 Relation between divided differences and forward differences


If the arguments xo , x1 , x2 ,... are equally spaced, then we have,
x1 − x0 = x2 − x1 = x3 − x2 = ..... = xn − xn −1 = h .

f ( x 1 ) − f ( x o ) Δf ( x o )
Δ f (x
x1
o ) = f (x 1 , x o ) =
x1 − x o
=
h

116
1 1
Δf ( x 1 ) − Δf ( x o )
Δf ( x ) − Δf ( x ) h
Δ2 f ( x o ) = 1 o
=h
x1 − x o 2h

1 2
= Δ f (x o )
2h 2
Similarly,
Δ3 f ( x o )
Δ3 f ( x o ) =
3!h 3
Δn f ( x o )
Δn f ( x o ) =
n!h n

3.1.4 Newton’s divided difference formula (or) Newton’s interpolation formula for
unequal intervals.
Let y = f (x ) take values f ( x o ), f ( x1 ),....., f ( x n ) corresponding to the
arguments x0 , x1 ,....., xn .
By definition,
f ( x) − f ( x 0 )
f ( x, x o ) =
x − xo

∴ f (x) = f ( x o ) + ( x − x 0 )f ( x , x o ) … (1)
f ( x, x 0 ) − f ( x 0 , x 1 )
Similarly, f ( x, x o , x 1 ) =
x − x1

∴ f ( x, x 0 ) = f ( x o , x 1 ) + ( x − x 1 )f ( x , x o , x 1 )
Using this value of f ( x, x0 ) in (1), we have
f ( x) = f ( x o ) + ( x − x o )f ( x, x o ) + ( x − x 0 )( x − x 1 )f ( x, x o , x 1 ) … (2)
f ( x, x 0 , x 1 ) − f ( x 0 , x 1 , x 2 )
Again, f ( x, x o , x 1 , x 2 ) =
x − x2

∴ f ( x, x 0 , x1 ) = f ( x o , x 1 , x 2 ) + ( x − x 2 )f ( x , x o , x 1 , x 2 )
Using this value in (2), we get
f (x) = f ( x o ) + ( x − x o )f ( x o , x 1 ) + ( x − x 0 )( x − x 1 )f ( x o , x 1 , x 2 )

117
+ ( x − x 0 )( x − x 1 )( x − x 2 )f ( x, x o , x 1 , x 2 ) …. (3)
Continuing in this manner, we get,
f (x) = f ( x o ) + ( x − x o )f ( x o , x 1 ) + ( x − x 0 )( x − x 1 )f ( x o , x 1 , x 2 )
+ ( x − x 0 )( x − x 1 )( x − x 2 )f ( x, x o , x 1 , x 2 ) + ….
+ ( x − x 0 )( x − x 1 )( x − x 2 )( x − x 2 ).......( x − x n −1 )f ( x o , x 1 , x 2 ,.....x n )
+ ( x − x 0 )( x − x 1 )( x − x 2 ).......( x − x n )f ( x, x o , x 1 ,.....x n ) ….. (4)
If f (x) is a polynomial of degree n , then
f ( x , x o , x 1 ,.....x n ) =0 [Q (n+1)th difference]
Hence equation (4) becomes,
f(x) = f(xo) + (x-xo)f(xo-x1) + (x-xo)(x-x1)f(xo,x1,x2)
+ …. + (x-xo)(x-x1)…..(x-xn-1)f(xo,x1,….xn) …. (5)
Equation (5) is called Newton’s divided difference interpolation formula for
unequal intervals.
Example 1. Using Newton’s divided difference formula, find u(3) given u(1) = - 26,
u(2) = 12, u(4) = 256, u(6) = 844.
Solution : We form the divided difference table since the intervals are unequal.

Δ3
x u ( x) Δ u ( x) Δ u ( x)
2

u ( x)
1 -26
12 + 26
= 38
2 −1
122 − 38
2 12 = 28
4 −1
256 − 12 43 − 28
= 122 =3
4−2 6 −1
294 − 122
4 256 = 43
6−2
844 − 256
= 294
6−4
6 844

By Newton’s divided difference interpolation formula

118
f (x) = f ( x o ) + ( x − x o )f ( x o , x 1 ) + ( x − x 0 )(x − x 1 )f ( x o , x 1 , x 2 ) + .....
Here
u ( x) = u ( x o ) + ( x − x o )u ( x o , x 1 ) + ( x − x 0 )(x − x 1 )u ( x o , x 1 , x 2 ) + .....
xo = 1, x1 = 2, x2 = 4, x3 =6
u ( x o ) = -26, u ( x o , x 1 ) = 38, u ( x o , x 1 , x 2 ) = 28, u ( x o , x 1 , x 2 , x 3 ) = 3

∴ u ( x) = − 26 + ( x − 1)38 + ( x − 1)( x − 2)28 + ( x − 1)( x − 2)( x − 4)3


u (3)= - 26 + (2) (38) + (2) (1) (28) + (2) (1) (-1) (3)
= - 26 + 76 + 56 – 6
= 100
Example 2. Find f ( x) as a polynomial in x for the following data by Newton’s divided
difference formula.
x: -4 -1 0 2 5
f ( x) 1245 33 5 9 1335
Solution :
f ( x)
x Δ f (x) Δ2 f ( x) Δ3 f ( x) Δ4 f ( x)
124
-4
5
33−1245
= −404
(−1) − (−4)
− 28−(−404)
-1 33 = 94
0 −(−4)
5 − 33 0 − 94
= −28 = −14
0 − (−1) 2 − (−4)
2 − (−28) 13 + 14
0 5 = 10 =3
2 − (−1) 5 − (−4)
9−5 88 − 10
=2 = 13
2−0 5 − (−1)
442 − 2
2 9 = 88
5−0
1335 − 9
= 442
5−2
133
5
5

119
By Newton’s divided difference interpolation formula
f (x) = f ( x o ) + ( x − x o )f ( x o , x1 ) + ( x − x 0 )( x − x1 )f ( x o , x1 , x 2 ) +

( x − x 0 )( x − x1 )( x − x 2 )f ( x o , x1 , x 3 ) +

( x − x 0 )( x − x1 )( x − x 2 )( x − x 3 )f ( x o , x1 , x 2 , x 3 , x 4 )

Here xo = - 4, x1 = - 1, x2 = 0, x3 = 2, x4 =5
f ( x o ) = 1245

f ( x o , x 1 ) = - 404

f ( x o , x 1 , x 2 ) = 94

f ( x o , x 1 , x 2 , x 3 ) = - 14

f (x o , x 1 , x 2 , x 3 , x 4 ) = 3

f (x) = 1245 + ( x + 4)(−404) + ( x + 4)( x + 1)(94)


+ ( x + 4)( x + 1)( x)(−14) + ( x + 4)( x + 1)( x)( x − 2)(3)
= 1245 − 404 x − 1616 + (94)[ x 2 + 5 x + 4] − 14 x[ x 2 + 5 x + 4]
+ 3x[( x 2 + 5 x + 4)( x − 2)]
= 1245 − 404 x − 1616 + 94 x 2 + 470 x + 376 − 14 x 3 − 70 x 2 − 56 x
+ 3x[( x 3 − 2 x + 5 x 2 − 10 x + 4 x − 8]
= − 14 x 3 + 24 x 2 + 10 x + 5 + 3x[ x 3 + 5 x 2 − 8 x − 8]
= − 14 x 3 + 24 x 2 + 10 x + 5 + 3 x 4 + 15 x 3 − 24 x 2 − 24 x
= 3x 4 + x 3 − 14 x + 5

Example 3. Find f (8) by Newton’s divided difference formulae for the data:
x: 4 5 7 10 11 13
f ( x) 48 100 294 900 1210 2028

120
Solution : We form the divided difference table since the intervals are unequal.

x f ( x) Δ f ( x) Δ2 f (x) Δ3 f (x) Δ4 f (x)

4 48
100 − 48
= 52
5−4
97 − 52
5 100 = 15
7−4
204 − 100 21 − 15
= 97 =1
5−7 10 − 4
202 − 97
7 294 = 21 0
10 − 5
900 − 294 27 − 21
= 202 =1
10 − 7 11 − 5
310− 202
10 900 = 27 0
11− 7
1210 − 900 33 − 27
= 310 =1
11 − 10 13 − 7
409 − 30
11 1210 = 33
13 − 10
2028−1210
= 409
13−11
13 2028
By Newton’s divided difference interpolation formula,
f (x) = f ( x o ) + ( x − x o )f ( x o , x 1 ) + ( x − x 0 )( x − x 1 )f ( x o , x 1 , x 2 )

+ ( x − x 0 )(x − x 1 )( x − x 2 )f ( x o , x 1 , x 2 , x 3 ) + …. (i)
In this problem, xo = 4, x1 = 5, x2 = 7, x3 = 0, x4 = 11, x5 = 13 and
f ( x o ) = 13, f ( x o , x 1 ) = 52, f ( x o , x 1 , x 2 ) = 15, f ( x o , x 1 , x 2 , x 3 ) = 1.

Hence using these values in (i), we have


f ( x) = 48 + ( x − 4)(52) + ( x − 4)( x − 5)(15) + ( x − 4)( x − 5)( x − 7)1

121
f ( x) = 48 + (4) 52 + (4) (3) 15 + (4) (3) (1) 1 = 448

Example 4. From the following table, obtain f ( x) a polynomial in powers of (x – 5).


x 0 2 3 4 5 6
f ( x) 4 26 58 112 466 922

Using Newton’s method.


Solution. We will from the divided difference table below:
x f ( x) Δf ( x) Δ2 f (x) Δ3 f (x)

0 4
11
2 26 7
32 1
3 58 11
54 1
4 112 16
118 1
b − 22
5 466 22 =1
1
p − 228
228 =b
−2
6 922
a − 922 d −b
=p =1
−4 5−7
d−p
5 a =d
5−9
k −d
5 q =1
5−9
5 k

122
Since the third differences are constants (=1), we extend the table by introducing x
= 5 three times and introducing unknowns from the last column.

b − 22 p − 228
= 1⇒ b = 23, = 23 ⇒ p = 182
1 −2
a − 922
=182 ⇒ a = 194
−4
d−b q−p
=1⇒ d = 21; = 21⇒ q = 98
−2 −4
k−d
=1⇒ k = 17
−4
Now take 5 as the origin and proceed.
f ( x ) = f (5) + ( x − 5)f ( x o , x1 ) + ( x − 5)( x − 5)f ( x o , x1 , x 2 )

+ ( x − 5)3 f ( x o , x1 , x 2 , x 3 )

= a + ( x − 5)q + ( x − 5) 2 k + ( x − 5) 3 x1

=194 + 98 ( x − 5) + 17 ( x − 5) 2 + ( x − 5) 3

Example 5. Find the equation y = f ( x) of least degree and passing through the
points (-1, -21), (1, 15), (2, 12), (3, 3). Find also y at x = 0.

Solution. Since the intervals are not equal, we will form divided difference table and use
Newton’s formula.
x f (x) Δf ( x ) Δ2 f ( x ) y Δ3 f ( x )

-1 -21
18
1 15 -7
-3 1
2 12 -3
-9
3 3

123
We will use Newton’s divided difference formula
y = f ( x ) = − 21 + ( x + 1)18 + ( x + 1)( x − 1)(−7) + ( x + 1)( x − 1)( x − 2)1

= x 3 − 9 x3 + 17 x + 6

Setting x = 0, f (0) = 6 .

3.1.5 Lagrange Interpolation Formula


The Lagrangian polynomial method is a very straight forward approach. the
method perhaps is the simplest way to exhibit the existence of a polynomial for
interpolation with unevenly spaced data. Data where the x-values are not equi-spaced
often occur as the result of experimental observations or when historical data are
examined.

Suppose we have a table of data with four pairs of x and f ( x) values. With xi
indexed by variable ‘i’:

i x f ( x)

0 x0 yo

1 x1 y1

2 x2 y2

3 x3 y3

Here we do not assume uniform spacing between the x-values, nor do we need the
x-values arranged in a particular order. All the x-values must be distinct, however.
Through these four data pairs we can pass a cubic. The Lagrangian form for this is
( x − x 1 )( x − x 2 )( x − x 3 )
y = f (x) = yo
( x o − x 1 )( x o − x 2 )( x o − x 3 )

( x − x o )( x − x 2 )( x − x 3 )
+ y1
( x 1 − x o )( x 1 − x 2 )( x 1 − x 3 )

( x − x o )( x − x 1 )( x − x 3 )
+ y2
( x 2 − x o )( x 2 − x 1 )( x 2 − x 3 )

124
( x − x o )( x − x 1 )( x − x 2 )
+ y3
( x 3 − x o )( x 3 − x 1 )( x 3 − x 2 )

The arithmetic in this method is tedious although hand calculators are convenient
for this type of computation. Writing a computer program that implements the method is
not hard to do. Both MATLAB and Mathematica can get interpolating polynomials of
any degree. An interpolating polynomial, although passing through the points used in its
construction does not, in general, give exactly correct values when used for interpolation.
The reason is that the underlying relationship is often not a polynomial of the same
degree. We are therefore interested in the error of interpolation.
f ( n +1) (ξ)
E( x ) = ( x − x o )( x − x 1 ).....(x − x n ) with ξ in the smallest interval
(n + 1)!

{x, x o , x 1 ,...., x n }
The expression for error is interesting but is not always extremely useful. We can
conclude, however, that if the function is “smooth”, a low-degree polynomial should
work satisfactorily. On the other hand, a “rough” function can be expressed to have larger
errors when interpolated.
Example 6. Find the third degree polynomial f ( x) satisfying the following data:
x 1 3 5 7
y 24 120 336 720
Solution: The Lagrange’s interpolation formula is
( x − x1 )( x − x 2 )( x − x 3 )
y = f (x) = yo
( x o − x1 )( x o − x 2 )( x o − x 3 )

( x − x o )( x − x 2 )( x − x 3 )
+ y1
( x1 − x o )( x1 − x 2 )( x1 − x 3 )

( x − x o )( x − x1 )( x − x 3 )
+ y2
( x 2 − x o )( x 2 − x1 )( x 2 − x 3 )

( x − x o )( x − x1 )( x − x 2 )
+ y3
( x 3 − x o )( x 3 − x1 )( x 3 − x 2 )

125
( x − 3)( x − 5)( x − 7) ( x − 1)( x − 5)( x − 7)
= (24) + (120)
(1 − 3)(1 − 5)(1 − 7) (3 − 1)(3 − 5)(3 − 7)
( x − 1)( x − 3)( x − 7) ( x − 1)( x − 3)( x − 5)
+ (336) + (720)
(5 − 1)(5 − 3)(5 − 7) (7 − 1)(7 − 3)(7 − 5)
1 15
= − ( x − 3)( x − 5)( x − 7) + ( x − 1)( x − 5)( x − 7)
2 2
− 21( x − 1)( x − 3)( x − 7) + 15 ( x − 1)( x − 3)( x − 5)

=−
2
[
1 3
x − 15 x 2 + 71x − 105 +
15 3
2
] [
x − 13x 2 + 47 x − 35 ]
[ ] [
− 21 x 3 − 11x 2 + 31x − 21 + 15 x 3 − 9 x 2 + 23 x − 15 ]
⎡ 1 15 ⎤ ⎡105 525 ⎤
= ⎢− + − 21 + 15⎥ x 3 + ⎢ − + 441 − 225⎥ x 2
⎣ 2 2 ⎦ ⎣ 2 2 ⎦
⎡ 71 705 ⎤ ⎡105 525 ⎤
+ ⎢− + − 605 + 345⎥ x + ⎢ − + 441 − 225⎥
⎣ 2 2 ⎦ ⎣ 2 2 ⎦
= x 3 + 6 x 2 + 11x + 6

f (4) = 43 + 6(4 2 ) + 11(4) + 6

= 64 + 96 + 44 + 6
= 210
Example 7. Using Lagrange interpolations find y (2) from the following data.

x : 0 1 3 4 5
y: 0 1 81 256 625

Solution :
( x − x1 )( x − x 2 )( x − x 3 )( x − x 4 )
y = f (x) = yo
( x o − x1 )( x o − x 2 )( x o − x 3 )( x o − x 4 )

( x − x o )( x − x 2 )( x − x 3 )( x − x 4 )
+ y1
( x1 − x o )( x1 − x 2 )( x1 − x 3 )( x1 − x 4 )
( x − x o )( x − x1 )( x − x 3 )( x − x 4 )
+ y2
( x 2 − x o )( x 2 − x1 )( x 2 − x 3 )( x 2 − x 4 )

( x − x o )( x − x 2 )( x − x 3 )( x − x 4 )
+ y3
( x 3 − x o )( x 3 − x1 )( x 3 − x 2 )( x 3 − x 4 )

126
( x − x o )( x − x1 )( x − x 2 )( x − x 3 )
+ y4
( x 4 − x o )( x 4 − x1 )( x 4 − x 2 )( x 4 − x 3 )

(2 − 1)(2 − 3)(2 − 4)(2 − 5)


y (2) = (0)
(0 − 1)(0 − 3)(0 − 4)(0 − 5)
(2 − 0)(2 − 3)(2 − 4)(2 − 5)
+ (1)
(1 − 0)(1 − 3)(1 − 4)(1 − 5)
(2 − 0)(2 − 1)(2 − 4)(2 − 5)
+ (81)
(3 − 0)(3 − 1)(3 − 4)(3 − 5)
(2 − 0)(2 − 1)(2 − 3)(2 − 5)
+ (256)
(4 − 0)(4 − 1)(4 − 3)(4 − 5)
(2 − 0)(2 − 1)(2 − 3)(2 − 4)
+ (625)
(5 − 0)(5 − 1)(5 − 3)(5 − 5)
(2)(−1)(−2)(−3)
=
(1)(−2)(−3)(−4)
(2)(1)(−2)(−3)
+ (81)
(3)(2)(−1)(−2)
(2)(1)(−1)(−3)
+ (256)
(4)(3)(1)(−1)
(2)(1)(−1)(−2)
+ (625)
(5)(4)(2)(1)
12 12 6 4
= + (81) − (256) + (625)
24 12 12 40
1
= + 81 − 128 + 62.5
2
= 0.5 + 81 – 128 + 62.5 = 16
Example 8. Using Lagrange’s interpolation formula find f (4) given that
f (0) = 2, f (1) = 3, f (2) =12, f (15) = 3587.

Solution: Given
xo x1 x2 x3
x : 0 1 2 15
y: 2 3 12 3587

127
By Lagrange’s formula
( x − x1 )( x − x 2 )( x − x 3 )
y = f (x) = yo
( x o − x1 )( x o − x 2 )( x o − x 3 )

( x − x o )( x − x 2 )( x − x 3 )
+ y1
( x1 − x o )( x1 − x 2 )( x1 − x 3 )

( x − x o )( x − x1 )( x − x 3 )
+ y2
( x 2 − x o )( x 2 − x1 )( x 2 − x 3 )

( x − x o )( x − x1 )( x − x 2 )
+ y3
( x 3 − x o )( x 3 − x1 )( x 3 − x 2 )

(4 − 1)(4 − 2)(4 − 15)


y = f (4) = (2)
(0 − 1)(0 − 2)(0 − 15)
(4 − 0)(4 − 2)(4 − 15)
+ (3)
(1 − 0)(1 − 2)(1 − 15)
(4 − 0)(4 − 1)(4 − 15)
+ (12)
(2 − 0)(2 − 1)(2 − 15)
(4 − 0)(4 − 1)(4 − 2)
+ (3587)
(15 − 0)(15 − 1)(15 − 2)
(3)(2)(−11) (4)(2)(−11)
= (2) + (3)
(−1)(−2)(−15) (1)(−1)(−14)
(4)(3)(−11) (4)(3)(2)
+ (12) + (3587)
(2)(1)(−13) (15)(14)(13)
132 264 1584 86088
= − + +
30 14 26 2730
= 78.
Example 9. Using Lagrange’s interpolation formula find y (10) given that
y (5) =12, y (6) =13, y (9) =14, y (11) =16.

Solution: By Lagrange’s interpolation formula, we have


( x − x 1 )( x − x 2 )( x − x 3 )
y = f (x) = yo
( x o − x 1 )( x o − x 2 )( x o − x 3 )

( x − x o )( x − x 2 )( x − x 3 )
+ y1
( x 1 − x o )( x 1 − x 2 )( x 1 − x 3 )

128
( x − x o )( x − x 1 )( x − x 3 )
+ y2
( x 2 − x o )( x 2 − x 1 )( x 2 − x 3 )

( x − x o )( x − x 1 )( x − x 2 )
+ y3
( x 3 − x o )( x 3 − x 1 )( x 3 − x 2 )

( x − 6)( x − 9)( x − 11) ( x − 5)( x − 9)( x − 11)


= (12) + (13)
(5 − 6)(5 − 9)(5 − 11) (6 − 5)(6 − 9)(6 − 11)
( x − 5)( x − 6)( x − 11) ( x − 5)( x − 6)( x − 9)
+ (14) + (16)
(9 − 5)(9 − 6)(9 − 11) (11 − 5)(11 − 6)(11 − 9)

Putting x =10
(4)(1)(−1) (5)(1)(−1)
y(10) = f (10) = (12) + (13)
(−1)(−4)(−6) (1)(−3)(−5)
(5)(4)(−1) (5)(4)(1)
+ (14) + (16)
(4)(3)(−2) (6)(5)(2)

y = 14.666666
Example 10. The mode of a certain frequency curve y = f ( x) is very nearer to x = 9 and
the values of the frequency density f ( x) for x = 8.9, 9, 9.3 are respectively 0.30, 0.35 and
0.25. Calculate the approximate value of the mode.
Solution: We are given that
x 8.9 9.0 9.3
f ( x) 0.30 0.35 0.25
By Lagrange’s interpolation formula,
( x − 9)( x − 9.3) ( x − 8.9)( x − 9.3)
f (x) = × 0.30 + × 0.35
(8.9 − 9)(8.9 − 9.3) (9 − 8.9)(9 − 9.3)

( x − 8.9)( x − 9)
+ × 0.25
(9.3 − 8.9)(9.3 − 9)

1
= (−25 x 2 + 453.5 x − 2052.3)
2
To get the mode, f ' ( x) = 0 and f ' ' ( x) = -ve
1
∴ f ' ( x) = 0 ⇒ (50 x + 453.5) = 0
2

129
i.e., x = 9.07
1
f ' (9.07) = (−50) = -ve
2
Hence f ( x) is maximum at x = 9.07

Therefore, mode is 9.07.


Example 11. Using Lagrange’s formula, prove
y1 = y3 − 0.3( y5 − y − 3 ) + 0.2( y − 3 + y − 5 ) nearly.

Solution: y − 5 , y − 3 , y3 , y5 occur in the answers. So, we can have the table.

x -5 -3 3 5
f (x) y −5 y −3 y3 y5

∴ By Lagrange’s formula

( x + 3)( x − 3)( x − 5) ( x + 5)( x − 3)( x − 5)


y( x ) = . y−5 + . y−3
(−5 + 3)(−5 − 3)(−5 − 5) (−3 + 5)(−3 − 3)(−3 − 5)

( x + 5)( x + 3)( x − 5) ( x + 5)( x + 3)( x − 3)


+ . y3 + . y5
(3 + 5)(3 + 3)(3 − 5) (5 + 5)(5 + 3)(5 − 3)
(4)(−2)(−4) (6)(−2)(−4)
y(1) = . y−5 + . y−3
(−2)(−8)(−10) (2)(−6)(−8)

(6)(4)(−4) (6)(4)(−2)
+ . y3 + . y5
(8)(6)(−2) (10)(8)(2)

= −0.2. y−5 + 0.5. y−3 + y3 − 0.3. y5

y1 = y3 − 0.3( y5 − y − 3 ) + 0.2( y − 3 + y − 5 )

Example 12. Find the Lagrangian interpolating polynomial for the following data:

x 1 2 3 5
f (x) 0 7 26 124

130
Solution: By Lagrange’s interpolation formula
( x − x 1 )( x − x 2 )( x − x 3 )
y = f (x) = yo
( x o − x 1 )( x o − x 2 )( x o − x 3 )

( x − x o )( x − x 2 )( x − x 3 )
+ y1
( x 1 − x o )( x 1 − x 2 )( x 1 − x 3 )

( x − x o )( x − x 1 )( x − x 3 )
+ y2
( x 2 − x o )( x 2 − x 1 )( x 2 − x 3 )

( x − x o )( x − x 1 )( x − x 2 )
+ y3
( x 3 − x o )( x 3 − x 1 )( x 3 − x 2 )

Let x o =1, y o = 0

x1 = 2, y1 = 7

x 2 = 3, y 2 = 26

x 3 = 5, y3 =124

( x − 2)( x − 3)( x − 5) ( x − 1)( x − 3)( x − 5)


∴y = f ( x ) = (0) + (7)
(1 − 2)(1 − 3)(1 − 5) (2 − 1)(2 − 3)(2 − 5)
( x − 1)( x − 2)( x − 5) ( x − 1)( x − 2)( x − 3)
+ (26) + (124)
(3 − 1)(3 − 2)(3 − 5) (5 − 1)(5 − 2)(5 − 3)
( x − 1)( x − 3)( x − 5) ( x − 1)( x − 2)( x − 5)
= (0) + (7 ) + (26)
(1)(−1)(−3) (2)(1)(−2)
( x − 1)( x − 2)( x − 3)
+ (124)
(2)(3)(2)
( x − 1)( x − 3)( x − 5) ( x − 1)( x − 2)( x − 5)
= (7) + (26)
3 −5
( x − 1)( x − 2)( x − 3)
+ (31)
6
1 13
= [( x − 1)( x − 3)( x − 5)] − [( x − 1)( x − 2)( x − 5)]
3 2
31
+ ( x − 1)( x − 2)( x − 3)
6
1 13
= [( x − 1)( x 2 − 8 x + 15)] − [( x − 1)( x 2 − 7 x + 10)]
3 2
131
31
+ [( x − 1)( x 2 − 5 x + 6)]
6
⎡1 8 13 91 31 155 ⎤
= ( x − 1) ⎢ x 2 − x + 15 − x 2 + x − 65 + x 2 − x + 31⎥
⎣3 3 2 2 6 6 ⎦

[
= ( x − 1) x 2 + 17 x − 29 ]
= − x 3 + 17 x 2 − 29 x + x 2 − 17 x + 29
= − x 3 + 16 x 2 − 46 x + 29

3.1.6 Inverse Interpolation


The process of finding a value of x for the corresponding value of y is called
inverse interpolation.
In such a case, we will take y as independent variable and x as dependent variable
and use Lagrange’s interpolation formula.
Taking y as independent variable.
( y − y1 )( y − y 2 )...( y − y n )
x = xo
( y o − y1 )( y o − y 2 )...( y o − y n )
( y − y o )( y − y 2 )...( y − y n )
+ x1
( y1 − y o )( y1 − y 2 )...( y1 − y n )
( y − y o )( y − y1 )...( y − y n −1 )
+ .... + xn …. (1)
( y n − y o )( y n − y1 )...( y n − y n −1 )
The formula (1) is called formula of inverse interpolation.

Example 13. Find the age corresponding to the annuity value 13.6 given the table:

Age (x) : 30 35 40 45 50
Annuity Value 15.9 14.9 14.1 13.3 12.5
(y):
Solution :
(13.6 − 14.9)(13.6 − 14.1)(13.6 − 13.3)(13.6 − 12.5)
x= x30
(15.9 − 14.9)(15.9 − 14.1)(15.9 − 13.3)(15.9 − 12.5)
(13.6 − 15.9)(13.6 − 14.1)(13.6 − 13.3)(13.6 − 12.5)
+ x35
(14.9 − 15.9)(14.9 − 14.1)(14.9 − 13.3)(14.9 − 12.5)

132
(13.6 − 15.9)(13.6 − 14.9)(13.6 − 13.3)(13.6 − 12.5)
+ x40
(14.1 − 15.9)(14.1 − 14.9)(14.1 − 13.3)(14.1 − 12.5)
(13.6 − 15.9)(13.6 − 14.9)(13.6 − 14.1)(13.6 − 12.5)
+ x45
(13.3 − 15.9)(13.3 − 14.9)(13.3 − 14.1)(13.3 − 12.5)
(13.6 − 15.9)(13.6 − 14.9)(13.6 − 14.1)(13.6 − 13.3)
+ x50
(12.5 − 15.9)(12.5 − 14.9)(12.5 − 14.1)(12.5 − 13.3)
x ( y = 13 .6 ) = 43
θ

Example 14. Find the value of θ given f (θ ) = 0.3887 where f (θ ) = ∫ using
1 2
o
1 − sin θ
2
the table.
θ 21o 23o 25 o
f (θ ) 0.3706 0.4068 0.4433
Solution : Now take f (θ ) as independent and θ as dependent
y = f (θ) 0.3706 0.4068 0.4433
θ 21 23 25

( y − 0.4068)( y − 0.4433)
θ= x 21
(0.3706 − 0.4068)(0.3706 − 0.4433)

( y − 0.3706)( y − 0.4433)
+ x 23
(0.4068 − 0.3706)(0.4068 − 0.4433)
( y − 0.3706)( y − 0.4068)
+ x 25
(0.4433 − 0.3706)(0.4433 − 0.4068)

(0.3887 − 0.4068)(0.3887 − 0.4433)


θ ( y = 0.3887) = x 21
(0.3706 − 0.4068)(0.3706 − 0.4433)

(0.3887 − 0.3706)(0.3887 − 0.4433)


+ x 23
(0.4068 − 0.3706)(0.4068 − 0.4433)
(0.3887 − 0.3706)(0.3887 − 0.4068)
+ x 25
(0.4433 − 0.3706)(0.4433 − 0.4068)

= 7.885832 + 17.202739 – 3.086525


= 22.0020
133
LESSON 6
NUMERICAL DIFFERENTIATION

CONTENTS

3.2.1 Introduction
3.2.2 Newton’s forward formulae to compute the derivatives
3.3.3 Newton’s backward difference formula to compute the derivative
3.3.4 Derivative using Stirling’s formula
3.3.5 To find maxima and minima of the function given the tabular values
3.3.6 Check Your Progress
3.3.7 Let Us Sum Up
3.3.8 Points For Discussion
3.3.9 Model Answers To Check Your Progress
3.3.10 Exercise
3.3.11 Suggested References

3.2.1 Introduction

Now we are trying to find the derivative value of such curves at a given x = xk
(say), whose xo < xk < xn (or even outside the range but closer to starting or end values).
To get the derivative, we first find the curve y = f (x) through the points and then
differentiate and get its value at the required point.

First the values of x are equally spaced, we get the interpolating polynomial due
to Newton – Gregory. If the derivative is required at a point nearer to the starting value in
the table, we use Newton’s forward interpolation formula. If we require the derivative at
the end of the table, we use Newton’s backward interpolation formula. If the value of
derivative is required near the middle of the table value we use one of the central
difference interpolation formulae. In the case of unequal intervals, we can use Newton’s
divided difference formula or Lagrange’s interpolation formula to get the derivative
value.

134
3.2.2 Newton’s forward formulae to compute the derivatives

We are given (n + 1) ordered pairs ( x i , y i ), i = 0,1, 2, .....n. We want to find the


derivative of y = f (x) passing through the (n + 1) points, at a point nearer to the starting
value x = x o .

Newton’s forward difference interpolation formula is


u (u − 1) 2 u (u − 1)(u − 2) 3
y( x o + uh ) = y u = y o + uΔy o + Δ yo + Δ y o + ... …(1)
2! 3!
x − xo
where y (x) is a polynomial of degree n in x and u = .
h
Differentiating y (x) w.r.t. x,
dy dy du 1 dy
= . =
dx du dx h du

dy 1 ⎡ 2u − 1 2 3u 2 − 6u + 2 3
= ⎢Δy o + Δ yo + Δ yo
dx h ⎣ 2 3

(4u 3 − 18u 2 + 22u − 6) 4


+ Δ y o + ...] … (2)
24
dy
Equation (2) gives the value of at general x which may be anywhere in the
dx
interval.
In special case like x = xo , i.e., u = 0, (2) reduces to

⎛ dy ⎞ ⎛ dy ⎞ 1⎡ 1 1 1 ⎤
⎜ ⎟ = ⎜ ⎟ = ⎢Δyo − Δ2 yo + Δ3 yo − Δ4 yo + ...⎥ …(3)
⎝ dx ⎠ x = xo ⎝ dx ⎠u =0 h ⎣ 2 3 4 ⎦

Differentiating (2) again w.r.t. x,


d2y d ⎛ dy ⎞ du d ⎛ dy ⎞ 1
= ⎜ ⎟. = ⎜ ⎟.
dx 2
du ⎝ dx ⎠ dx du ⎝ dx ⎠ h

d2y 1 ⎡ 2 (6u 2 − 18u + 11) 4 ⎤


2
= 2 ⎢Δ y o + (u − 1)Δ y o +
3
Δ y o + ...⎥ …(4)
dx h ⎣ 12 ⎦

135
d3y 1 ⎡ 3 (12u − 18) 4 ⎤
Hence, 3 = 3 ⎢⎣Δ y o + Δ y o + ...⎥ … (5)
dx h 12 ⎦
Equation (4) and (5) give the second the third derivative value at x = x.
Setting x = xo i.e., u = 0 in (4) and (5)

⎛ d2y ⎞ 1 ⎡ 2 11 4 ⎤
⎜⎜ 2 ⎟⎟ = 2 ⎢⎣Δ y o − Δ y o + 12 Δ y o + ...⎥⎦
3
…(6)
⎝ dx ⎠ x = x o h

⎛ d3y ⎞ 1 ⎡ 3 3 4 ⎤
⎜⎜ 3 ⎟⎟ = 3 ⎢⎣Δ y o − 2 Δ y o + ...⎥⎦ …7)
⎝ dx ⎠ x = x o h

Equation (6) and (7) give the values of second and third derivative at the starting
value x = xo .

Note: We know E = 1 + Δ = e hD .
1 1⎡ 1 1 ⎤
∴D = log(1 + Δ) = ⎢Δ − Δ2 + Δ3 + ...⎥
h h⎣ 2 3 ⎦
1 ⎡ 2 11 4 ⎤
D2 = ⎢⎣Δ − Δ + 12 Δ + ...⎥⎦
3

h2

1 ⎡ 3 3 4 ⎤
D3 = ⎢⎣Δ − 2 Δ + ...⎥⎦
h3

⎛ dy ⎞ 1⎡ 1 1 ⎤
⎜ ⎟ = Dy o = ⎢Δy o − Δ2 y o + Δ3 y o + ...⎥
⎝ dx ⎠ x = x o h⎣ 2 3 ⎦

⎛ d2y ⎞ 1 ⎡ 2 11 4 ⎤
⎜⎜ 2 ⎟⎟ = D2 yo = 2 ⎢⎣Δ y o − Δ y o + 12 Δ y o + ...⎥⎦ etc.,
3

⎝ dx ⎠ x = x o h

136
3.2.3 Newton’s backward difference formula to compute the derivative
Now, consider Newton’s backward difference interpolation formula,
v( v + 1) 2 v( v + 1)( v + 2) 3
y( x ) = y( x n + vh) = y n + v∇y n + ∇ yn + ∇ y n + ... … (8)
2! 3!
x − xn
where v =
h
Differentiate (8) w.r.t. x,

dy dy dv dy 1
= = .
dx dv dx dv h

⎛ dy ⎞ 1 2v + 1 2 3v 2 + 6 v + 2 3
⎜ ⎟ = [∇y n + ∇ yn + Δ yn +
⎝ dx ⎠ h 2 6

4v 3 + 18v 2 + 22 v + 6 4
+ Δ y n + ....] … (9)
24

d2y 1 ⎡ 2 6 v 2 + 18v + 11 4 ⎤
∴ 2
= 2 ⎢∇ y n + ( v + 1)∇ 3
y n + ∇ y n + ...⎥ … (10)
dx h ⎣ 12 ⎦

d3y 1 ⎡ 3 12 v + 18 4 ⎤
∴ 3
= 3 ⎢⎣∇ y n + 12 ∇ y n + ...⎥⎦ … (11)
dx h

Equations (9), (10), (11) give the first, second, and third derivative at any general x.

Setting x = xn or v = 0 in (9), (10), (11), we get

⎛ dy ⎞
= [∇yn + ∇ 2 yn + Δ3 yn + Δ4 yn + ...]
1 1 1 1
⎜ ⎟ … (12)
⎝ dx ⎠ x = xn h 2 3 4

⎛ d2y ⎞ 1 ⎡ 2 11 4 ⎤
⎜⎜ 2 ⎟⎟ = 2 ⎢⎣∇ y n + ∇ y n + 12 ∇ y n + ...⎥⎦
3
… (13)
⎝ dx ⎠ x = x n h

⎛ d3y ⎞ 1 ⎡ 3 3 4 ⎤
⎜⎜ 3 ⎟⎟ = 3 ⎢⎣∇ y n + ∇ y n + ...⎥ … (14)
⎝ dx ⎠ x = x n h 2 ⎦

137
1 −1
Note: Using E = e hD = , we get D = log(1 − ∇)
1− ∇ h
1⎡ 1 1 1 ⎤
∴D = ⎢∇ + ∇ 2 + ∇ 3 + ∇ 4 + ...⎥ … (15)
h⎣ 2 3 4 ⎦
1 ⎡ 2 11 4 ⎤
D2 = ⎢⎣∇ + ∇ + 12 ∇ + ...⎥⎦
3

h2

1 ⎡ 3 3 4 ⎤
D3 = ⎢⎣∇ + 2 ∇ + ...⎥⎦
h3
We can get the above results (12), (13) and (14).

Example 15. Find the first two derivatives of (x )1/ 3 at x = 50 and x =56 given the table
below:
x 50 51 52 53 54 55 56
y = x1 / 3 3.6840 3.7084 3.7325 3.7563 3.7798 3.8030 3.8259
Solution : Since we require f ' ( x) at x = 50 we use Newton’s forward formula and
to get f ' ( x) at x = 56 we use Newton’s backward formula.
Difference Table
x y Δy Δ2 y Δ3 y
50 3.6840
0.0244
51 3.7084 0.0003
0.0241 0
52 3.7325 0.0003
0.0238 0
53 3.7563 0.0003
0.0235 0
54 3.7798 0.0003
0.0232 0
55 3.8030 0.0003
0.0229
56 3.8259

138
By Newton’s forward formula,
⎛ dy ⎞ ⎛ dy ⎞
⎜ ⎟ =⎜ ⎟
⎝ dx ⎠ x = x o ⎝ dx ⎠ u = o

1 ⎡ 1 2 1 3 ⎤
=
h ⎢⎣Δyo − 2 Δ yo + 3 Δ yo + ...⎥⎦

1⎡ 1 1 ⎤
= ⎢ 0.0244 − (−0.0003) + (0)⎥
1⎣ 2 3 ⎦

= 0.02455
⎛ d2y ⎞ 1
⎜⎜ 2 ⎟⎟ = [ Δ2 yo - Δ3 yo + ... ]
⎝ dx ⎠ x = 50 h2

= 1 [- 0.0003] = - 0.0003
By Newton’s backward difference formula,
⎛ dy ⎞ ⎛ dy ⎞ 1 ⎡ 1 2 1 3 ⎤
⎜ ⎟ = ⎜ ⎟ = ⎢∇ y n + ∇ y n + ∇ yn + ...⎥
⎝ dx ⎠ x = xn ⎝ dx ⎠ v =0 h ⎣ 2 3 ⎦

from equation (12)


⎛ dy ⎞ 1 ⎡ 1 ⎤
⎜ ⎟
⎝ dx ⎠ x =56
=
1 ⎢⎣0.0244 + 2 (−0.0003) + 0⎥⎦

= 0.02275
⎛ d2y ⎞
⎜⎜ 2 ⎟⎟ =
1
2
[ ]
∇ 2 yn + ∇ 3 yn + ... from equation (13)
⎝ dx ⎠ x =56 h

1
= [ - 0.0003] = - 0.0003
1
Example 16. The population of certain town is given below. Find the rate of growth of
the population in 1931, 1941, 1961 and 1971.

Year x 1931 1941 1951 1961 1971


(Population in
40.62 60.80 79.95 103.56 132.5
thousands) y

139
Solution : We form the difference table.
x y Δy Δ2 y Δ3 y Δ4 y

1931 40.62
20.18
1941 60.80 1.03
19.15 5.49
1951 79.95 4.46 4.47
23.61 1.02
1961 103.56 5.48
29.09
1971 132.65
We use the same table for backward and forward differences.

(i) To get f ' (1931) and f ' (1941) we use forward formula.
xo = 1931, x1 = 1941, ….
x − xo
u = ; ∴ xo = 1931 corresponds u = 0
h
⎛ dy ⎞ ⎛ dy ⎞ 1⎡ 1 2 1 3 1 4 ⎤
⎜ ⎟ =⎜ ⎟ = ⎢Δy o − Δ yo + Δ y o − Δ y o + .....⎥
⎝ dx ⎠ x =1931 ⎝ dx ⎠ u = 0 h⎣ 2 3 4 ⎦
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 … (1)

x − xo 1941 − 1931
(ii) If x1 = 1941, u = = =1
h 10
Putting u = 1, in

140
dy 1⎡ 2u − 1 2 3u 2 − 6u + 2 3 4u 3 − 18u 2 + 22u − 6 4 ⎤
= Δ
⎢ oy + Δ y o + Δ y o + Δ y o + .....⎥
dx h⎣ 2 6 24 ⎦
We get,
⎛ dy ⎞ 1 ⎡ 1 1 1 ⎤
⎜ ⎟ = ⎢ 20.18 + (−1.03) − (5.49) + (−4.47)⎥
⎝ dx ⎠ u =1 10 ⎣ 2 6 12 ⎦
1
= [20.18 – 0.515 – 0.915 – 0.3725]
10
= 1.83775 … (2)

Note: f we neglect the data against 1931 and take 1941 as xo , we have

Δyo = 19.15, Δ2 yo = 4.46, Δ3 yo = 1.02.

Now using,
⎛ dy ⎞ 1⎡ 1 1 ⎤
⎜ ⎟ = ⎢Δyo + Δ2 y o + Δ3 y o + .....⎥
⎝ dx ⎠ x =1941 h ⎣ 2 3 ⎦
1 ⎡ 1 1 ⎤
= ⎢19.15 − (4.46) + (1.02)⎥
10 ⎣ 2 3 ⎦
= 1.7260. … (3)

Evidently the values given by (2) and (3) are not same. In getting the answer
given by (2), we have assumed a polynomial of degree 4 whereas in getting the answer
given by (3), we have assumed the interpolating polynomial of degree 3 only. In fact,
both polynomials assumed are different. Hence we see the difference in answer.
(iii) To get f ' (1971) , we use the formula,
⎛ dy ⎞ 1⎡ 1 1 1 ⎤
⎜ ⎟ = ⎢∇yn + ∇ 2 yn + ∇ 3 yn + ∇ 3 yn + .....⎥
⎝ dx ⎠ x = x n h⎣ 2 3 4 ⎦

1 ⎡ 1 1 1 ⎤
= ⎢ 29.09 + (5.48) + (1.02) + (−4.47)⎥
10 ⎣ 2 3 4 ⎦
⎛ dy ⎞ 1
⎜ ⎟ = [31.0525] = 3.10525
⎝ dx ⎠ x =1971 10

141
x − xn 1961− 1971
(iv) To get f ' (1961) , we use v = = = -1
h 10

⎛ dy ⎞ ⎛ dy ⎞ 1⎡ 2v + 1 2 3v 2 + 6v + 2 3 ⎤
⎜ ⎟ =⎜ ⎟ = ⎢∇yn + ∇ yn + ∇ yn + .....⎥
⎝ dx ⎠ x =1961 ⎝ dx ⎠ v = −1 h⎣ 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.
3.2.4. Derivative using Stirling’s formula

Consider Stirling’s formula


u u2
y ( x) = ( xo + uh) = y o + [Δy o + Δy −1 ] + Δ2 y −1
2 2
u3 − u 3 u4 − u2 4
+ (Δ y −1 + Δ3 y − 2 ) + Δ y − 2 + .... (1)
12 24
x − x0
where u =
h
Differentiating (1) with respect to x

dy dy du 1 dy
= . =
dx du dx h du

1 ⎡1 2u 2 − 1 3
= ⎢ ( Δy o + Δy −1 ) + u Δ2
y −1 + (Δ y −1 + Δ3 y − 2 )
h ⎣2 12

1 5u 4 − 15u 2 + 4 5 ⎤
+ ( 2u − u ) Δ y − 2 +
3 4
(Δ y − 2 + Δ5 y − 3 ) + ....⎥ …. (2)
2 40 ⎦
Similarly
d2y 1 ⎡ 2 u 3 (6u 2 − 1) 4 ⎤
= 2 ⎢Δ y −1 + (Δ y −1 + Δ y − 2 ) +
3
Δ y − 2 + ...⎥ …. (3)
dx 2 h ⎣ 2 12 ⎦

d3y 1 ⎡1 3 ⎤
= 3 ⎢
(Δ y −1 + Δ3 y − 2 ) + uΔ4 y − 2 + ...⎥ … (4)
dx 3 h ⎣2 ⎦

142
Setting x = x0 i.e., u = 0 in (2), (3), (4) we get

⎛ dy ⎞ 1 ⎡1 1
⎜ ⎟ = ⎢ (Δy o + Δy −1 ) − (Δ3 y −1 + Δ3 y − 2 )
⎝ dx ⎠ x = x o h ⎣2 12

1 5 ⎤
+ (Δ y− 2 + Δ5 y−3 ) + ....⎥ … (5)
60 ⎦

⎛ d2y ⎞ 1 ⎡ 2 1 4 ⎤
⎜⎜ 2 ⎟⎟ = 2 ⎢Δ y −1 − 12 Δ y − 2 + .....⎥ … (6)
⎝ dx ⎠ x = x o h ⎣ ⎦

⎛ d3 y ⎞ 1 ⎡1 ⎤
⎜⎜ 3 ⎟⎟ = 3 ⎢ (Δ3 y −1 + Δ3 y − 2 ) + ...⎥ … (7)
⎝ dx ⎠ x = x o h ⎣2 ⎦

We can also use other central difference formula such as Bessel’s formula or
Everett’s formula.

Caution
In interpolation, the polynomial function we find, is only an approximate function
to the original function. In other words, f ( x) − pn ( x) is small. But f ' ( x) − p'n ( x) may not
be small even if f ( x) − pn ( x) is small. That is, the error involved in obtaining f ' ( x)
through pn ' ( x) may be great. So, it can be used with confidence only if the differences of
some order are constants.
Example 17. Find the first and second derivative of the function tabulated below at x = 0.6.
x: 0.4 0.5 0.6 0.7 0.8
y: 1.5836 1.7974 2.0442 2.3275 2.6511
Solution : Since x = 0.6 is in the middle of the table, we will use Striling’s formula.

143
Difference Table
x y Δy Δ2 y Δ3 y Δ4 y
0.4 1.5836
0.2138
0.0330
0.5 1.7974 0.0035
0.2468 0.0365 Δ3 y− 2 0.0003
0.6 2.0442 Δy−1 Δ y−1
2
Δ4 y− 2
yo 0.2833 0.0038
0.7 2.3275 Δyo 0.0403 Δ3 y−1
0.3236 Δ2 yo
0.8 2.6511
By Stirling’s formula,
⎛ dy ⎞ 1 ⎡1 1 ⎤
⎜ ⎟ = ⎢ (Δyo + Δy−1 ) − (Δ3 y−1 + Δ3 y− 2 ) + .....⎥
⎝ dx ⎠ x = x 0 h ⎣2 12 ⎦

1 ⎡1 1 ⎤
= ⎢ (0.2833 + 0.2468) − (0.0038 + 0.0035)⎥
0.1 ⎣ 2 12 ⎦
⎛ dy ⎞
⎜ ⎟ = 10 [ 0.26505 – 0.0006083]
⎝ dx ⎠ x = 0.6
= 2.64442
⎛ d2y ⎞ 1 ⎡ 2 1 4 ⎤
⎜⎜ 2 ⎟⎟ = ⎢⎣Δ y−1 − 12 Δ y− 2 + .....⎥⎦ from (21).
⎝ dx ⎠ x = x o h2

⎛ d2y ⎞ 1 ⎡ 1 ⎤
⎜⎜ 2 ⎟⎟ = ⎢ 0.0365 − (0.0003)⎥
⎝ dx ⎠ x = 0.6 (.01) ⎣ 12 ⎦

= 3.6475
Example 18. Find the value of f ' (0.5) using Stirling’s formula from the following data:

x 0.35 0.40 0.45 0.50 0.55 0.60 0.65


y = f (x) 1.521 1.506 1.488 1.467 1.444 1.418 1.389

144
Solution :
x y Δy Δ2 y Δ3 y Δ4 y Δ5 y

0.35 1.521
-0.015
-0.003
0.40 1.506 0
-0.018
-0.003 0.001
0.45 1.488 0.001 -0.003
-0.021 Δ2 y − 2

Δ3 y− 2 -0.002 Δ5 y −3

0.50 1.467 Δy−1 -0.002


yo -0.023 -0.001 0.003
Δ2 y −1 -0.001

0.55 1.444 yo Δ3 y −1 Δ5 y − 2

Δ4 y −1

-0.026 -0.003
0.60 1.418 0
-0.003
-0.029
0.65 1.389

Since x = 0.5 is in the middle of the table, we use Stirling’s formula taking 0.50 as
the origin.
∴ x o = 0.5, y o = 1.467

By Stirling’s formula, from equation (5), we have

145
1 ⎡1 1
⎢ (Δy o + Δy −1 ) − (Δ3 y −1 + Δ3 y − 2 )
⎛ dy ⎞ h ⎣2 12
⎜ ⎟ =
⎝ dx ⎠ x = x0 1 5 ⎤
+ (Δ y − 2 + Δ5 y −3 ) + ...⎥
60 ⎦
1 ⎡1 1
⎢ (−0.023 − 0.021) − (−0.001 + 0.001)
0.05 ⎣ 2 12
=
1 ⎤
+ (0.003 − 0.003)⎥
12 ⎦
1 ⎡ 1 ⎤
= ⎢ − x 0.044⎥
0.05 ⎣ 2 ⎦
= - 0.44
3.3.5 To find maxima and minima of the function given the tabular values
Given the ordered pairs ( xi , yi ) , I = 0, 1, 2, ….. n, we can get the interpolating
polynomial of degree n . Now, we want to find the value of x at which the curve is
maximum or minimum.
Now, using Newton’s forward interpolation formula and getting its derivative, and
equating it to zero, we get an equation from which the extremum value of y can be got.
From equation (2), we get
dy 1 ⎡ 2u − 1 2 3u 2 − 6u + 2 3 ⎤
= ⎢Δy o + Δ yo + Δ y o + ...⎥
dx h ⎣ 2 6 ⎦
dy
= 0 implies,
dx
2u − 1 2 3u 2 − 6u + 2 3
Δy o + Δ yo + Δ y o + ... = 0 … (A)
2 6
If higher differences are small, we can take only the first three terms of (A) and
solving it for u (since it is a quadratic in u ), we get u .

Using x = x0 + uh , we can get the values x at which y is an extremum.

146
Example 19. Find the value of x for which y is minimum and find the minimum value
from the table.
x: 0.60 0.65 0.70 0.75
y: 0.6221 0.6155 0.6138 0.6170
Solution : We form the difference table first.
x y Δy Δ2 y Δ3 y

0.60 0.6221
- 0.0066
0.65 0.6155 0.0049
- 0.0017 0
0.70 0.6138 0.0032
0.0032
0.75 0.6170
Taking 0.60 as the origin,
u (u − 1) 2
y( x ) = y( x o + uh ) = y o + uΔy o + Δ y o + ....
2
u2 − u
= 0.6221 + u (- 0.0066) + x (0.0049)
2
x − 0.60
where u =
0.05
dy 1 ⎡ 2u − 1 ⎤
=0 ⇒ ⎢ 0.0066 + (0.0049)⎥ = 0
dx h ⎣ 2 ⎦
i.e., ( 2u − 1 ) (0.0049) = 0.0132
u = 1.8469

Corresponding x = xo + uh = 0.60 + (0.05) (1.8469) = 0.6923


y is minimum when x = 0.6923.
(This is evidently a minimum as we look at the table.)
Minimum y = 0.6221 – 0.0066 x 1.8469 + 0.00245 [1.8469] [0.8469]
= 0.6137426

147
Example 20. Given the following data, find y ' (6) and the maximum value of y.
x: 0 2 3 4 7 9
y: 4 26 58 112 466 922
Solution: Since the arguments are not equally spaced, we will use Newton’s divided
difference formula (or even Lagrange’s formula).
Difference Table
x y = f (x) Δf (x) Δ2 f ( x) Δ3 f ( x) Δ4 f ( x)
0 4
11
2 26 7
32 1
3 58 11 0
54 1
4 112 16 0
118 1
7 466 22
228
9 922

By Newton’s divided difference formula,


y = f (x) = f ( x o ) + ( x − x o )f ( x o , x1 ) + ( x − x o )( x − x1 )f ( x o , x1 , x 2 ) + ...
= 4 + (x – 0) 11 + (x – 0) (x – 2) 7 + (x – 0) (x – 2) (x – 3) 1
= x 3 + 2 x 2 + 3x + 4
Therefore, y ' ( x) = 3x 3 + 4 x + 3

y ' (6) = 3 (6)2 + 4 (6) + 3 = 135.

y(x) is maximum if y ' ( x) = 0 ∴ 3x 3 + 4 x + 3 = 0. But the roots are imaginary.


Therefore, there is no extremum value in the range. In fact, it is an increasing curve.
3.3.6 CHECK YOUR PROGRESS
1. Define first divided difference of f(x).
2. Divided difference operator is -----------------
1
3. The second divided differences with arguments a, b, c if f(x) = -------------
x

148
4. State the Newton’s divided difference interpolation formula for unequal roots.
5. State inverse interpolation.
6. Can you use Lagrange interpolation for equal intervals?
7. If the derivative of the required at a point nearer to the starting value of the table, then
which formula to be used?
8. How to compute third derivative at the starting value x = x0 from the difference
formula?
3.3.7 LET US SUM UP
(i) Construct interpolating polynomial for any set of data by using the Lagrangian
formulation or by using dived differences. Now students can explain why the
divided-difference technique is preferred.
(ii) Explain the numerical differentiation is a unstable process.
(iii) Derive formulas by symbolic method and form a Taylor series.
(iv) Develop formulas for differentiation from an interpolating polynomial
(v) Use extrapolation techniques to get improved estimates of derivatives.
(vi) To find maximum and minimum value of the given function
3.3.8 POINTS FOR DISCUSSION
1. Show that the function f ( x ) constructed fro the following table of values is
f(x) = x (x – 1)(x – 4) (x2 +2x- 5)
x 0 1 2 4 5 7
f (x) 0 0 -12 0 600 7308
[Hint: First assume a degree of polynomial of degree 5, since number of values are
given is 6, then find the polynomial using Newton’s divided difference formula]
2. Verify that the polynomial constructed from the following data by Lagrange’s
interpolation formula is 2x3 – 6x2 + 3x + 3
x -1 0 2 3
f (x) -8 3 1 12
Hence find the value of y at x=1

149
[Hint: By using Lagrange’s interpolation formula fit a polynomial of degree 3 then
substitute value of x is 1]
3. Show that the value of x when y = 13.5 from the following data by Lagrange’s
inverse interpolation formula is 97.65575
93.0 96.2 100 104.2 108.7
x
f (x)
11.38 12.8 14.7 17.07 19.91
4. Show that the extreme value of y is 2 when x = 4.42 from the table of values:
x 2 3 4 5 6
f ( x ) 31.1875 12.0275 2.8655 3.7052 14.5440
5. A rod is rotating in a plane. The following table gives the angle θ (in radians) through
which the rod has turned for various values of time t(seconds). Verify that the angular
velocity and angular acceleration of the at t = 0.6 seconds are 3.81665 radians/sec
and 6.75.
x 0 0.2 0.4 0.6 0.8 1.0
f (x) 0 0.12 0.49 1.12 2.02 3.20

3.3.9 MODEL ANSWERS TO CHECK YOUR PROGRESS


1. The first divided difference of f ( x) for the argument xo , x1 is defined as
f (x1 ) − f (x o )
f ( x 0 , x1 ) =
x1 − x o

2. Linear
1
3.
abc
4. f(x) = f(xo)(x-xo)f(xo-x1)+(x-xo)(x-x1)f(xo,x1,x2)
+ …. + (x-xo)(x-x1)…..(x-xn-1)f(xo,x1,….xn)
5. The process of finding a value of x for the corresponding value of y is called inverse
interpolation.
6. No
7. Newton’s forward difference formula
⎛ d3y ⎞ 1 ⎡ 3 3 4 ⎤
8. ⎜⎜ 3 ⎟⎟ = 3 ⎢⎣Δ y o − 2 Δ y o + ...⎥⎦
⎝ dx ⎠ x = x o h

150
3.3.10 EXERCISE
1. Find f (0) given
x -1 -2 2 4
f (x) -1 -9 11 69
2. Find f ( x ) given the table.
x 0 1 4 5
f (x) 4 3 24 39
3. Find f ( x ) , also find f (2) .
x 0 1 3 4
y -12 0 6 12
4. Find y (1.50)
x 1.0 1.2 1.4 1.6 1.8 2.0
y 0.2420 0.1942 0.1497 0.1109 0.0790 0.0540
5. Find f (2)
x 0 1 3 4
y 5 6 50 105
Using Newton’s divided differences formula, solve the following problems.
6. Find f (2) , f (8) and f (15)
x 4 5 7 10 11 13
f ( x) 48 100 294 900 1210 2028
7. Find f ( x ) .
x 0 1 2 4 5 7
f (x) 0 0 -12 0 600 7308
8. Find a cubic polynomial of x given:
x: 0 1 2 5
f ( x) 2 3 12 147

151
9. Find the polynomial equation of degree four passing through the points.
(8, 1515), (7, 778), (5, 138), (4, 43) and (2, 3).

10. If y(0) = -18, y(1) = 0, y(5) = -248, y (6) = 0 and y(9) = 13104, find y = f ( x ) .

11. Find the first and second derivative of the function tabulated below at x = 3.
x 3.0 3.2 3.4 3.6 3.8 4.0
f ( x) -14 -10.032 -5.296 -0.256 6.672 14

12. Find the first three derivatives of the function at x = 1.5 from the table below.
x 1.5 2.0 2.5 3.0 3.5 4.0
f ( x) 3.375 7.0 13.625 24.0 38.875 59.0

13. From the table below find y’ and y’’ at x = 1.05.


x 1.00 1.05 1.10 1.15 1.20 1.25 1.30
y 1.00000 1.02470 1.04881 1.07238 1.09544 1.11803 1.14017

14. Find the first and second derivative of x at x = 15 from the table below.
x 15 17 19 21 23 25
x 3.873 4.123 4.359 4.583 4.796 5.000

Answers
1. f (0) = 1
2. f ( x ) = 2x 2 − 3x + 4
3. f ( x ) = x 3 − 7 x 2 + 18x − 12, f (2) = 4
4. . y (1.50) = 0.1295
5. f (2) =19
6. f (2) = 4, f (8) = 448, f (15) = 3150]

7. f ( x ) = x ( x − 1)( x − 4)( x 2 + 2x − 5)
8. f ( x ) = x 3 + x 2 − x − 2
9. y = x 4 − 10x 3 + 36 x 2 − 36 x − 5

152
10. f ( x ) = ( x − 1)( x − 3)( x − 6)( x 2 + x + 1)
11. f ′(3) = 18, f ′′(3) = 18
12. f ′(1.5) = 4.75, f ′′(1.5) = 9, f ′′′(1.5) =6
13. y’(1.05) = 0.4879, y’’(1.05) = -0.235.
14. The first and second derivative of x at x = 15 are 0.44733, -0.004

3.3.11 SUGGESTED REFERENCES


1. Venkataraman M.K., Numerical Methods in Science and Engineering, National
Publishing Company V edition 1999.
2. Sankara Rao K, Numerical Methods for Scientists and Engineers , 2nd Edition,
Prentice Hall India, 2004.
3. Singaravelu A., Numerical Methods, Meenakshi Publications, 2001.
4. Balagurusamy E., Numerical methods, Tata Mc-Graw Hill, 2003
5. Rajaraman V., Computer oriented numerical methods, 3rd edition, Prentice Hall India,
2007

153

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy