0% found this document useful (0 votes)
20 views21 pages

Module 4 - BMATS201

This is the maths module 4 notes

Uploaded by

abhishekmorge96
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)
20 views21 pages

Module 4 - BMATS201

This is the maths module 4 notes

Uploaded by

abhishekmorge96
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/ 21

Department of Engineering Mathematics

List of Faculties in the Department

1. Dr. C.S NAGABHUSHANA Professor & HOD

2. Prof. UMME SALMA Assistant Professor

3. Dr. UMADEVI. D Associate Professor

4. Prof. SHARMADA.U Assistant Professor

5. Prof. SNEHA.S Assistant Professor

6. Prof. AZRA BEGUM Assistant Professor

7. Prof. ROOPASHREE Assistant Professor

8. Prof. ISHRATH Assistant Professor

9. Prof. ARIFF ALI Assistant Professor

10. Prof NARESH Assistant Professor

11. Prof. RASHMI Assistant Professor

12. Prof. ARADHANA Assistant Professor

13. Prof. JAGADISH Assistant Professor

14. Prof. PAVITHRA Assistant Professor

15. Prof. SUJATHA Assistant Professor

16. Prof. SINDHU Assistant Professor


Module-4
NUMERICAL METHODS-1

Finite differences:- Interpolation/extrapolation using Newton’s forward and


backward difference formulae, Newton’s divided difference and Lagrange’s
formulae (All formulae without proof).

Solution of polynomial and transcendental equations – Newton-Raphson and


Regula-Falsi methods (only formulae)- Illustrative examples.

Numerical Integration:- Simpson’s (1/3)rd and (3/8)th rules, Trapezoidal (without


proof ) –Problems.

Solution of polynomial and Transcendental

equations Algebraic equation:-


An equation involving the terms like 𝐱, 𝐱𝟐, 𝐱𝟑, 𝟔𝐱𝟔, … are called Algebraic equations

Examples:- (𝐢)𝐱𝟑 + 𝟐𝐱𝟐 + 𝐱 + 𝟓 = 𝟎


(𝐢𝐢)𝐱𝟓 + 𝟏𝟒𝐱𝟐 + 𝟏𝟐𝐱 + 𝟐𝟑𝟓 = 𝟎

Transcendental equation:-
An equation involving the terms like 𝐞𝐱, 𝐥𝐨𝐠𝐱, 𝐭𝐚𝐧𝐱, 𝐥𝐨𝐠𝟏𝟎𝐱, 𝐬𝐢𝐧 𝐱 … are called
Transcendental equations

Examples:- (𝐢) 𝐭𝐚𝐧 𝐱 + 𝐞𝐱 = 𝟎


(𝐢𝐢) 𝐥𝐨𝐠𝐱 − 𝐱 𝐜𝐨𝐬 𝐱 = 𝟎

REGULA-FALSI METHOD
Let 𝐟(𝐱) = 𝟎 be a given equation (Algebraic or transcendental).

To find the root of the equation by Regula-Falsi method we have c= [af(b) – bf(a)]/ [f(b) – f(a)]

This method is also called method of False Position.

PROBLEMS:-
1.Find the fourth root of 12 correct to four decimal places using Regula-Falsi method.
Solution:- Let 𝐱 =𝟒√𝟏𝟐
𝐱𝟒 − 𝟏𝟐 = 𝟎
Let 𝐟(𝐱) = 𝐱𝟒 − 𝟏𝟐
when 𝐱 = 𝟎 ⟹ 𝐟(𝟎) = −𝟏𝟐
when 𝐱 = 𝟏 ⟹ 𝐟(𝟏) = −𝟏𝟏 < 𝟎
when 𝐱 = 𝟐 ⟹ 𝐟(𝟐) = 𝟒 > 𝟎 (nearer to zero)
∴ Root lies between (1, 2)

Let us construct the following table:-

Iteration a 𝒃 𝒇(𝒂) 𝒇(𝒃) c= [af(b) – bf(a)]/ 𝒇(𝒄) = 𝒄𝟒 − 𝟏𝟐


[f(b) – f(a)]
(-v𝒆) (+𝒗𝒆)

1 1.8 1.9 -1.50240 1.03210 1.85928 -0.04969

2 1.85928 1.9 -0.04969 1.03210 1.86115 -0.00154

3 1.86115 1.9 -0.00154 1.03210 1.86121 0.00001

Hence the required root of the equation is 𝟏. 𝟖𝟔𝟏𝟐𝟏 ≃ 𝟏. 𝟖𝟔𝟏𝟐

2.Obtain the root of the equation 𝐭𝐚𝐧 𝐱 + 𝐭𝐚𝐧 𝐡𝐱 = 𝟎 which lies between 2 and 3 carry out 4
iteration using Regula-Falsi method
Solution:- Let 𝐟(𝐱) = 𝐭𝐚𝐧 𝐱 + 𝐭𝐚𝐧 𝐡𝐱 and root lies between (𝟐, 𝟑)
Let us construct the following table:-

Iteration 𝐚 𝐛 𝐟(𝐚) 𝐟(𝐛) 𝐚 𝐟(𝐛) − 𝐛


(−𝐯 (+𝐯𝐞) 𝐟(𝐚) 𝐟(𝐜)
𝐞) 𝐜=
𝐟(𝐛) − 𝐟(𝐚) = 𝐭𝐚𝐧 𝐜 + 𝐭𝐚𝐧 𝐡𝐜
1 2 3 -1.22101 0.85251 2.58886 0.37191

2 2 2.58886 -1.22101 0.37191 2.45137 0.15955

3 2 2.45137 -1.22101 0.15955 2.39921 0.06618

4 2 2.39921 -1.22101 0.06618 2.37868 0.02696

Hence the required root of the equation is 𝟐. 𝟑𝟕𝟖𝟔𝟖 ≃ 𝟐. 𝟑𝟕𝟖𝟕

1. Find the real root of the equation 𝐞𝐱 − 𝐱 = 𝟐 which lies between 1 and 1.4 carry out 4
iteration using Regula-Falsi method

Solution:- Let 𝐟(𝐱) = 𝐞𝐱 − 𝐱 − 𝟐 and root lies between (𝟏, 𝟏. 𝟒)


Let us construct the following table:-

Iteration 𝐚 𝐛 𝐟(𝐚) 𝐟(𝐛) c= [af(b) – bf(a)]/


(−𝐯 (+𝐯𝐞) [f(b) – f(a)] 𝐟(𝐜) = 𝐞𝐜 − 𝐜 − 𝟐
𝐞)
1 1 1.4 -0.28172 0.65520 1.12027 -0.05459

2 1.12027 1.4 -0.05459 0.65520 1.14178 -0.00944

3 1.14178 1.4 -0.00944 0.65520 1.14545 -0.00159

4 1.14545 1.4 -0.00159 0.65520 1.14007 -0.00026

Hence the required root of the equation is 𝟏. 𝟏𝟒𝟎𝟎𝟕 ≃ 𝟏. 𝟏𝟒𝟎𝟏

2. Find the real root of the equation 𝐱𝟑 − 𝟓𝐱 − 𝟕 = 𝟎 correct to four decimal places using
Regula-Falsi method. (Answer:- 2.74735)

3. Using Regula-Falsi method obtain the root of the equation 𝟑𝐱 = 𝐜𝐨𝐬 𝐱 + 𝟏 correct to four
decimal places. (Answer:- 0.60710)

