General Formula For
Numerical Integration
By
Abu kaiser Mohammad Masum
Id: 161-15-6759
Let us consider an integral 𝑎
𝑏
𝑓 𝑥 𝑑𝑥 where f(x) be given certain equidistance value
of x, say 𝑥0 = 𝑎 , 𝑥1 = 𝑎 + ℎ, … … . . , 𝑥 𝑛 = 𝑎 + 𝑛ℎ = 𝑏. And the entries
corresponding to the arguments are 𝑦0, 𝑦1, 𝑦2, … … , 𝑦𝑛 respectively .
be a set of (n+1) values of the function y = f (x) corresponding to the
equidistant values 𝑥0, 𝑥1, 𝑥2, … … , 𝑥 𝑛 of the independent variable x.
Here 𝑥 𝑛 = 𝑥0 + 𝑛ℎ ⇒ ℎ =
𝑥 𝑛−𝑥0
ℎ
=
𝑏−𝑎
ℎ
where a is a lower bound of the interval
[a,b] and where b is the upper
bound of the interval [a,b] and n is the number of intervals.
Now, 𝑎
𝑏
𝑓 𝑥 𝑑𝑥 = 𝑥0
𝑥 𝑛
𝑓 𝑥 𝑑𝑥 …………………………………(i)
𝑦 𝑥 = 𝑦0 + 𝑢∆𝑦0 +
𝑢(𝑢−1)
2!
∆2 𝑦0 +
𝑢(𝑢−1)(𝑢−2)
3!
∆3 𝑦0+…………..Where
u =
𝑥−𝑥0
ℎ
= 𝑥 = 𝑥0 + 𝑢ℎ ∴ 𝑑𝑥 = ℎ𝑑𝑢
𝑎
𝑏
𝑓 𝑥 𝑑𝑥 = 𝑎
𝑏
[𝑦0+𝑢∆𝑦0 +
𝑢(𝑢−1)
2!
∆2 𝑦0 +
𝑢(𝑢−1)(𝑢−2)
3!
∆3 𝑦0+…………. + 𝑢𝑝𝑡𝑜 ( 𝑛 +
Limit Change
When 𝑥 = 𝑥0 𝑡ℎ𝑒𝑛 𝑢 = 0
When 𝑥 = 𝑥 𝑛 𝑡ℎ𝑒𝑛 𝑢 = 𝑛
Putting n = 1in above equation we obtain Trapezoidal rule
𝑎
𝑏
𝑓 𝑥 𝑑𝑥 =
ℎ
2
[ 𝑦0 + 𝑦𝑛 + 𝑘=1
𝑛−1
𝑦 𝑘]
Putting n = 2 in above equation we obtain Simpson’s
1
3
rule
𝑎
𝑏
𝑓 𝑥 𝑑𝑥 =
ℎ
3
[ 𝑦0 + 𝑦𝑛 + 4 𝑘=1,3,5
𝑛−1
𝑦 𝑘 + 2 𝑘=2,4,6
𝑛−2
𝑦 𝑘]
Putting n = 3 in above equation we obtain Simpson’s
3
8
rule
𝑎
𝑏
𝑓 𝑥 𝑑𝑥 =
3ℎ
8
[ 𝑦0 + 𝑦𝑛 + 3 𝑘=3,9,6
𝑘=1
𝑛−1
𝑦 𝑘 + 2 𝑘=3,6,9
𝑛−3
𝑦 𝑘]
Putting n = 6 in above equation we obtain Weddle’s rule
𝑎
𝑏
𝑓 𝑥 𝑑𝑥 =
3ℎ
10
[ 𝑘=0,2,4,6
𝑛
𝑦 𝑘 + 5 𝑘=1,3,5
𝑛−1
𝑦 𝑘 + 𝑘=3,6,9
𝑛−3
𝑦 𝑘
Application of Interpolation
Interpolation
• What is Interpolation?
• What is Extrapolation?
• Types
• Forward interpolation
• Backward interpolation
Y
X
Formula
• Newton’s interpolation
• Forward difference interpolation formula
• Backward difference interpolation formula
• Lagrange’s Interpolation formula
Newton’s Formula for Interpolation
• Newton’s Forward difference formula:
If the given data is
Then the newton’s forward interpolation formula will be ,
𝑦 𝑥 = 𝑦0 + 𝑢∆𝑦0 +
𝑢(𝑢−1)
2!
∆2 𝑦0 +
𝑢(𝑢−1)(𝑢−2)
3!
∆3 𝑦0+…………..+
𝑢 𝑢−1 𝑢−2 …..2𝑢…..(𝑛−1)
𝑛!
∆ 𝑛 𝑦0
Where u =
𝑥−𝑥 𝑛
ℎ
h= difference of x which is always equal interval.
x 𝑥0 𝑥1 𝑥2 …………… 𝑥 𝑛
y 𝑦0 𝑦1 𝑦2 ……………. 𝑦 𝑛
• Newton’s Backward difference formula:
If the given data is
x 𝑥0 𝑥1 𝑥2 …………. 𝑥 𝑛
y 𝑦0 𝑦1 𝑦2 …………… 𝑦 𝑛
Then the newton’s Backward interpolation formula will be ,
𝑦 𝑥 = 𝑦𝑛 + 𝑢𝛻𝑦𝑛 +
𝑢(𝑢+1)
2!
𝛻2
𝑦𝑛 +
𝑢(𝑢+1)(𝑢+2)
3!
𝛻3
𝑦𝑛+…………..+
𝑢 𝑢+1 𝑢+2 …..…..(𝑢+𝑛−1)
𝑛!
𝛻 𝑛 𝑦0
Where u =
𝑥−𝑥 𝑛
ℎ
h= difference of x which is always equal interval.
Example
d 50 55 60 65 70
A 1963 2376 2827 3318 3848
Find The area of circle of diameter 52.Where the area ‘A’ of circle of Diameter ‘d’. Ans:2124
Lagrange’s Interpolation Formula
• Given (n+1)Values of the Function f(x) for𝑥 = 𝑥0, 𝑥1,…………………. , 𝑥 𝑛 normally f(𝑥0)
,f(𝑥1) ,f(𝑥2),………… f(𝑥 𝑛) respectively the formula states:
𝑓(𝑥)=
(𝑥−𝑥1)(𝑥−𝑥2)…..(𝑥−𝑥 𝑛)
𝑥0−𝑥1 (𝑥0−𝑥2)…..(𝑥0−𝑥 𝑛 )
𝑓(𝑥0)+
(𝑥−𝑥0)(𝑥−𝑥2)…..(𝑥−𝑥 𝑛)
𝑥1−𝑥0 (𝑥1−𝑥2)…..(𝑥1−𝑥 𝑛 )
𝑓(𝑥1)+
(𝑥−𝑥0)(𝑥−𝑥1)(𝑥−𝑥3)……..(𝑥−𝑥 𝑛)
𝑥2−𝑥0 (𝑥2−𝑥1)(𝑥2−𝑥3)…..(𝑥2−𝑥 𝑛)
𝑓(𝑥2)+
(𝑥−𝑥0)(𝑥−𝑥1)(𝑥−𝑥2)……..(𝑥−𝑥 𝑛−1)
𝑥 𝑛−𝑥0 (𝑥 𝑛−𝑥1)(𝑥 𝑛−𝑥2)…..(𝑥 𝑛−𝑥 𝑛+1)
𝑓(𝑥 𝑛)
Example
X 321.0 322.8 324.2 325.0
𝑙𝑜𝑔10 𝑥 2.50651 2.50893 2.51081 2.51188
Compute The value of 𝑙𝑜𝑔10323.5. 𝐴𝑛𝑠: 2.50987
Comparisons Between Lagrange and Newton’s Interpolation
Lagrange Newton
1.Lagrange method is numerically unstable 1.Newton's method is usually numerically stable and
computationally efficient.
2.the Lagrange formula less better for computation 2.Newton formula is much better for computation
than the Lagrange formula.
3.Lagrange's form is more efficient then the
Newton's formula when we have to interpolate
several data sets on the same data points
3.Less efficient for several data set.
Use of Interpolation in CSE
Computer graphics.
Drawing 2D Curves helps to find Bezier path in Adobe Illustrator , CorelDraw and Inkscape .
Computer animation, interpolation is inbetweening.
Use for 3D in laser light show .
 Work as motion controller.
Use to make Cartoon films.
Define the color of object, color location of frame.
 Interpolation In Numerical Methods.

Interpolation In Numerical Methods.

  • 1.
    General Formula For NumericalIntegration By Abu kaiser Mohammad Masum Id: 161-15-6759
  • 2.
    Let us consideran integral 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 where f(x) be given certain equidistance value of x, say 𝑥0 = 𝑎 , 𝑥1 = 𝑎 + ℎ, … … . . , 𝑥 𝑛 = 𝑎 + 𝑛ℎ = 𝑏. And the entries corresponding to the arguments are 𝑦0, 𝑦1, 𝑦2, … … , 𝑦𝑛 respectively . be a set of (n+1) values of the function y = f (x) corresponding to the equidistant values 𝑥0, 𝑥1, 𝑥2, … … , 𝑥 𝑛 of the independent variable x. Here 𝑥 𝑛 = 𝑥0 + 𝑛ℎ ⇒ ℎ = 𝑥 𝑛−𝑥0 ℎ = 𝑏−𝑎 ℎ where a is a lower bound of the interval [a,b] and where b is the upper bound of the interval [a,b] and n is the number of intervals.
  • 3.
    Now, 𝑎 𝑏 𝑓 𝑥𝑑𝑥 = 𝑥0 𝑥 𝑛 𝑓 𝑥 𝑑𝑥 …………………………………(i) 𝑦 𝑥 = 𝑦0 + 𝑢∆𝑦0 + 𝑢(𝑢−1) 2! ∆2 𝑦0 + 𝑢(𝑢−1)(𝑢−2) 3! ∆3 𝑦0+…………..Where u = 𝑥−𝑥0 ℎ = 𝑥 = 𝑥0 + 𝑢ℎ ∴ 𝑑𝑥 = ℎ𝑑𝑢 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 𝑎 𝑏 [𝑦0+𝑢∆𝑦0 + 𝑢(𝑢−1) 2! ∆2 𝑦0 + 𝑢(𝑢−1)(𝑢−2) 3! ∆3 𝑦0+…………. + 𝑢𝑝𝑡𝑜 ( 𝑛 + Limit Change When 𝑥 = 𝑥0 𝑡ℎ𝑒𝑛 𝑢 = 0 When 𝑥 = 𝑥 𝑛 𝑡ℎ𝑒𝑛 𝑢 = 𝑛
  • 4.
    Putting n =1in above equation we obtain Trapezoidal rule 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = ℎ 2 [ 𝑦0 + 𝑦𝑛 + 𝑘=1 𝑛−1 𝑦 𝑘] Putting n = 2 in above equation we obtain Simpson’s 1 3 rule 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = ℎ 3 [ 𝑦0 + 𝑦𝑛 + 4 𝑘=1,3,5 𝑛−1 𝑦 𝑘 + 2 𝑘=2,4,6 𝑛−2 𝑦 𝑘] Putting n = 3 in above equation we obtain Simpson’s 3 8 rule 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 3ℎ 8 [ 𝑦0 + 𝑦𝑛 + 3 𝑘=3,9,6 𝑘=1 𝑛−1 𝑦 𝑘 + 2 𝑘=3,6,9 𝑛−3 𝑦 𝑘] Putting n = 6 in above equation we obtain Weddle’s rule 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 3ℎ 10 [ 𝑘=0,2,4,6 𝑛 𝑦 𝑘 + 5 𝑘=1,3,5 𝑛−1 𝑦 𝑘 + 𝑘=3,6,9 𝑛−3 𝑦 𝑘
  • 5.
  • 6.
    Interpolation • What isInterpolation? • What is Extrapolation? • Types • Forward interpolation • Backward interpolation Y X
  • 7.
    Formula • Newton’s interpolation •Forward difference interpolation formula • Backward difference interpolation formula • Lagrange’s Interpolation formula
  • 8.
    Newton’s Formula forInterpolation • Newton’s Forward difference formula: If the given data is Then the newton’s forward interpolation formula will be , 𝑦 𝑥 = 𝑦0 + 𝑢∆𝑦0 + 𝑢(𝑢−1) 2! ∆2 𝑦0 + 𝑢(𝑢−1)(𝑢−2) 3! ∆3 𝑦0+…………..+ 𝑢 𝑢−1 𝑢−2 …..2𝑢…..(𝑛−1) 𝑛! ∆ 𝑛 𝑦0 Where u = 𝑥−𝑥 𝑛 ℎ h= difference of x which is always equal interval. x 𝑥0 𝑥1 𝑥2 …………… 𝑥 𝑛 y 𝑦0 𝑦1 𝑦2 ……………. 𝑦 𝑛
  • 9.
    • Newton’s Backwarddifference formula: If the given data is x 𝑥0 𝑥1 𝑥2 …………. 𝑥 𝑛 y 𝑦0 𝑦1 𝑦2 …………… 𝑦 𝑛 Then the newton’s Backward interpolation formula will be , 𝑦 𝑥 = 𝑦𝑛 + 𝑢𝛻𝑦𝑛 + 𝑢(𝑢+1) 2! 𝛻2 𝑦𝑛 + 𝑢(𝑢+1)(𝑢+2) 3! 𝛻3 𝑦𝑛+…………..+ 𝑢 𝑢+1 𝑢+2 …..…..(𝑢+𝑛−1) 𝑛! 𝛻 𝑛 𝑦0 Where u = 𝑥−𝑥 𝑛 ℎ h= difference of x which is always equal interval.
  • 10.
    Example d 50 5560 65 70 A 1963 2376 2827 3318 3848 Find The area of circle of diameter 52.Where the area ‘A’ of circle of Diameter ‘d’. Ans:2124
  • 11.
    Lagrange’s Interpolation Formula •Given (n+1)Values of the Function f(x) for𝑥 = 𝑥0, 𝑥1,…………………. , 𝑥 𝑛 normally f(𝑥0) ,f(𝑥1) ,f(𝑥2),………… f(𝑥 𝑛) respectively the formula states: 𝑓(𝑥)= (𝑥−𝑥1)(𝑥−𝑥2)…..(𝑥−𝑥 𝑛) 𝑥0−𝑥1 (𝑥0−𝑥2)…..(𝑥0−𝑥 𝑛 ) 𝑓(𝑥0)+ (𝑥−𝑥0)(𝑥−𝑥2)…..(𝑥−𝑥 𝑛) 𝑥1−𝑥0 (𝑥1−𝑥2)…..(𝑥1−𝑥 𝑛 ) 𝑓(𝑥1)+ (𝑥−𝑥0)(𝑥−𝑥1)(𝑥−𝑥3)……..(𝑥−𝑥 𝑛) 𝑥2−𝑥0 (𝑥2−𝑥1)(𝑥2−𝑥3)…..(𝑥2−𝑥 𝑛) 𝑓(𝑥2)+ (𝑥−𝑥0)(𝑥−𝑥1)(𝑥−𝑥2)……..(𝑥−𝑥 𝑛−1) 𝑥 𝑛−𝑥0 (𝑥 𝑛−𝑥1)(𝑥 𝑛−𝑥2)…..(𝑥 𝑛−𝑥 𝑛+1) 𝑓(𝑥 𝑛)
  • 12.
    Example X 321.0 322.8324.2 325.0 𝑙𝑜𝑔10 𝑥 2.50651 2.50893 2.51081 2.51188 Compute The value of 𝑙𝑜𝑔10323.5. 𝐴𝑛𝑠: 2.50987
  • 13.
    Comparisons Between Lagrangeand Newton’s Interpolation Lagrange Newton 1.Lagrange method is numerically unstable 1.Newton's method is usually numerically stable and computationally efficient. 2.the Lagrange formula less better for computation 2.Newton formula is much better for computation than the Lagrange formula. 3.Lagrange's form is more efficient then the Newton's formula when we have to interpolate several data sets on the same data points 3.Less efficient for several data set.
  • 14.
    Use of Interpolationin CSE Computer graphics. Drawing 2D Curves helps to find Bezier path in Adobe Illustrator , CorelDraw and Inkscape . Computer animation, interpolation is inbetweening. Use for 3D in laser light show .  Work as motion controller. Use to make Cartoon films. Define the color of object, color location of frame.