Module 4 - BMATS201
Module 4 - BMATS201
Transcendental equation:-
An equation involving the terms like 𝐞𝐱, 𝐥𝐨𝐠𝐱, 𝐭𝐚𝐧𝐱, 𝐥𝐨𝐠𝟏𝟎𝐱, 𝐬𝐢𝐧 𝐱 … are called
Transcendental equations
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)]
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)
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:-
1. Find the real root of the equation 𝐞𝐱 − 𝐱 = 𝟐 which lies between 1 and 1.4 carry out 4
iteration using Regula-Falsi method
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)
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
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. 𝐱𝐧 𝐟(𝐱𝐧) = 𝒕𝒂𝒏𝐱𝐧 − 𝐱𝐧 𝐟′(𝐱𝐧) = 𝒕𝒂𝒏𝟐 𝐱𝐧
𝐱𝐧+𝟏= 𝐱𝐧 − 𝐟(𝐱𝐧)
𝐟 ′(𝐱𝐧)
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:-
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.
∆𝑦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
𝑥−𝑥𝑛
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:-
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:
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
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
𝑥−0`
Where r =(x-𝑥0 )/h= 1
=x
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
𝐲 = 𝐟(𝐱) = 𝟏𝟑 + 𝟔𝐱 − 𝟏𝟖 + 𝐱𝟐 − 𝟑𝐱 − 𝟐𝐱 + 𝟔
𝐲 = 𝐟(𝟓) = 𝟑𝟏
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:
𝒙𝟎 = 𝟒𝟎 𝒚𝟎 = 𝟑𝟏
∆𝒚𝟎 = 𝟒𝟐
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
PROBLEMS:-
1. Using Newton’s Divided Difference Formula find 𝐟(𝟒) for the following data:
𝐱 0 2 3 6
𝐲 = 𝐟(𝐱) -4 2 14 158
𝐟(𝐱𝟎, 𝐱𝟏) = 𝟑
𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐) = 𝟑
𝐱𝟏 = 𝟐 𝐟(𝐱𝟏) = 𝟐
𝐟(𝐱𝟏, 𝐱𝟐) = 𝟏𝟐 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐, 𝐱𝟑) = 𝟏
𝐱𝟑 = 𝟔 𝐟(𝐱𝟑) = 𝟏𝟓𝟖
The Newton’s Divided Difference Formula or Newton’s General Interpolation Formula is given by
𝐲 = 𝐟(𝐱) = 𝐟(𝐱𝟎) + (𝐱 − 𝐱𝟎) 𝐟(𝐱𝟎, 𝐱𝟏) + (𝐱 − 𝐱𝟎)(𝐱 − 𝐱𝟏) 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐) + (𝐱 − 𝐱𝟎)(𝐱 −
𝐱𝟏)(𝐱 − 𝐱𝟐) 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐, 𝐱𝟑)
𝐟(𝟒) = 𝟒𝟎
2. Obtain the interpolating polynomial using divided difference formula for the data
given below:
𝐱 1 3 4 6
𝐲 = 𝐟(𝐱) 4 32 55 119
𝐱𝟑 = 𝟔 𝐟(𝐱𝟑) = 𝟏𝟏𝟗
The Newton’s Divided Difference Formula or Newton’s General Interpolation Formula is given by
𝐲 = 𝐟(𝐱) = 𝐟(𝐱𝟎) + (𝐱 − 𝐱𝟎) 𝐟(𝐱𝟎, 𝐱𝟏) + (𝐱 − 𝐱𝟎)(𝐱 − 𝐱𝟏) 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐) + (𝐱 − 𝐱𝟎)(𝐱 −
𝐱𝟏)(𝐱 − 𝐱𝟐) 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐, 𝐱𝟑)
𝐱𝟒 = 𝟏𝟕 𝐟(𝐱𝟒) = 𝟓𝟐𝟎𝟐
The Newton’s Divided Difference Formula or Newton’s General Interpolation Formula is given by
𝐲 = 𝐟(𝐱) = 𝐟(𝐱𝟎) + (𝐱 − 𝐱𝟎) 𝐟(𝐱𝟎, 𝐱𝟏) + (𝐱 − 𝐱𝟎)(𝐱 − 𝐱𝟏) 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐)
+ (𝐱 − 𝐱𝟎)(𝐱 − 𝐱𝟏)(𝐱 − 𝐱𝟐) 𝐟(𝐱𝟎, 𝐱𝟏,, 𝐱𝟐, 𝐱𝟑)
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)
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 ) 𝑛
(𝑦 − 𝑦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
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
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
𝐱 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
𝜋 𝟐𝜋 𝟑𝜋 𝟒𝜋 𝟓𝜋 𝜋
𝐱 𝟎
𝟏𝟐 𝟏𝟐 𝟏𝟐 𝟏𝟐 𝟏𝟐 𝟐
𝟏 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
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:
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
𝑏
∫ 𝑓(𝑥)𝑑𝑥
𝑎
where
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.
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.
𝑥0 = 0 and 𝑦0 = 𝑓(𝑥0 ) = 1.
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