NEWTON-RAPHSON METHOD
Let 𝐟(𝐱) = 𝟎 be a given equation (Algebraic or transcendental) and let 𝐱𝟎 be an
approximate root of the equation and hence by Newton-Raphson iterative formula we have

𝐱𝐧+𝟏 = 𝐱𝐧 − where 𝐧 = 𝟎, 𝟏, 𝟐, 𝟑, …
𝐟(𝐱𝐧)
𝐟′(𝐱𝐧)

PROBLEMS:-
4. Using Newton-Raphson method find the real root of the equation 𝐱𝟑 − 𝟐𝐱 − 𝟓 = 𝟎 correct
to four decimal places.
Solution:- Let 𝐟(𝐱) = 𝐱𝟑 − 𝟐𝐱 − 𝟓 and 𝐟′(𝐱) = 𝟑𝐱𝟐 − 𝟐
when 𝐱 = 𝟎 ⟹ 𝐟(𝟎) = −𝟓
when 𝐱 = 𝟏 ⟹ 𝐟(𝟏) = −𝟔
when 𝐱 = 𝟐 ⟹ 𝐟(𝟐) = −𝟏 < 𝟎 (nearer to zero)
when 𝐱 = 𝟑 ⟹ 𝐟(𝟑) = 𝟏𝟔 > 𝟎
∴ Root lies between (2, 3)
Now,
when 𝐱 = 𝟐. 𝟏 ⟹ 𝐟(𝟐. 𝟏) = 𝟎. 𝟎𝟔𝟏 > 𝟎
∴ Root lies between (2, 2.1)

Let 𝐱𝟎 = 𝟐 is the approximate root Let


us construct the following table:-
Trail 𝐱𝐧 𝐟(𝐱𝐧) = 𝐱𝐧𝟑 − 𝟐𝐱𝐧 − 𝟓 𝐟′(𝐱𝐧) = 𝟑𝐱𝐧𝟐 − 𝟐 𝐱𝐧+𝟏= 𝐱𝐧 −
No. 𝐟(𝐱𝐧)
𝐟 ′(𝐱𝐧)

𝐟(𝐱𝟎) = 𝐱𝟎𝟑 − 𝟐𝐱𝟎 − 𝟓 𝐟′(𝐱𝟎) = 𝟑𝐱𝟎𝟐 − 𝟐


𝐧=𝟎 𝐱𝟎 = 𝟐 𝐱𝟏 = 𝟐. 𝟏
𝐟(𝐱𝟎) = −𝟏 𝐟′(𝐱𝟎) = 𝟏𝟎

𝐟(𝐱𝟏) = 𝐱𝟏𝟑 − 𝟐𝐱𝟏 − 𝟓 𝐟′(𝐱𝟏) = 𝟑𝐱𝟏𝟐 − 𝟐 𝐱𝟐 = 𝟐. 𝟎𝟗𝟒𝟓𝟕


𝐧=𝟏 𝐱𝟏 = 𝟐. 𝟏
𝐟(𝐱𝟏) = 𝟎. 𝟎𝟔𝟏 𝐟′(𝐱𝟏) = 𝟏𝟏. 𝟐𝟑

𝐟(𝐱𝟐) = 𝐱𝟐𝟑 − 𝟐𝐱𝟐 − 𝟓 𝐟′(𝐱𝟐) = 𝟑𝐱𝟐𝟐 − 𝟐


𝐧=𝟐 𝐱𝟐 = 𝟐. 𝟎𝟗𝟒𝟓𝟕 𝐱𝟑 = 2.09455

𝐟(𝐱𝟐) = 𝟎. 𝟎𝟎𝟎𝟐𝟏 𝐟′(𝐱𝟐) = 𝟏𝟏. 𝟏𝟔𝟏𝟔𝟕

Hence the required root of the equation is 𝟐. 𝟎𝟗𝟒𝟓𝟓 ≃ 𝟐. 𝟎𝟗𝟒𝟔

5. Using Newton-Raphson method find the real root of the equation 𝐱 𝐬𝐢𝐧𝐱 + 𝐜𝐨𝐬𝐱 =
𝟎 𝐧𝐞𝐚𝐫 𝐱 = 𝛑 Carry out four iteration correct to four decimal places.
Solution:- Let 𝐟(𝐱) = 𝐱 𝐬𝐢𝐧𝐱 + 𝐜𝐨𝐬𝐱 and 𝐟′(𝐱) = 𝐱 𝐜𝐨𝐬 𝐱
Given 𝐱𝟎 = 𝛑 is the approximate root
Let us construct the following table

No. 𝐱𝐧 𝐟(𝐱𝐧) = 𝐱𝐧 𝒔𝒊𝒏𝐱𝐧 + 𝒄𝒐𝒔𝐱𝐧 𝐟′(𝐱𝐧) = 𝐱𝐧 𝐜𝐨𝐬 𝐱𝐧


𝐱𝐧+𝟏= 𝐱𝐧 − 𝐟(𝐱𝐧)
𝐟 ′(𝐱𝐧)

𝐧=𝟎 𝐱𝟎 = 𝝅 𝐟(𝐱𝟎) = −𝟏 𝐟′(𝐱𝟎) = −𝝅 𝐱𝟏 = 𝟐. 𝟖𝟐𝟑𝟖𝟐

𝐧=𝟏 𝐱𝟏 = 𝟐. 𝟖𝟐𝟑𝟖𝟐 𝐟(𝐱𝟏) = −𝟎. 𝟎𝟔𝟔𝟏𝟖 𝐟′(𝐱𝟏) = −𝟐. 𝟔𝟖𝟏𝟒𝟒 𝐱𝟐 = 𝟐. 𝟕𝟗𝟖𝟔𝟎

𝐧=𝟐 𝐱𝟐 = 𝟐. 𝟕𝟗𝟖𝟔𝟎 𝐟(𝐱𝟐) = −𝟎. 𝟎𝟎𝟎𝟓𝟔 𝐟′(𝐱𝟐) = −𝟐. 𝟔𝟑𝟓𝟓𝟗 𝐱𝟑 = 2.79839

𝐧=𝟑 𝐱𝟑 = 𝟐. 𝟎𝟗𝟒𝟓𝟕 𝐟(𝐱𝟑) = −𝟎. 𝟎𝟎𝟎𝟎𝟏 𝐟′(𝐱𝟑) = −𝟐. 𝟔𝟑𝟓𝟏𝟗 𝐱𝟒 = 2.79839

Hence the required root of the equation is 𝟐. 𝟕𝟗𝟖𝟑𝟗 ≃ 𝟐. 𝟕𝟗𝟖𝟒

3.Using Newton-Raphson method find the real root of the equation 𝐭𝐚𝐧𝐱 = 𝐱 𝐧𝐞𝐚𝐫 𝐱 = 𝟒. 𝟓
correct to four decimal places.
Solution:- Let 𝐟(𝐱) = 𝐭𝐚𝐧𝐱 − 𝐱 and 𝐟′(𝐱) = 𝐬𝐞𝐜𝟐 𝐱 − 𝟏 = 𝐭𝐚𝐧𝟐 𝐱
Given 𝐱𝟎 = 𝟒. 𝟓 is the approximate root
Let us construct the following table:-
NO. 𝐱𝐧 𝐟(𝐱𝐧) = 𝒕𝒂𝒏𝐱𝐧 − 𝐱𝐧 𝐟′(𝐱𝐧) = 𝒕𝒂𝒏𝟐 𝐱𝐧
𝐱𝐧+𝟏= 𝐱𝐧 − 𝐟(𝐱𝐧)
𝐟 ′(𝐱𝐧)

