Professional Documents
Culture Documents
Unit 8 (Numerical Integration)
Unit 8 (Numerical Integration)
Unit-8
(Numerical Integration)
Dr. Muhammad Majid Gulzar (CIE-KFUPM)
Contents (Unit-8):
1) The Trapezoidal Rule (Sec 21.1)
𝑓𝑓(𝑥𝑥)
𝑏𝑏
𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴 = � 𝑓𝑓(𝑥𝑥)𝑑𝑑𝑑𝑑
𝑎𝑎
𝑏𝑏
(𝑏𝑏 2 − 𝑎𝑎2 ) (𝑏𝑏 𝑛𝑛+1 − 𝑎𝑎𝑛𝑛+1 )
𝐼𝐼 = � 𝑓𝑓(𝑥𝑥)𝑑𝑑𝑑𝑑 ≈ 𝑎𝑎0 (𝑏𝑏 − 𝑎𝑎) + 𝑎𝑎1 +. . . +𝑎𝑎𝑛𝑛
𝑎𝑎 2 𝑛𝑛 + 1
Using Single Straight Line Using Three Straight Line Using Single Parabola
𝑏𝑏
𝑓𝑓(𝑥𝑥) 𝑓𝑓(𝑏𝑏) − 𝑓𝑓(𝑎𝑎) 𝑓𝑓(𝑏𝑏) − 𝑓𝑓(𝑎𝑎)
𝐼𝐼 = � 𝑓𝑓(𝑎𝑎) − 𝑎𝑎 + 𝑥𝑥 𝑑𝑑𝑑𝑑
𝑎𝑎 𝑏𝑏 − 𝑎𝑎 𝑏𝑏 − 𝑎𝑎
𝑏𝑏 𝑏𝑏
𝑓𝑓(𝑏𝑏) − 𝑓𝑓(𝑎𝑎) 𝑓𝑓(𝑏𝑏) − 𝑓𝑓(𝑎𝑎) 𝑥𝑥 2
𝐼𝐼 = 𝑓𝑓(𝑎𝑎) − 𝑎𝑎 𝑥𝑥 � + �
𝑏𝑏 − 𝑎𝑎 𝑏𝑏 − 𝑎𝑎 2
𝑎𝑎 𝑎𝑎
𝑓𝑓(𝑎𝑎) + 𝑓𝑓(𝑏𝑏)
𝐼𝐼 = 𝑏𝑏 − 𝑎𝑎
2
𝑓𝑓(𝑥𝑥)
𝑓𝑓(𝑏𝑏)
𝑓𝑓(𝑎𝑎)
𝑓𝑓(𝑎𝑎) + 𝑓𝑓(𝑏𝑏)
𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴 = 𝑏𝑏 − 𝑎𝑎
2
𝑎𝑎 𝑏𝑏
When we employ the integral under a straight-line segment to approximate the integral under
a curve, we obviously can incur an error that may be substantial
An estimate for the local truncation error of a single application of the trapezoidal rule based
on Taylor Series is
𝑓𝑓(𝑎𝑎) + 𝑓𝑓(𝑏𝑏)
𝐼𝐼 = 𝑏𝑏 − 𝑎𝑎
2
Thus, we denote that the error is approximate by using the notation 𝐸𝐸𝑎𝑎 , rather than exact by using 𝐸𝐸𝑡𝑡 .
Dr. Muhammad Majid Gulzar (CIE-KFUPM)
The Trapezoidal Rule:
The Multiple-Application Trapezoidal Rule:
One way to improve the accuracy of the trapezoidal rule is to divide the integration interval
from 𝑎𝑎 to 𝑏𝑏 into a number of segments and apply the method to each segment
𝑓𝑓(𝑥𝑥)
𝑏𝑏
� 𝑓𝑓(𝑥𝑥)𝑑𝑑𝑑𝑑 = sum of the areas of the trapezoids
𝑎𝑎
𝑓𝑓(𝑥𝑥2 ) + 𝑓𝑓(𝑥𝑥1 )
𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴 = 𝑥𝑥2 − 𝑥𝑥1
2
𝑥𝑥
𝑥𝑥0 𝑥𝑥1 𝑥𝑥2 𝑥𝑥3
𝑎𝑎 𝑏𝑏
Dr. Muhammad Majid Gulzar (CIE-KFUPM)
The Trapezoidal Rule:
It is quite similar to the trapezoidal rule in the sense that it is based on successive
application of the trapezoidal rule.
Trapezoid formula with an interval ℎ gives error of the order 𝑂𝑂(ℎ2 ), Thus we can
combine two Trapezoid estimates with intervals ℎ and ℎ/2 to get a better estimate.
Combined two trapezoidal rule estimates of 𝑂𝑂(ℎ4 ) to yield a new estimate of 𝑂𝑂(ℎ6 ).
Combined two trapezoidal rule estimates of 𝑂𝑂(ℎ6 ) to yield a new estimate of 𝑂𝑂(ℎ8 ).
Here 𝐼𝐼𝑚𝑚 and 𝐼𝐼𝑙𝑙 are the more and less accurate estimates
Previously
Previously
Correct Answer