Chapter-2: Finite Differences and Interpolation
Chapter-2: Finite Differences and Interpolation
Drgsk@KLUniversity Page 1
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
x1 y1 ∆2y0
∆y1 ∆3y0
x2 y2 ∆2y1 ∆4y0
∆y2 ∆3y1 ∆5y0
x3 y3 ∆2y2 ∆4y1
∆y3 ∆3y2
x4 y4 ∆2y3
∆y4
x5 y5
Backward Differences: The backward differences are defined and denoted by f(x)= f(x)-f(x-h),
y1 = y1 – y0
y2 = y2 – y1
y3 = y3 – y2
…………….
yr = yr – yr-1
…………….
yn = yn – yn-1.
These are called the first backward differences and is the backward difference operator.
Similarly the second backward differences are defined by
2
yr = yr – yr-1.
In general
p p-1 p-1
yr= yr – yr-1 ,
pth backward differences. The backward differences systematically set out in a table called
backward difference table.
Value of Value of y 1st diff. 2nd diff. 3rd diff. 4th diff. 5thdiff.
x 2 3 4 5
x0 y0
y1
Drgsk@KLUniversity Page 2
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
x1 y1 2
y2
3
y2 y3
x2 y2 2
y3 4
y4
3 5
y3 y4 y5
x3 y3 2
y4 4
y5
3
y4 y5
x4 y4 2
y5
y5
x5 y5
Central differences: The central differences are defined and denoted by δf(x)=f(x+h/2)-f(x-h/2),
δy1/2 = y1 – y0
δy3/2 = y2 – y1
δy5/2 = y3 – y2
…………….
δyr+1/2 = yr+1 – yr
…………….
δyn-1/2 = yn – yn-1
These are called the first central differences and δ is the central difference operator.
Similarly the second central differences are defined by
δ2 yr = δyr+1/2 – δyr-1/2.
In general
δp yr = δp-1yr+1/2 – δp-1yr-1/2 , (if p is even)
δp yr+1/2 = δp-1yr+1 – δp-1yr , (if p is odd)
th
p central differences.
Note : It is observe that, the differences are not change only notation is changed.
y1-y0 = ∆y0= y1= δy1/2 .
Example#1. Evaluate
(i) ∆ tan-1x
(ii) ∆ (ex log 2x)
(iii) ∆2 cos 2x
Drgsk@KLUniversity Page 3
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
Drgsk@KLUniversity Page 4
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
Similarly
∆2f(x) = ∆[∆f(x)]
= a0 n h [(x+h)n-1 – xn] + a11 [(x+h)n-2 – xn-2 ]+ a21 [(x+h)n-3 – xn-3 ]+ … + an-2, 1 [x+h-x]
= a0 n(n – 1) h2 xn-2 + a12xn-3 + a22xn-4 + … + an-2,1 h,
where a12, a12, … are new constant coefficients. Thus, the second difference of a polynomial of
nth degree is a polynomial of degree n-2.
Continuing this process, for the nth difference, we get a polynomial of degree zero i.e.
∆nf(x) = a0 n(n – 1) (n – 2) … 3.2.1. hn = a0 n! hn
which is a constant.
From the above discussion, we have the following results:
The differences of a polynomial of the nth degree are constant and all higher order
differences are zero.
If the nth differences of a function tabulated at equally spaced intervals are constant, then
the function is a polynomial of degree n (It is important in numerical analysis as it
enables as to approximate a function by a polynomial).
Example#3. Evaluate ∆10 [(1-ax)(1-bx2)(1-cx3)(1-dx4)].
Sol. Taking interval of difference h = 1.
∆10 [(1-ax)(1-bx2)(1-cx3)(1-dx4)] = ∆10 [abcd x10 + k1 x9 + k2 x8 + … + 1]
= abcd ∆10 (x10) + k1 ∆10 (x9)+ k2 ∆10 (x8) + … + ∆10(1),
where k1, k2, … are constant coefficients. Since ∆10 (xn) = 0 for n < 10, we have
∆10 [(1-ax)(1-bx2)(1-cx3)(1-dx4)] = abcd ∆10 (x10) = abcd 10!.
Factorial Notation: A product of the form x(x – 1) (x – 2) …(x – r +1) is denoted by [x]r and is
called a factorial. In particular,
[x] = x, [x]2 = x(x – 1) , [x]3 = x(x – 1) (x – 2), …[x]n = x(x – 1) (x – 2) …(x – n +1).
If the interval of difference is h, then
[x]n = x(x – h) (x – 2h) …(x – (n – 1)h).
The factorial notation is of special utility in the theory of finite differences. It helps in finding the
successive differences of a polynomial directly by simple rule of differentiation ([x]r as xr).
To express a polynomial of nth degree in the factorial notation, we use the following two steps
Drgsk@KLUniversity Page 5
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
1 2 -3 3 -10 = D
_ 2 -1
2 2 -1 2=C
_ 4
3 2 3=B
_
2=A
Drgsk@KLUniversity Page 6
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
Drgsk@KLUniversity Page 7
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
Example#1. The table gives the distances in nautical miles of the visible horizon for the given heights in
feet above the earth’s surface :
x y ∆ ∆2 ∆3 ∆4
100 10.63
2.4
150 13.03 -0.39
2.01 0.15
x0=200 15.04 -0.24 -0.07
1.77 0.08
250 16.81 -0.16 -0.05
1.61 0.03
300 18.42 -0.13 -0.01
1.48 0.02
350 19.90 -0.11
1.37
xn=400 21.27
(i) If we take x0=200, then y0=15.04, ∆y0=1.77, ∆2y0=-0.16, ∆3y0=0.03, ∆4y0=-0.01.
Drgsk@KLUniversity Page 8
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
+ 0.36(0.36-1)(0.36-2)(0.36-3)/24 (-0.01)
+ 0.2(0.2+1)(0.2+2)(0.2+3)/24 (-0.01)
Drgsk@KLUniversity Page 9
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
x0+h y1 ∆2y0(=δ2y1)
∆y1(=δy3/2)
x0+2h y2
Gauss’s forward interpolation formula: The Newton’s forward interpolation formula is
y(x) = y0 + p ∆y0 + p(p-1)/2! ∆2 y0+ p(p-1)(p-2)/3! ∆3 y0+…
We have ∆2y0 - ∆2y-1 = ∆3 y-1
∆2 y0 = ∆2 y-1 + ∆3 y-1
Similarly ∆3 y0 = ∆3 y-1 + ∆4 y-1
∆4 y0 = ∆4 y-1 + ∆5 y-1
Also ∆3y-1 - ∆3y-2 = ∆4 y-2
∆3 y-1 = ∆3 y-2 + ∆4 y-2
Similarly ∆4 y-1 = ∆4 y-2 + ∆5 y-2
∆5 y-1 = ∆5 y-2 + ∆6 y-2
Substituting the above in Newton’s forward interpolation formula, we get
yp = y0 + p ∆y0 + p(p-1)/2! ∆2 y-1+ (p+1)p(p-1)/3! ∆3 y-1+ (p+1)p(p-1)(p-2)/4! ∆4 y-2+ …,
which is called Gauss forward interpolation formula.
In the central difference notation
y(x) = y0 + p δy1/2 + p(p-1)/2! δ2 y0+ (p+1)p(p-1)/3! δ3 y1/2+ (p+1)p(p-1)(p-2)/4! δ4 y0+ …
It employs odd differences just below the central line and even differences on the central line.
This formula is used to interpolate the values of y for p (0<p<1) measured forwardly from the
origin.
Value Value of y1st diff. 2nd diff. 3rd diff. 4th diff.
of x
x0-2h y-2
∆y-2(=δy-3/2)
x0-h y-1 ∆2y-2(=δ2y-1)
∆y-1(=δy-1/2) ∆3y-2(=δ3y-1/2)
x0 y0 ∆2y-1(=δ2y0) ∆4y-2(=δ4y0)
∆y0(=δy1/2) ∆3y-1(=δ3y1/2)
x0+h y1 ∆2y0(=δ2y1)
∆y1(=δy3/2)
x0+2h y2
Example#1. Use Gauss’s forward formula to evaluate y30, given that y21=18.4708, y25=17.8144,
y29=17.1070, y33=16.3432, and y37=15.5154.
Drgsk@KLUniversity Page 10
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
Sol. Taking x0 = 29. The interval of difference h=4. We require to find value of y for x=30.
Therefore, p=(x-x0)/h =(30-29)/4 = 0.25. The difference table is given below
+ (1.25)(0.25)(-0.75)(-1.75)/24 (-0.0022)
y30 = 16.9216.
∆3 y0 = ∆3 y-1 + ∆4 y-1.
It employs odd differences just above the central line and even differences on the central line.
This formula is used to interpolate the values of y for p (-1<p<0).
Value Value of y 1st diff. 2nd diff. 3rd diff. 4th diff.
of x
x0-2h y-2
∆y-2(=δy-3/2)
x0-h y-1 ∆2y-2(=δ2y-1)
∆y-1(=δy-1/2) ∆3y-2(=δ3y-1/2)
x0 y0 ∆2y-1(=δ2y0) ∆4y-2(=δ4y0)
∆y0(=δy1/2) ∆3y-1(=δ3y1/2)
x0+h y1 ∆2y0(=δ2y1)
∆y1(=δy3/2)
x0+2h y2
Example#2. Interpolate by means of Gauss’s backward formula, the population of a town for the
year 1974, given that
Drgsk@KLUniversity Page 12
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
1939 12
3
1949 15 2
5 0
1959 20 2 3
7 3 -10
x0=1969 27 5 -7
12 -4
1979 39 1
13
1989 52
Gauss’s backward formula is
+ (2.5)(1.5)(0.5)(-0.5)(-1.5)/120 (-10)
= 32.345 thousands.
yp = y0 + p (∆y0 + ∆y-1)/2+ p2/2! ∆2 y-1+ p(p2-1)/3! (∆3 y-1+ ∆3y-2)/2 + p2(p2-1)/4! ∆4 y-2
This formula involves means of the odd differences just above and below the central line
and even differences on this line.
Drgsk@KLUniversity Page 13
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
Value Value of y 1st diff. 2nd diff. 3rd diff. 4th diff.
of x
x0-2h y-2
∆y-2(=δy-3/2)
x0-h y-1 ∆2y-2(=δ2y-1)
∆y-1(=δy-1/2) ∆3y-2(=δ3y-1/2)
x0 y0 ∆2y-1(=δ2y0) ∆4y-2(=δ4y0)
∆y0(=δy1/2) ∆3y-1(=δ3y1/2)
x0+h y1 ∆2y0(=δ2y1)
∆y1(=δy3/2)
x0+2h y2
Example#1. Employ Stirling’s formula to compute y12.2 from the following table
(yx=1+log10sinx):
xo 10 11 12 13 14
105 yx 23,967 28,060 31,788 35,209 38,368
Sol. Taking x0=12, h=1, since x=12.2, we have
p=(x-x0)/h = (12.2-12)/1 = 0.2.
The difference table is
x yx ∆y ∆2y ∆3y ∆4y
10 0.23967
0.04093
11 0.28060 -0.00365
0.03728 0.00058
x0=12 0.31788 -0.00307 -0.00013
0.03421 0.00045
13 0.35209 -0.00262
0.03159
14 0.38368
By Stirling’s formula
y12.2 = y0 + p (∆y0 + ∆y-1)/2+ p2/2! ∆2 y-1+ p(p2-1)/3! (∆3 y-1+ ∆3y-2)/2 + p2(p2-1)/4! ∆4 y-2
= 0.31788+0.2(0.03728+0.03421)/2 + (0.2)2/2 (-0.00307)+0.2[(0.2)2-1]/6
Drgsk@KLUniversity Page 14
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
Value Value of y 1st diff. 2nd diff. 3rd diff. 4th diff.
of x
x0-2h y-2
∆y-2(=δy-3/2)
x0-h y-1 ∆2y-2(=δ2y-1)
∆y-1(=δy-1/2) ∆3y-2(=δ3y-1/2)
x0 y0 ∆2y-1(=δ2y0) ∆4y-2(=δ4y0)
∆y0(=δy1/2) ∆3y-1(=δ3y1/2)
x0+h y1 ∆2y0(=δ2y1)
Drgsk@KLUniversity Page 15
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
∆y1(=δy3/2)
x0+2h y2
Example#1. Apply Bessel’s formula to obtain y25, given that y20=2854, y24=3162, y28=3544 and
y32=3992.
Lagrange’s interpolation formula: If y = f(x) takes the values y0, y1, y2, …, yn corresponding to
x0, x1, x2, …, xn, then
(x x 1 )(x x 2 ) (x x n ) (x x 0 )(x x 2 ) (x x n )
f(x) y0 y1
(x 0 x 1 )(x 0 x 2 ) (x 0 x n ) (x 1 x 0 )(x1 x 2 ) (x 1 x n )
(x x 0 )(x x 1 ) (x x n 1 )
yn ,
(x n x 0 )(x n x 1 ) (x n x n 1 )
Drgsk@KLUniversity Page 16
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
Divided Differences: If (x0, y0), (x1, y1), …, (xn, yn) are given points, then the first divided
differences for the argument x0, x1 is defined by
y y0
[x 0 , x 1 ] 1 .
x1 x 0
Similarly
y y1 y y2 y y n 1
[x 1 , x 2 ] 2 , [x 2 , x 3 ] 3 , , [x n 1 , x n ] n .
x 2 x1 x3 x2 x n x n 1
The second divided differences for x0, x1, x2 is
[x , x ] [x 0 , x 1 ]
[x 0 , x 1 , x 2 ] 1 2 .
x2 x0
The third divided differences for x0, x1, x2 , x3 is
[x , x , x ] [x 0 , x 1 , x 2 ]
[x 0 , x 1 , x 2 , x 3 ] 1 2 3 .
x3 x0
And so on, the nth divided differences for x0, x1, x2, …, xn is
[x , x , , x n ] [x 0 , x 1 , , x n -1 ]
[x 0 , x 1 , x 2 , , x n ] 1 2 .
xn x0
All the divided differences systematically set out in a table called divided difference table.
Value Value of 1st divided 2nd divided 3rd divided 4th divided 5th divided
of x y difference difference difference difference difference
x0 y0
[x0,x1]
x1 y1 [x0,x1,x2]
[x1,x2] [x0,x1,x2,x3]
x2 y2 [x1,x2,x3] [x0,x1,x2,x3,x4]
[x2,x3] [x1,x2,x3,x4] [x0,x1,x2,x3,x4,x5]
x3 y3 [x2,x3,x4] [x1,x2,x3,x4,x5]
[x3,x4] [x2,x3,x4,x5]
x4 y4 [x3,x4,x5]
[x4,x5]
x5 y5
Newton’s divided difference formula: If y = f(x) takes the values y0, y1, y2, …, yn
corresponding to x0, x1, x2, …, xn, then
Drgsk@KLUniversity Page 17
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
f(x) = y0+(x-x0)[x0, x1] + (x-x0)(x-x1)[x0, x1, x2] + …+ (x-x0)(x-x1)…(x-xn-1)[x0, x1, x2, …, xn],
which is known as Newton’s general interpolation formula with divided differences.
Value Value of 1st divided 2nd divided 3rd divided 4th divided
of x y difference difference difference difference
5 150
121
7 392 24
265 1
11 1452 32 0
457 1
13 2366 42
709
Drgsk@KLUniversity Page 18
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
17 5202
By Newton divided difference formula
f(x) = y0+(x-x0)[x0, x1] + (x-x0)(x-x1)[x0, x1, x2] +(x-x0)(x-x1)(x-x2)[x0, x1, x2,x3]
+ (x-x0)(x-x1)(x-x2)(x-x3)[x0, x1, x2,x3,x4].
f(9) = 150 + (9 – 5)×121 + (9 – 5) (9 – 7)×24 + (9 – 5)(9 – 7)(9 – 11)×1
+ (9 – 5)(9 – 7)(9 – 11)(9 – 13)×0
= 150 + 484 + 192 – 16 + 0
= 810.
Numerical Differentiation:
Mathematically, the derivative represents the rate of change of a dependent variable with respect
to an independent variable. For example, if we are given a function y(t) that specifies an object’s
position as a function of time, differentiation provides a means to determine its velocity, as in:
Numerical differentiation is used when the function y = f(x) is given in tabular form or it
is highly complex. The basic idea in numerical differentiation is to replace the given function y =
f(x) on the interval by an interpolating polynomial P(x) and set f '(x) = P'(x), f '' (x) = P'' (x) etc.
Numerical differentiation is less exact than interpolation.
p2 p 2 p 3 3p 2 2p 3 p 4 6p 3 11p 2 3p 4
y(x) y 0 py 0 Δ y0 Δ y0 Δ y 0 ...
2 6 24
Differentiating the above equation with respect to x, we have
dy dy dp 1 dy 1 2p 1 2 3p 2 6p 2 3 4p 3 18p 2 22p 6 4
Δy 0 Δ y0 Δ y0 Δ y 0 .... Ag
dx dp dx h dp h 2 6 24
ain differentiating with respect to x, we get
d2y d dy d dy dp 1 d dy 1 2 6p 2 18p 11 4
2
2
Δ y 0 ( p 1) Δ 3
y 0 Δ y 0 .... Sp
dx dx dx dp dx dx h dp dx h 12
ecial case: If the derivative is required to find at a basic tabulated point x = xi, then choose x0= xi
and the formulas become
dy 1 1 1 1 1
Δy 0 Δ 2 y 0 Δ 3 y 0 Δ 4 y 0 Δ 5 y 0
dx x x 0 h 2 3 4 5
And
d2y 1 2 11 4 5 5
3
dx 2 Δ y 0 Δ y 0 12 Δ y 0 6 Δ y 0 .
xx0 h2
Numerical differentiation using Newton’s backward formula:
In this case we replace y(x) by Newton’s backward interpolation formula
p(p 1) 2 p(p 1)(p 2) 3 p(p 1)(p 2)(p 3) 4
y(x) y n py n yn yn y n ...
2! 3! 4!
x xn dp 1
where p and h = xi+1 – xi, for i = 1, 2, …, n. Here p is a function of x and .
h dx h
Rewriting the above equation, we have
p2 p 2 p 3 3p 2 2p 3 p 4 6p 3 11p 2 3p 4
y(x) y n py 0 yn yn y n ...
2 6 24
Differentiating the above equation with respect to x, we have
dy dy dp 1 dy 1 2p 1 2 3p 2 6p 2 3 4p3 18p 2 22p 6 4
y n yn yn y n ....
dx dp dx h dp h 2 6 24
Again differentiating with respect to x, we get
d2y d dy d dy dp 1 d dy 1 2 3 6p 2 18p 11 4
2 y n ( p 1) y n y n ....
2 dx dx dp dx dx h dp dx h 12
dx
Special case: If the derivative is required to find at a basic tabulated point x = xi, then choose xn=
xi and the formulas become
dy 1 1 1 1 1
y 0 2 y n 3 y n 4 y n 5 y n
dx x x n h 2 3 4 5
and
d2y 1 2 11 4 5 5
3
dx 2 y n y n 12 y n 6 y n .
x x n h2
Example#1. Compute f'(x) and f''(x) at (i) x = 16 (ii) x = 15 (iii) x = 24 (iv) x = 25 from the
following table
x 15 17 19 21 23 25
Drgsk@KLUniversity Page 20
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
(ii) Since x = 15 is in the beginning of the table, we use Newton forward formula. Here the step
size h = 2, x = x0 = 15 and p = 0.
Newton forward formula to compute first derivative of y=f(x) at x = x0 is
dy 1 1 1 1 1
Δy 0 Δ 2 y 0 Δ 3 y 0 Δ 4 y 0 Δ 5 y 0
dx x x 0 h 2 3 4 5
Substituting the values from the table, we have
Drgsk@KLUniversity Page 21
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
dy 1 1 1 1 1
0.25 (-0.014) (0.002) (-0.001) (0.002)
dx x 15 2 2 3 4 5
f'(15) = 0.128958.
Newton forward formula to compute second derivative of y=f(x) at x = x0 is
d2y 1 2 11 4 5 5
3
dx 2 Δ y 0 Δ y 0 12 Δ y 0 6 Δ y 0 .
xx0 h2
Drgsk@KLUniversity Page 22
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
d2y 1 2 11 4 5 5
3
dx 2 y n y n 12 y n 6 y n .
x x n h2
Substituting the values from the table, we have
d2y 1 11 5
dx 2 0.009 0.002 12 (0.001) 6 (0.002) .
x 25 22
f ''(25) = -0.001833.
Numerical Integration
According to the dictionary definition, to integrate means “to bring together, as parts, into
a whole; to unite; to indicate the total amount” Mathematically, definite integration is
represented by
(1)
which stands for the integral of the function f (x) with respect to the independent variable x,
evaluated between the limits x = a to x = b. As suggested by the dictionary definition, the
“meaning” of Eq. (1) is the total value, or summation, of f (x)dx over the range x = a to b. In fact,
the symbol ∫ is actually a stylized capital S that is intended to signify the close connection
between integration and summation.
Geometrically, integration is just finding the area under a curve from one point to another. It is
b
represented by f ( x) dx , where the numbers a and b are the lower and upper limits of
a
integration, respectively, the function f is the integrand of the integral, and x is the variable of
integration. Figure 1 represents a graphical demonstration of the concept.
Why are we interested in integration: because most equations in physics are differential
equations that must be integrated to find the solution(s). Furthermore, some physical quantities
can be obtained by integration (example: displacement from velocity).
Drgsk@KLUniversity Page 23
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
The problem is that sometimes integrating analytically some functions can easily become
laborious. For this reason, a wide variety of numerical methods have been developed to find the
integral.
The process of evaluating a definite integral from a set of tabulated values of the integrand f(x) is
called numerical integration. This process when applied to a function of single variable, is known
as quadrature.
b
Let I y(x)dx , where y(x) takes the values y0, y1, y2, …, yn for x = x0, x1, x2, …, xn.
a
Let us divide the interval (a, b) into n sub-intervals of width h so that x 0 = a, x1 = x0 + h, x2 = x0 +
2h, …, xn = x0 + nh = b.
xn
h
Trapezoidal rule : y(x)dx (y 0 y n ) 2(y1 y 2 ... y n -1 ) .
2
x0
6
dx
Problem#1. Compute the integral 2 , using (i) Trapezoidal rule (ii) Simpson’s 1/3rd rule
01 x
th
(iii) Simpson’s 3/8 rule and also determine the relative true error.
Drgsk@KLUniversity Page 24
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
1
Sol. Let y(x) and divide the interval (0, 6) into n = 6 subintervals each of length h = 1.
1 x2
Then, we have the following tabular values.
x 0 1 2 3 4 5 6
y(x) 1 0.5 0.2 0.1 0.0588 0.0385 0.027
(i) Trapezoidal rule
xn
h
y(x)dx 2 (y 0 y n ) 2(y1 y 2 ... y n -1 ) .
x0
6
h
y(x)dx 2 (y 0 y 6 ) 2(y1 y 2 y 3 y 4 y 5 )
0
1
(1 0.027) 2(0.5 0.2 0.1 0.0588 0.0385)
2
1.4108.
(ii) Simpson’s 1/3rd rule
xn
h
y(x)dx 3 (y 0 y n ) 4(y1 y 3 ... y n -1 ) 2(y 2 y 4 ... y n - 2 )
x0
6
h
y(x)dx 3 (y 0 y 6 ) 4(y1 y 3 y 5 ) 2(y 2 y 4 )
0
1
(1 0.027) 4(0.5 0.1 0.0385) 2(0.2 0.0588)
3
1.3662.
(iii) Simpson’s 3/8th rule
xn
3h
y(x)dx (y 0 y n ) 3(y1 y 2 y 4 y 5 ... y n -1 y n - 2 ) 2(y3 y 6 ... y n - 3 )
x0
8
6
3h
y(x)dx (y 0 y 6 ) 3(y1 y 2 y 4 y 5 ) 2(y 3 )
0
8
3
(0 0.027) 3(0.5 0.2 0.0588 0.0385) 2(0.1) 1.3571.
8
True value - Approximate value
The relative true error 100% .
True value
True value :
6
dx 6
tan 1 ( x) 0 tan 1 (6) tan 1 (0) 1.4056 0 1.4056.
2
01 x
1.4056 - 1.4108
Relative true error for (i) Trapezoidal rule = 100% 0.3699%.
1.4056
1.4056 - 1.3662
(ii) Simpson’s 1/3rd rule = 100% 2.803%.
1.4056
1.4056 - 1.3571
(iii) Simpson’s 3/8th rule = 100% 3.4504%.
1.4056
Drgsk@KLUniversity Page 25
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
Problems
1. Estimate the missing values in the following table
x 45 50 55 60 65
No. of 31 42 51 35 31
students
5. Construct a cubic polynomial which takes the following values:
x 0 1 2 3
f(x) 1 2 1 10
6. The area of a circle of diameter d is given for the following values:
d 80 85 90 95 100
A 5026 5674 6362 7088 7854
Calculate the area of a circle of diameter 105.
7. Use Gauss forward formula to evaluate y30, given that y21 = 18.4708, y25 = 17.8144,
y29 = 17.1070, y35 = 16.3432 and y37 = 15.5154.
8. Interpolate by means of Gauss’s backward formula, the population of a town for the year
1974, given that
x: 0 2 3 6
Drgsk@KLUniversity Page 26
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
14. Apply Lagrange’s formula inversely to obtain a root of the equation f(x) = 0 f(30)= -30, f(34)
= -13,f(38) = 3 and f(42)= 18.
15. 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 the values of dy/dx and d2y/dx2 at x = 1.1and at x 1.6.
16. 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
f(x): 0 0.128 0.544 1.296 2.432 4.00
17. From the following table, find the values of dy/dx and d2y/dx2 at x = 2.03
19. From the table below, for each value of x, y is minimum? Also find the value of y
x 3 4 5 6 7 8
y 0.205 0.240 0.259 0.262 0.250 0.224
Drgsk@KLUniversity Page 27
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
23. A river is 80 feet wide. The depth d in feet at a distance x feet from one bank is given by the
following table:
x 0 10 20 30 40 50 60 70 80
d 0 4 7 9 12 15 14 8 3
Find approximately the area of the cross-section.
24. A solid of revolution is formed by rotating about the X-axis, the area between the X-axis, the
lines x=0 and x=1 and a curve through the points with the following coordinate:
x 0.00 0.25 0.50 0.75 1.00
y 1.0000 0.9896 0.9589 0.9089 0.8415
Drgsk@KLUniversity Page 28
II/IV B.Tech CSE&ECM Mathematical Methods for Computing (11BS203) Chapter-2
Drgsk@KLUniversity Page 29