𝐧=𝟎 𝐱𝟎 = 𝟒. 𝟓 𝐟(𝐱𝟎) = 𝟎. 𝟏𝟑𝟕𝟑𝟑 𝐟′(𝐱𝟎) = 𝟐𝟏. 𝟓𝟎𝟒𝟖𝟓 𝐱𝟏 = 𝟒. 𝟒𝟗𝟑𝟔𝟏

𝐧=𝟏 𝐱𝟏 = 𝟒. 𝟒𝟗𝟑𝟔𝟏 𝐟(𝐱𝟏) = 𝟎. 𝟎𝟎𝟒𝟎𝟓 𝐟′(𝐱𝟏) = 𝟐𝟎. 𝟐𝟐𝟖𝟗𝟕 𝐱𝟐 = 𝟒. 𝟒𝟗𝟑𝟒𝟏

𝐧=𝟐 𝐱𝟐 = 𝟒. 𝟒𝟗𝟑𝟒𝟏 𝐟(𝐱𝟐) = 𝟎. 𝟎𝟎𝟎𝟎𝟏 𝐟′(𝐱𝟐) = 𝟐𝟎. 𝟏𝟗𝟎𝟖𝟑 𝐱𝟑 = 𝟒. 𝟒𝟗𝟑𝟒𝟏

Hence the required root of the equation is 𝟒. 𝟒𝟗𝟑𝟒𝟏 ≃ 𝟒. 𝟒𝟗𝟑𝟒

1. Using Newton-Raphson method find the real root of the equation 𝒙 + 𝐥𝐨𝐠𝟏𝟎 𝒙 = 𝟑. 𝟑𝟕𝟓 by
taking initial approximation as 2.9 correct to four decimal places.
(Answer:-2.91096)
2. Using Newton-Raphson method find the real root of the equation 𝒙𝒆𝒙 − 𝟐 = 𝟎 correct to
four decimal places. (Answer:-0.8526)

Finite difference:-

Consider a function 𝑦 = 𝑓(𝑥) and let x0 , x1 = x0 + h, x2 = x1 + h, x3 = x2 +


h … , xn = xn−1 + h be a set of points at a common interval ‘h’. Let the corresponding function of
y = f(x) be y0 = f(x0), y1 = f(x1), y2 = f(x2), … , yn = f(xn)

Forward difference:-
The first forward difference of f(x) is denoted by ∆f(x) and is defined as ∆f(x) =
f(x) − f(x − h) where ∆ is forward difference operator.

Backward difference:-

The first backward difference of f(x) is denoted by ∇f(x) and is defined as ∇f(x) =
f(x + h) − f(x) where ∇ is backward difference operator.

Interpolation:-

If y0, y1, y2, y3, … . , yn be a set of values of a function y = f(x) corresponding to the values of
x: x0, x1, x2, x3, … . , xn The process of finding or estimating the value of y for a given value of x
between x0 and xn is called Interpolation.

Also the process of finding the value of 𝑦 outside the given range of 𝑥 is called
Extrapolation.

In general Interpolation includes Extrapolation also.

Forward and Backward difference formula for equal intervals:-


Let y0, y1, y2, y3, … . , yn be a set of values of a function y = f(x) corresponding to the equi-
distant values of x: x0, x1 = x0 + h, x2 = x0 + 2h, x3 = x0 + 3h … , xn = x0 + nh Thus we have two
interpolation formula as follows:-

Newton’s Forward Interpolation Formula (NFIF):-

The value of y = f(x) at x = x0 + rh is approximately given by

∆𝑦0 𝑟(𝑟−1)∆2 𝑦0 ∆3 𝑦0 ∆4 𝑦0
y = f(x) = y0 +r +r + r (r-1) (r-2) 3!
+ 𝑟(𝑟 − 1)(𝑟 − 2)(𝑟 − 3) 4!
… ….+
1! 2!
∆𝑛 𝑦
r(r − 1) ... [r − (n − 1)] 𝑛! 0
𝑥−𝑥0
Where r = and r = any real no, x = point at which y has to be found, 𝑥0 = first value of x,

h = length of the interval

Newton’s Backward Interpolation Formula (NBIF):-


The value of y = f(x) at x = xn + rh is approximately given by
𝛻𝑦𝑛 𝑟(𝑟−1)𝛻 2 𝑦𝑛 𝛻3 𝑦𝑛 𝛻
4𝑦
𝑛
y = f(x) = 𝑦𝑛 +r +r + r (r-1) (r-2) + 𝑟(𝑟 − 1)(𝑟 − 2)(𝑟 − 3) … ….+
1! 2! 3! 4!
𝛻 𝑛 𝑦𝑛
r(r − 1) ... [r − (n − 1)]
𝑛!

𝑥−𝑥𝑛
Where r = and r = any real no, x = point at which y has to be found, 𝑥𝑛 = last value of x,

h = length of the interval
PROBLEMS:-

1. Find f(1.4) using the data given below:


x 1 2 3 4 5
y = f(x) 10 26 58 112 194

Solution:-Here we need to find y at x = 1.4 and since the value of x lies in the first half of the
table we use NFIF. Let us construct the following table:

𝒙 𝒚 ∆𝒚 ∆𝟐𝒚 ∆𝟑𝒚 ∆𝟒𝒚


𝒙𝟎 = 𝟏 𝒚𝟎 = 𝟏𝟎
∆𝒚𝟎 = 𝟏𝟔
2 26 ∆𝟐𝒚𝟎 = 𝟏𝟔
32 ∆𝟑𝒚𝟎 = 𝟔
3 58 22 ∆𝟒𝒚𝟎 = 𝟎
54 6
4 112 28
82
5 194

By NFIF we have,
∆𝑦0 𝑟(𝑟−1)∆2 𝑦0 ∆3 𝑦0 ∆4 𝑦0
y = f(x) =y0 +r +r + r (r-1) (r-2) + 𝑟(𝑟 − 1)(𝑟 − 2)(𝑟 − 3)
1! 2! 3! 4!

1.4−1`
where r =(x-𝑥0 )/h= =0.4
1

16 0.4(0.4−1) 6 0
y = f(1. 4) = 10+0.4 1! + 2!
(16)+ 0.4 (0.4-1) (0.4-2)3! + 0.4(0.4 − 1)(0.4 − 2)(0.4 − 3) 4!

y=f(1.4)= 14.864

2. Construct the interpolating polynomial for the data given below:


𝐱 0 1 2
𝐲 = 𝐟(𝐱) 0 5 2

Solution:- The interpolating polynomial can be found either by NFIF or NBIF. In this
problem we use NFIF. Let us construct the following table:

𝐱 𝐲 ∆𝐲 ∆𝟐𝐲
𝐱𝟎 = 𝟎 𝐲𝟎 = 𝟎
∆𝐲𝟎 = 𝟓
1 5 ∆𝟐𝐲𝟎 = −𝟖
-3
2 2

By NFIF we have, Y=f(x)= 𝑦 + 𝑟 ∆𝑦0+r(r-1)...


0 1!

𝑥−0`
Where r =(x-𝑥0 )/h= 1
=x

𝐲 = 𝐟(𝐱) = 𝟓𝐱 + (𝐱𝟐 − 𝐱)(−𝟒)

𝐲 = 𝐟(𝐱) = −𝟒𝐱𝟐 + 𝟗𝐱 is the required Interpolating polynomial.

3. Construct the interpolating polynomial for the data given below and also find 𝐲 𝐚𝐭 𝐱 = 𝟓
𝐱 0 1 2 3
𝐲 = 𝐟(𝐱) 1 3 7 13

Solution:- The interpolating polynomial can be found either by NFIF or NBIF. In this problem we use
NBIF. Let us construct the following table:

𝐱 𝐲 𝛁𝐲 𝛁 𝟐𝐲 𝛁𝟑𝐲
0 1
2
1 3 2
4 𝛁𝟑𝐲𝐧 = 𝟎
2 7 𝛁𝟐𝐲𝐧 = 𝟐
𝛁𝐲𝐧 = 𝟔
𝐱𝐧 = 𝟑 𝐲𝐧 = 𝟏𝟑
By NBIF we have,
𝛻𝑦𝑛 𝑟(𝑟−1)𝛻 2 𝑦𝑛 𝛻3 𝑦𝑛 𝛻
4𝑦
𝑛
y = f(x) = 𝑦𝑛 +r +r + r (r-1) (r-2) + 𝑟(𝑟 − 1)(𝑟 − 2)(𝑟 − 3) … ….
1! 2! 3! 4!

𝑥−𝑥𝑛 𝑥−3
Where r = = = x-3
ℎ 1

(𝑥−3) (𝑥−3)(𝑥−2)2 (x−3)(x−2)(x−1)


y = f(x) = 13+6 +r + (0).
1! 2! 3!

𝐲 = 𝐟(𝐱) = 𝟏𝟑 + 𝟔𝐱 − 𝟏𝟖 + 𝐱𝟐 − 𝟑𝐱 − 𝟐𝐱 + 𝟔

𝐲 = 𝐟(𝐱) = 𝐱𝟐 + 𝐱 + 𝟏 is the required interpolating polynomial.

Put 𝐱 = 𝟓 in the above equation we get,

𝐲 = 𝐟(𝟓) = 𝟑𝟏

4. From the following table estimate the no. of students those who are obtained the marks in
between 40 and 45
Marks 30-40 40-50 50-60 60-70 70-80
No. of Students 31 42 51 35 31

Solution:- Here we re-construct the given table according to the marks scored by the students
Students who scored less than 40 marks = 31 students
Students who scored less than 50 marks = 31+42 = 73 students
Students who scored less than 60 marks = 73+51 = 124 students
Students who scored less than 70 marks = 124+ 35 = 159 students
Students who scored less than 80 marks = 159+31 = 190 students
In this problem we use NFIF. Let us construct the following table:

Less than ′𝒚′ ∆𝒚 ∆𝟐𝒚 ∆𝟑𝒚 ∆𝟒𝒚


′𝒙′ marks

𝒙𝟎 = 𝟒𝟎 𝒚𝟎 = 𝟑𝟏
∆𝒚𝟎 = 𝟒𝟐
50 73 ∆𝟐𝒚𝟎 = 𝟗
51 ∆𝟑𝒚𝟎 = −𝟐𝟓
60 124 -16 ∆𝟒𝒚𝟎 = −𝟑𝟕
35 12
70 159 -4
31
80 190

𝐲 = 𝐟(𝟒𝟓) = 𝟑𝟏 + 𝟐𝟏 − 𝟏. 𝟏𝟐𝟓𝟎 − 𝟏. 𝟓𝟔𝟐𝟓 − 𝟏. 𝟒𝟒𝟓𝟑

𝐲 = 𝐟(𝟒𝟓) = 𝟒𝟕. 𝟖𝟔𝟕𝟐 ≃ 𝟒𝟖 𝐬𝐭𝐮𝐝𝐞𝐧𝐭𝐬

Now from the table we have the no. of students scoring less than 40 marks = 31 students
Hence the no. of students those who are obtained the marks in between 40 and 45 = (48 – 3)=
17 students
Interpolation with un-equal intervals
Divided difference:-
Let 𝐲 = 𝐟(𝐱) be any real valued function in which 𝐲𝟎 = 𝐟(𝐱𝟎), 𝐲𝟏 = 𝐟(𝐱𝟏), 𝐲𝟐 = 𝐟(𝐱𝟐), … , 𝐲𝐧 =
𝐟(𝐱𝐧) are the corresponding values to 𝐱𝟎 , 𝐱𝟏, 𝐱𝟐, … , 𝐱𝐧 respectively. If the given intervals are not
equally spaced in such cases we apply divided difference formula

The divided difference table as follows:-

𝐱 𝐲 = 𝐟(𝐱) 𝟏𝐬𝐭 𝐃𝐃 𝟐𝐧𝐝 𝐃𝐃 .... 𝐧𝐭𝐡 𝐃𝐃


𝐱𝟎 𝐟(𝐱𝟎)
𝐟(𝐱𝟎, 𝐱𝟏)
𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐)
𝐱𝟏 𝐟(𝐱𝟏) .
𝐟(𝐱𝟏, 𝐱𝟐) .
. .
𝐱𝟐 𝐟(𝐱𝟐) . . .... 𝐟(𝐱𝟎 , 𝐱𝟏, … , 𝐱𝐧)
. . .
. . .
𝐱𝟑 . . 𝐟(𝐱𝐧−𝟐, 𝐱𝐧−𝟏, 𝐱𝐧)
. . .
. . 𝐟(𝐱𝐧−𝟏, 𝐱𝐧)
. 𝐟(𝐱𝐧)
.
𝐱𝐧

Newton’s Divided Difference Formula or Newton’s General Interpolation Formula:-


Let 𝐲 = 𝐟(𝐱) be any real valued function in which 𝐲𝟎 = 𝐟(𝐱𝟎), 𝐲𝟏 = 𝐟(𝐱𝟏), 𝐲𝟐 =
𝐟(𝐱𝟐), … , 𝐲𝐧 = 𝐟(𝐱𝐧) are the corresponding values to 𝐱𝟎 , 𝐱𝟏, 𝐱𝟐, … , 𝐱𝐧 respectively. The Newton’s
Divided Difference Formula or Newton’s General Interpolation Formula is given by
𝐲 = 𝐟(𝐱) = 𝐟(𝐱𝟎) + (𝐱 − 𝐱𝟎) 𝐟(𝐱𝟎, 𝐱𝟏) + (𝐱 − 𝐱𝟎)(𝐱 − 𝐱𝟏) 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐) + (𝐱
− 𝐱𝟎)(𝐱 − 𝐱𝟏)(𝐱 − 𝐱𝟐) 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐, 𝐱𝟑) + ⋯

PROBLEMS:-

1. Using Newton’s Divided Difference Formula find 𝐟(𝟒) for the following data:
𝐱 0 2 3 6
𝐲 = 𝐟(𝐱) -4 2 14 158

Solution:- Let us construct the divided difference table:


𝐱 𝐲 = 𝐟(𝐱) 𝟏𝐬𝐭 𝐃𝐃 𝟐𝐧𝐝 𝐃𝐃 𝟑𝐫𝐝 𝐃𝐃
𝐱𝟎 = 𝟎 𝐟(𝐱𝟎) = −𝟒

𝐟(𝐱𝟎, 𝐱𝟏) = 𝟑
𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐) = 𝟑
𝐱𝟏 = 𝟐 𝐟(𝐱𝟏) = 𝟐
𝐟(𝐱𝟏, 𝐱𝟐) = 𝟏𝟐 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐, 𝐱𝟑) = 𝟏

𝐟(𝐱𝟏, 𝐱𝟐,, 𝐱𝟑) = 𝟗


𝐱𝟐 = 𝟑 𝐟(𝐱𝟐) = 𝟏𝟒
𝐟(𝐱𝟐, 𝐱𝟑) = 𝟒𝟖

𝐱𝟑 = 𝟔 𝐟(𝐱𝟑) = 𝟏𝟓𝟖

The Newton’s Divided Difference Formula or Newton’s General Interpolation Formula is given by

𝐲 = 𝐟(𝐱) = 𝐟(𝐱𝟎) + (𝐱 − 𝐱𝟎) 𝐟(𝐱𝟎, 𝐱𝟏) + (𝐱 − 𝐱𝟎)(𝐱 − 𝐱𝟏) 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐) + (𝐱 − 𝐱𝟎)(𝐱 −
𝐱𝟏)(𝐱 − 𝐱𝟐) 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐, 𝐱𝟑)

Put 𝐱 = 𝟒 in the above we get,

𝐲 = 𝐟(𝟒) = −𝟒 + (𝟒 − 𝟎) (𝟑) + (𝟒 − 𝟎)(𝟒 − 𝟐) (𝟑) + (𝟒 − 𝟎)(𝟒 − 𝟐) (𝟒 − 𝟑)(𝟏)

𝐟(𝟒) = 𝟒𝟎

2. Obtain the interpolating polynomial using divided difference formula for the data
given below:
𝐱 1 3 4 6
𝐲 = 𝐟(𝐱) 4 32 55 119

Solution:- Let us construct the divided difference table:

𝐱 𝐲 = 𝐟(𝐱) 𝟏𝐬𝐭 𝐃𝐃 𝟐𝐧𝐝 𝐃𝐃 𝟑𝐫𝐝 𝐃𝐃


𝐱𝟎 = 𝟏 𝐟(𝐱𝟎) = 𝟒
𝐟(𝐱𝟏) − 𝐟(𝐱𝟎) 𝟑𝟐 − (−𝟒)
𝐟(𝐱𝟎, 𝐱𝟏) = 𝐱𝟏 − 𝐱 𝟎 = 𝟑 − 𝟏
= 𝟏𝟒 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐)
𝐱𝟏 = 𝟑 𝐟(𝐱𝟏) = 𝟑𝟐 =𝟑
𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐, 𝐱𝟑)
𝐟(𝐱𝟏, 𝐱𝟐) = 𝟐𝟑 =
𝟎
𝐱𝟐 = 𝟒 𝐟(𝐱𝟐) = 𝟓𝟓 𝐟(𝐱𝟏, 𝐱𝟐,, 𝐱𝟑)
𝐟(𝐱𝟐, 𝐱𝟑) = 𝟑𝟐 =𝟑

𝐱𝟑 = 𝟔 𝐟(𝐱𝟑) = 𝟏𝟏𝟗

The Newton’s Divided Difference Formula or Newton’s General Interpolation Formula is given by
𝐲 = 𝐟(𝐱) = 𝐟(𝐱𝟎) + (𝐱 − 𝐱𝟎) 𝐟(𝐱𝟎, 𝐱𝟏) + (𝐱 − 𝐱𝟎)(𝐱 − 𝐱𝟏) 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐) + (𝐱 − 𝐱𝟎)(𝐱 −
𝐱𝟏)(𝐱 − 𝐱𝟐) 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐, 𝐱𝟑)

𝐲 = 𝐟(𝐱) = 𝟒 + (𝐱 − 𝟏) (𝟏𝟒) + (𝐱 − 𝟏)(𝐱 − 𝟑) (𝟑) + (𝐱 − 𝟏)(𝐱 − 𝟑)(𝐱 − 𝟒) (𝟎)

𝐲 = 𝐟(𝐱) = 𝟒 + 𝟏𝟒𝐱 − 𝟏𝟒 + 𝟑(𝐱𝟐 − 𝟒𝐱 + 𝟑)

𝐲 = 𝐟(𝐱) = 𝟑𝐱𝟐 + 𝟐𝐱 − 𝟏 𝐢𝐬 𝐭𝐡𝐞 𝐢𝐧𝐭𝐞𝐫𝐩𝐨𝐥𝐚𝐭𝐢𝐧𝐠 𝐩𝐨𝐥𝐲𝐧𝐨𝐦𝐢𝐚𝐥

3. Given the values


𝒙 5 7 11 13 17
𝒚 150 392 1452 2366 5202
= 𝒇(𝒙)
Find 𝒇(𝟗) using Newton’s General Interpolation

Solution:- Let us construct the divided difference table:

𝐱 𝐲 = 𝐟(𝐱) 𝟏𝐬𝐭 𝐃𝐃 𝟐𝐧𝐝 𝐃𝐃 𝟑𝐫𝐝 𝐃𝐃


𝐱𝟎 = 𝟓 𝐟(𝐱𝟎) = 𝟏𝟓𝟎

𝐟(𝐱𝟎, 𝐱𝟏) = 𝟏𝟐𝟏


𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐) = 𝟐𝟒

𝐱𝟏 = 𝟕 𝐟(𝐱𝟏) = 𝟑𝟗𝟐 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐, 𝐱𝟑) = 𝟏

𝐟(𝐱𝟏, 𝐱𝟐) = 𝟐𝟎𝟓


𝐟(𝐱𝟏, 𝐱𝟐,, 𝐱𝟑) = 𝟑𝟐

𝐱𝟐 = 𝟏𝟏 𝐟(𝐱𝟐) = 𝟏𝟒𝟓𝟐 𝐟(𝐱𝟏,, 𝐱𝟐, 𝐱𝟑, 𝐱𝟒) = 𝟏


𝐟(𝐱𝟐, 𝐱𝟑) = 𝟒𝟓𝟕
𝐟(𝐱𝟐,, 𝐱𝟑, 𝐱𝟒) = 𝟒𝟐
𝐱𝟑 = 𝟏𝟑 𝐟(𝐱𝟑) = 𝟐𝟑𝟔𝟔

𝐟(𝐱𝟑, 𝐱𝟒) = 𝟕𝟎𝟗

𝐱𝟒 = 𝟏𝟕 𝐟(𝐱𝟒) = 𝟓𝟐𝟎𝟐

The Newton’s Divided Difference Formula or Newton’s General Interpolation Formula is given by

𝐲 = 𝐟(𝐱) = 𝐟(𝐱𝟎) + (𝐱 − 𝐱𝟎) 𝐟(𝐱𝟎, 𝐱𝟏) + (𝐱 − 𝐱𝟎)(𝐱 − 𝐱𝟏) 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐)
+ (𝐱 − 𝐱𝟎)(𝐱 − 𝐱𝟏)(𝐱 − 𝐱𝟐) 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐, 𝐱𝟑)

Put 𝐱 = 𝟗 in the above we get, 𝐲 = 𝐟(𝟗) = 𝟖𝟏𝟎

4. Obtain the interpolating polynomial using divided difference formula for the data given below
and also find 𝒇(𝟕)

𝐱 0 1 2 4 5 6

𝐲 = 𝐟(𝐱) 1 14 15 5 6 19
(Answer:- 𝐱𝟑 − 𝟗𝐱𝟐 + 𝟐𝟏𝐱 + 𝟏 and f(7)=50)

Lagrange’s Formula for unequal intervals:-

Let 𝐲 = 𝐟(𝐱) be any real valued function in which 𝐲0 = 𝐟(𝐱0 ), 𝐲1 = 𝐟(𝐱1 ), 𝐲2 = 𝐟(𝐱2 ), … , 𝐲𝐧 = 𝐟(𝐱n ) are the
corresponding values to 𝐱0 , 𝐱1 , 𝐱2 , … , 𝐱n respectively. The Lagrange's formula is given by

(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) … (𝑥 − 𝑥𝑛 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 ) … (𝑥 − 𝑥𝑛 )
𝑦 = 𝑓(𝑥) = 𝑦0 + 𝑦 +⋯
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) … (𝑥0 − 𝑥𝑛 ) (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) … (𝑥1 − 𝑥𝑛 ) 1
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) … (𝑥 − 𝑥𝑛−1 )
+ 𝑦
(𝑥𝑛 − 𝑥0 )(𝑥𝑛 − 𝑥1 ) … (𝑥𝑛 − 𝑥𝑛−1 ) 𝑛

Inverse Lagrange's Formula for unequal intervals:-


Let 𝐱 = 𝐟(𝐲) be any real valued function in which 𝐲0 = 𝐟(𝐱0 ), 𝐲1 = 𝐟(𝐱1 ), 𝐲2 = 𝐟(𝐱2 ), … , 𝐲𝐧 = 𝐟(𝐱𝐧 ) are the
corresponding values to 𝐱0 , 𝐱1 , 𝐱2 , … , 𝐱𝐧 respectively. The Inverse Lagrange's formula is given by (interchanging 𝑥 and
𝑦 in Lagrange's formula)

(𝑦 − 𝑦1 )(𝑦 − 𝑦2 ) … (𝑦 − 𝑦𝑛 ) (𝑦 − 𝑦0 )(𝑦 − 𝑦2 ) … (𝑦 − 𝑦𝑛 )
𝑥 = 𝑓(𝑦) = 𝑥0 + 𝑥 +⋯
(𝑦0 − 𝑦1 )(𝑦0 − 𝑦2 ) … (𝑦0 − 𝑦𝑛 ) (𝑦1 − 𝑦0 )(𝑦1 − 𝑦2 ) … (𝑦1 − 𝑦𝑛 ) 1
(𝑦 − 𝑦0 )(𝑦 − 𝑦1 ) … (𝑦 − 𝑦𝑛−1 )
+ 𝑥
(𝑦𝑛 − 𝑦0 )(𝑥𝑛 − 𝑦1 ) … (𝑦𝑛 − 𝑦𝑛−1 ) 𝑛

PROBLEMS:-

1. Using Lagrange's Formula find the value of 𝑦 when 𝑥 = 10 for the following data

𝐱 5 6 9 11
𝐲 = 𝐟(𝐱) 12 13 14 16

Solution:- Given the data 𝑥0 = 5, 𝑥1 = 6, 𝑥2 = 9, 𝑥3 = 11

𝑦0 = 12, 𝑦1 = 13, 𝑦2 = 14, 𝑦3 = 16

Lagrange's Formula is given by

(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )


𝑦 =𝑓(𝑥) = 𝑦0 + 𝑦
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 ) (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 )(𝑥1 − 𝑥3 ) 1
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )
+ 𝑦2 + 𝑦
(𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )(𝑥2 − 𝑥3 ) (𝑥3 − 𝑥0 )(𝑥3 − 𝑥1 )(𝑥3 − 𝑥2 ) 3

Put x = 10 in the above formula

(10 − 6)(10 − 9)(10 − 11) (10 − 5)(10 − 9)(10 − 11)


𝑦 = 𝑓(10) = (12) +
(5 − 6)(5 − 9)(5 − 11) (6 − 5)(6 − 9)(6 − 11)
(10 − 5)(10 − 6)(10 − 11) (10 − 5)(10 − 6)(10 − 9)
+ (14) + (16)
(9 − 5)(9 − 6)(9 − 11) (11 − 5)(11 − 6)(11 − 9)

13 35 16
𝑦 = 𝑓(10) = 2 − + +
3 3 3
𝑦 = 𝑓(10) = 14.67

2. Obtain the Lagrange's interpolating polynomial for the following data and hence find f(5) and 𝑓(7)

𝐱 1 3 4 6
𝐲 = 𝐟(𝐱) -3 9 30 132

Solution:- Given the data 𝑥0 = 1, 𝑥1 = 3, 𝑥2 = 4, 𝑥3 = 6

𝑦0 = −3, 𝑦1 = 9, 𝑦2 = 30, 𝑦3 = 132

Lagrange's Formula is given by

(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )


𝑦 =𝑓(𝑥) = 𝑦0 + 𝑦
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 ) (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 )(𝑥1 − 𝑥3 ) 1
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )
+ 𝑦2 + 𝑦
(𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )(𝑥2 − 𝑥3 ) (𝑥3 − 𝑥0 )(𝑥3 − 𝑥1 )(𝑥3 − 𝑥2 ) 3

(𝑥 − 3)(𝑥 − 4)(𝑥 − 6) (𝑥 − 1)(𝑥 − 4)(𝑥 − 6)


𝑦 =𝑓(𝑥) = (−3) +
(1 − 3)(1 − 4)(1 − 6) (3 − 1)(3 − 4)(3 − 6)
(𝑥 − 1)(𝑥 − 3)(𝑥 − 6) (𝑥 − 1)(𝑥 − 3)(𝑥 − 4)
+ (30) + (132)
(4 − 1)(4 − 3)(4 − 6) (6 − 1)(6 − 3)(6 − 4)
1 3
𝑦 = 𝑓(𝑥) = (𝑥 3 − 13𝑥 2 + 54𝑥 − 72) + (𝑥 3 − 11𝑥 2 + 34𝑥 − 24) −
10 2
22
−5(𝑥 3 − 10𝑥 2 + 27𝑥 − 18) + (𝑥 3 − 8𝑥 2 + 19𝑥 − 12)
5
(𝑥 − 1)(𝑥 − 3)(𝑥 − 6) (𝑥 − 1)(𝑥 − 3)(𝑥 − 4)
+ (30) + (132)
(4 − 1)(4 − 3)(4 − 6) (6 − 1)(6 − 3)(6 − 4)
1 3
𝑦 = 𝑓(𝑥) = (𝑥 3 − 13𝑥 2 + 54𝑥 − 72) + (𝑥 3 − 11𝑥 2 + 34𝑥 − 24) −
10 2
22
−5(𝑥 − 10𝑥 + 27𝑥 − 18) + (𝑥 3 − 8𝑥 2 + 19𝑥 − 12)
3 2
5

𝑦 = 𝑓(𝑥) = 𝑥 3 − 3𝑥 2 + 5𝑥 − 6 is the required Interpolating polynomial.


put 𝑥 = 5 and 𝑥 = 7 in the above we get,

𝑓(5) = 69 and 𝑓(7) = 225

NUMERICAL INTEGRATION
𝐛 𝐛−𝐚
Consider a definite integral 𝐈 = ∫𝐚 𝐲𝐝𝐱 and the interval [𝐚, 𝐛] is divided into ' 𝐧 ' equal parts of width 𝐡 = 𝐧
The points of division are 𝑎 = 𝑥0 , 𝑥1 = 𝑥0 + ℎ, 𝑥2 = 𝑥0 + 2ℎ, 𝑥3 = 𝑥0 + 3ℎ, . , 𝑥𝑛 = 𝑥0 + 𝐧𝐡 = 𝑏
Let 𝐲0 = 𝐟(𝐱0 ), 𝐲1 = 𝐟(𝐱1 ), 𝐲2 = 𝐟(𝐱2 ), … , 𝐲n = 𝐟(𝐱n ) be the corresponding value of 𝐟(𝐱)
Construct the following table using the values of 𝐱 and 𝐲 as follows:

x 𝐱0 𝐱1 𝐱2 ................... 𝐱n
𝑦 = 𝑓(𝑥) 𝐲0 𝐲1 𝐲2 .................... 𝐲n

1 rd
1. Simpson's (3) rule:-
𝑏 ℎ
𝐼 = ∫𝑎 𝑦𝑑𝑥 = [(𝑦 + 𝑦𝑛 ) + 4(𝑦1 + 𝑦3 + 𝑦5 + ⋯ + 𝑦𝑛−1 ) + 2(𝑦2 + 𝑦4 + 𝑦6 + ⋯ + 𝑦𝑛−2 )]
3 0
3 th
2. Simpson's (8) rule:-
𝑏
3ℎ
𝐼 = ∫ 𝑦𝑑𝑥 = [(𝑦0 + 𝑦𝑛 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + ⋯ + 𝑦𝑛−1 ) + 2(𝑦3 + 𝑦6 + 𝑦9 + ⋯ + 𝑦𝑛−3 )]
𝑎 8
PROBLEMS:-

6 1 rd
1. Evaluate ∫0 3𝐱 2 𝐝𝐱 by dividing the interval [0,6] into six equal parts using (i) Simpson's (3) rule
3 th
(ii) Simpson's (8) rule

6
Solution:- Let 𝐼 = ∫0 3𝑥 2 and 𝑎 = 0, 𝑏 = 6, 𝑛 = 6
b−a 6−0
width(h) = = =1
n 6

The points of division are 𝑎 = 𝑥0 , 𝑥1 = 𝑥0 + ℎ, 𝑥2 = 𝑥0 + 2ℎ, 𝑥3 = 𝑥0 + 3ℎ, … , 𝑥6 = 𝑥0 + 6ℎ = 𝑏


∴ 𝟎, 𝟏, 2,3,4,5,6 are the points of division.

Let us construct the following table:-

𝐱 0 1 2 3 4 5 6

𝐲 = 𝟑𝐱 𝟐 0 3 12 27 48 75 108
𝐲𝟎 𝐲𝟏 𝐲𝟐 𝐲𝟑 𝐲𝟒 𝐲𝟓 𝐲𝟔

𝟏 rd
(i) Simpson's (𝟑) rule for n = 6 is

𝑏

𝐼 = ∫ 𝑦𝑑𝑥 = [(𝑦 + 𝑦6 ) + 4(𝑦1 + 𝑦3 + 𝑦5 ) + 2(𝑦2 + 𝑦4 )]
𝑎 3 0
6
1
𝐼 = ∫ 3𝑥 2 𝑑𝑥 = [(0 + 108) + 4(3 + 27 + 75) + 2(12 + 48)]
0 3
6
𝐼 = ∫ 3𝑥 2 𝑑𝑥 = 216
0

3 th
(ii) Simpson's (8) rule for n = 6 is

𝑏
3ℎ
𝐼 = ∫ 𝑦𝑑𝑥 = [(𝑦0 + 𝑦6 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 ) + 2(𝑦3 )]
𝑎 8
6
3(1)
𝐼 = ∫ 3𝑥 2 𝑑𝑥 = [(0 + 108) + 3(3 + 12 + 48 + 75) + 2(27)]
0 8
6
𝐼 = ∫ 3𝑥 2 𝑑𝑥 = 216 Weddle's rule for 𝑛 = 6: −
0
𝑏
3ℎ
𝐼 = ∫ 𝑦𝑑𝑥 = [𝑦 + 5𝑦1 + 𝑦2 + 6𝑦3 + 𝑦4 + 5𝑦5 + 𝑦6 ]
𝑎 10 0
6
3(1)
𝐼 = ∫ 3𝑥 2 𝑑𝑥 = [0 + 5(3) + 12 + 6(27) + 48 + 5(75) + 108]
0 10
6
𝐼 = ∫ 3𝑥 2 𝑑𝑥 = 216
0

6 dx 1 rd 3 th
2. Evaluate ∫0 1+x2
by using (i) Simpson's (3) rule (ii) Simpson's (8) rule
𝐛−𝐚
Solution:- Divide the interval (𝟎, 𝟔) into six parts each of width 𝐡 where 𝐡 = 𝐧
6−0
Here 𝑎 = 0, 𝑏 = 6 and 𝑛 = 6 and ℎ = 6 = 1
The points of division are 𝑎 = 𝑥0 , 𝑥1 = 𝑥0 + ℎ, 𝑥2 = 𝑥0 + 2ℎ, 𝑥3 = 𝑥0 + 3ℎ, … , 𝑥6 = x0 + 6 h = b
∴ 𝟎, 𝟏, 𝟐, 𝟑, 𝟒, 𝟓, 𝟔 are the points of division.
Let us construct the following table:-
0 1 2 3 4 5 6
𝐱
𝟏
𝐲= 1 0.5 0.2 0.1 0.0588 0.0385 0.027
𝟏 + 𝐱𝟐
𝐲𝟎 𝐲𝟏 𝐲𝟐 𝐲𝟑 𝐲𝟒 𝐲𝟓

1 rd
(i)Simpson's (3) rule for n = 6 is

𝑏

𝐼 = ∫ 𝑦𝑑𝑥 = [(𝑦 + 𝑦6 ) + 4(𝑦1 + 𝑦3 + 𝑦5 ) + 2(𝑦2 + 𝑦4 )]
𝑎 3 0
6
𝑑𝑥 1
𝐼=∫ 2
= [(1 + 0.027) + 4(0.5 + 0.1 + 0.0385) + 2(0.2 + 0.0588)]
0 1+𝑥 3
6
𝑑𝑥
𝐼=∫ 2
= 1.3662
0 1+𝑥

3 th
(ii) Simpson's ( ) rule for n = 6 is
8

𝑏
3ℎ
𝐼 = ∫ 𝐲𝑑𝑥 = [(𝑦0 + 𝑦6 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 ) + 2(𝑦3 )]
𝑎 8
6
𝑑𝑥 3(1)
𝐼=∫ 2
= [(1 + 0.027) + 3(0.5 + 0.2 + 0.0588 + 0.0385) + 2(0.1)]
0 1+𝑥 8
6
𝑑𝑥
𝐼=∫ 2
𝑑𝑥 = 1.3570
0 1+𝑥

𝜋/2 1 rd
3. Find an approximate value of ∫0 √cos 𝜃d𝜃 by Simpson′ s (3) rule by taking 7 ordinates.
Solution:- Here 7 ordinates means the given interval must be divided into 6 equal parts
𝜋/2 𝜋
Let 𝐼 = ∫0 √cos 𝜃𝑑𝜃 and 𝑎 = 0, 𝑏 = 2 , 𝑛 = 6 (keep calculator in radians)
𝐛 − 𝐚 𝜋/2 − 0 𝜋
width(h) = = =
𝐧 6 12

The points of division are 𝑎 = 𝑥0 , 𝑥1 = 𝑥0 + ℎ, 𝑥2 = 𝑥0 + 2ℎ, 𝑥3 = 𝑥0 + 3ℎ, … , 𝑥6 = 𝑥0 + 6ℎ = 𝑏


𝜋 2𝜋 3𝜋 4𝜋 5𝜋 6𝜋
∴ 0, 12 , 12 , 12 , 12 , 12 , 12 are the points of division.
Let us construct the following table:-

𝜋 𝟐𝜋 𝟑𝜋 𝟒𝜋 𝟓𝜋 𝜋
𝐱 𝟎
𝟏𝟐 𝟏𝟐 𝟏𝟐 𝟏𝟐 𝟏𝟐 𝟐

𝐲 = √cos 𝜽 1 0.9828 0.9306 0.8409 0.7071 0.5087 0


𝐲𝟎 𝐲𝟏 𝐲𝟐 𝐲3 𝐲𝟒 𝐲𝟓 𝐲𝟔

𝟏 rd
Simpson's (𝟑) rule for n = 6 is

𝑏

𝐼 = ∫ 𝑦𝑑𝑥 = [(𝑦 + 𝑦6 ) + 4(𝑦1 + 𝑦3 + 𝑦5 ) + 2(𝑦2 + 𝑦4 )]
𝑎 3 0
𝜋/2
𝐼=∫ √cos 𝜃𝑑𝜃 = 1.1873
0
Numerical Methods: The Trapezoidal Rule

You will have evaluated definite integrals such as

3
∫ (𝑥 2 )𝑑𝑥
1

before. In doing this, you are evaluating the area under the graph of
𝑓(𝑥) = 𝑥 2 between 𝑥 = 1 and 𝑥 = 3. This is only possible if you can find
an antiderivative for 𝑥 2 . In this example it is easy, the antiderivative is

1
𝐹(𝑥) = 𝑥 3 + 𝑐, where 𝑐 is a constant.
3

and
3
∫ (𝑥 2 )𝑑𝑥 = 𝐹(3) − 𝐹(1)
1
1 1
= 33 + 𝑐 − ( 13 + 𝑐)
3 3
26
= .
3

Sometimes it is not possible to find the antiderivative. In such cases you need to use a numerical method. Two
common methods for calculating definite integrals are:

1. Simpson's rule, and


2. The trapezoidal rule.
This module considers the trapezoidal rule.

The Trapezoidal Rule


The trapezoidal rule works by estimating the area under a graph by a series of trapezoidal strips. In the figure
below, we see an approximation to
6
∫ 𝑥𝑒 −0.5𝑥 𝑑𝑥
1

In this case, we see the trapezoidal rule will underestimate the first strip, is close in the second strip and will
overestimate in the third strip. The trapezoidal rule approximates the area under the curve by adding the areas of
the trapezoids. Any number of strips may be used. The accuracy increases as the number of strips increases.
For the definite integral
𝑏
∫ 𝑓(𝑥)𝑑𝑥
𝑎

the trapezoidal rule has the form


𝑏

∫ 𝑓(𝑥)𝑑𝑥 ≈ [𝑦 + 2𝑦1 + 2𝑦2 + ⋯ + 2𝑦𝑛−1 + 𝑦𝑛 ]
𝑎 2 0

where

1. 𝑛 is the number of strips and can be any number.


2. 𝑦𝑛 = 𝑓(𝑥𝑛 ) are the values of 𝑓(𝑥𝑛 ) at the points 𝑥𝑖 where 𝑖 = 0,1,2, … , 𝑛. Note that 𝑥0 = 𝑎, 𝑥𝑛 = 𝑏.
3. ℎ is the width of each strip and
𝑏−𝑎
ℎ= .
𝑛

4. 𝑥1 = 𝑎 + ℎ, 𝑥2 = 𝑎 + 2ℎ, 𝑥3 = 𝑎 + 3ℎ, … and so on.


Example 1
6
Approximate ∫0 𝑥𝑒−0.5𝑥 𝑑𝑥 using the trapezoidal rule with 3 strips, to 3 decimal places

We have 𝑛 = 3, 𝑎 = 𝑥0 = 0 and 𝑏 = 𝑥3 = 6 so

𝑏−𝑎
ℎ=
𝑛
6
=
3
= 2.

𝑥0 = 0 and 𝑦0 = 𝑓(𝑥0 ) = 0.
𝑥1 = 0 + ℎ = 2 and 𝑦1 = 𝑓(𝑥1 ) = 2𝑒 −1 = 0.73576.
𝑥2 = 0 + 2ℎ = 4 and 𝑦2 = 𝑓(𝑥2 ) = 4𝑒 −2 = 0.54134.
𝑥3 = 0 + 3ℎ = 6 and 𝑦3 = 𝑓(𝑥3 ) = 6𝑒 −3 = 0.29872.

Substituting into (1) above we get:


6
2
∫ 𝑥𝑒 −0.5𝑥 𝑑𝑥 ≈ [𝑦0 + 2𝑦1 + 2𝑦2 + 𝑦3 ]
0 2
= 0 + 2(0.73576) + 2(0.54134) + 0.29872
= 2.85292
6
Hence, to three decimal places, ∫0 𝑥𝑒 −0.5𝑥 𝑑𝑥 ≈ 2.853.

Example 2
1
Approximate ∫0 √1 + 𝑥 3 𝑑𝑥 using the trapezoidal rule with 5 strips, to 3 decimal places.
In this question, 𝑛 = 5, 𝑎 = 0 and 𝑏 = 1 so

𝑏−𝑎
ℎ=
𝑛
1
=
5
= 0.2.

So using the formula above we get

𝑥0 = 0 and 𝑦0 = 𝑓(𝑥0 ) = 1.

𝑥1 = 0 + ℎ = 0.2 and 𝑦1 = 𝑓(𝑥1 ) = √1 + (0.2)3 = 1.00399.


𝑥2 = 0 + 2ℎ = 0.4 and 𝑦2 = 𝑓(𝑥2 ) = √1 + (0.4)3 = 1.03150.
𝑥3 = 0 + 3ℎ = 0.6 and 𝑦3 = 𝑓(𝑥3 ) = √1 + (0.6)3 = 1.10272.
𝑥4 = 0 + 4ℎ = 0.8 and 𝑦4 = 𝑓(𝑥4 ) = √1 + (0.8)3 = 1.22963.
𝑥5 = 0 + 5ℎ = 1.0 and 𝑦5 = 𝑓(𝑥5 ) = √1 + (1)3 = 1.41421.
Substituting into Substituting into (1) above we get:

1 0.2
∫0 √1 + 𝑥 3 𝑑𝑥 ≈ [𝑦 + 2𝑦1 + 2𝑦2 + 𝑦3 ]
2 0
≈ 0.1 [1 + 2 (1.00399) + 2 (1.03150) + 2 (1.10272) + 2 (1.22963) + 1.41421] = 1.11499

You might also like