Professional Documents
Culture Documents
Numerical Integration
Numerical Integration
or
I ∼= (b − a) × average height
where, for the trapezoidal rule, the average height is the average
of the function values at
the end points, or [ f (a) + f (b)]/2.
Generally;
Trapezoidal rule is given as
𝒙𝟎 +𝒏𝒉
𝒉
𝑰=∫ 𝒇(𝒙)𝒅𝒙 = [(𝒚𝟎 + 𝒚𝒏 ) + 𝟐(𝒚𝟏 + 𝒚𝟐 + ⋯ + 𝒚𝒏−𝟏 )]
𝒙𝟎 𝟐
𝒃
RULES FOR EVALUATING ∫𝒂 𝒇(𝒙)𝒅𝒙 USING
TRAPEZOIDAL RULE OR SIMPSON’S RULE
𝒃
1. Compare the given definite integral, say I, with ∫𝒂 𝒇(𝒙)𝒅𝒙 to
get the values of f(x) and limits a, b,
𝒃−𝒂
2. Compute h= , where n denotes the number of sub-intervals
𝒏
for the problem.
3. Find the values of y=f(x), corresponding to 𝒙𝟎 = 𝒂, 𝒙𝟏 = 𝒂 +
𝒉, 𝒙𝟐 = 𝒙𝟎 + 𝟐𝒉, … . , 𝒙𝒏 = 𝒙𝟎 + 𝒏𝒉 =
𝒃 𝒂𝒏𝒅 𝒅𝒆𝒏𝒐𝒕𝒆 𝒕𝒉𝒆𝒔𝒆 𝒗𝒂𝒍𝒖𝒆𝒔 𝒂𝒔 𝒚𝟎 , 𝒚𝟏 , 𝒚𝟐 , … . . , 𝒚𝒏. .
4. Apply the specified rule to calculate I (either Trapezoidal rule
or Simpson’s rule).
By trapezoidal rule, we have
𝒙𝟎 +𝒏𝒉
𝒉
𝑰=∫ 𝒇(𝒙)𝒅𝒙 = [(𝒚𝟎 + 𝒚𝒏 ) + 𝟐(𝒚𝟏 + 𝒚𝟐 + ⋯ + 𝒚𝒏−𝟏 )]
𝒙𝟎 𝟐
𝟏
Example: Use Trapezoidal Rule to evaluate ∫𝟎 𝒙𝟑 𝒅𝒙 considering 5
subintervals.
𝟏
Sol. Let 𝑰 = ∫𝟎 𝒙𝟑 𝒅𝒙.
h=0.2, f(x) = 𝒙𝟑
𝟏
𝑰 = ∫ 𝒙𝟑 𝒅𝒙
𝟎
𝟎. 𝟐
= [(𝟎 + 𝟏) + 𝟐(𝟎. 𝟎𝟎𝟖 + 𝟎. 𝟎𝟔𝟒 + 𝟎. 𝟐𝟏𝟔
𝟐
+ 𝟎. 𝟓𝟏𝟐)]
𝟏 𝒅𝒙 𝟏
Example: Evaluate ∫𝟎
𝟏+𝒙 𝟐 dx using Simpson’s
𝟑
rule taking h=0.25
𝟏
𝒅𝒙 𝒉
𝑰=∫ = [(𝒚𝟎 + 𝒚𝟒 ) + 𝟒(𝒚𝟏 + 𝒚𝟐 ) + 𝟐𝒚𝟐 ]
𝟎 𝟏 + 𝒙𝟐 𝟑
𝟏
f(x) = , h=0.25
𝟏+𝒙𝟐
𝟏 𝒅𝒙 𝟎.𝟐𝟓
𝑰 = ∫𝟎 = [(𝟏 + 𝟎. 𝟓) + 𝟒(𝟎. 𝟗𝟒𝟏𝟐 + 𝟎. 𝟔𝟒) + 𝟐 × 𝟎. 𝟖]
𝟏+𝒙𝟐 𝟑
= 0.7854
CLASSWORK
1. Given that
x 4.0 4.2 4.4 4.6 4.8 5.0 5.2
lo 1.3863 1.4351 1.4816 1.5261 1.5686 1.6094 1.6487
gx
𝟓.𝟐
Evaluate ∫𝟒 𝒍𝒐𝒈 𝒙 𝒅𝒙 by (i) Trapezoidal Rule (ii) Simpson’s
𝟏
Rule ANSWERS: (i) 1.82766 (ii)1.82785
𝟑
𝟒
2. Evaluate ∫𝟎 𝒆𝒙 𝒃𝒚 𝑺𝒊𝒎𝒑𝒔𝒐𝒏′ 𝒔𝑹𝒖𝒍𝒆 𝒈𝒊𝒗𝒆𝒏 𝒕𝒉𝒂𝒕 𝒆 =
𝟐. 𝟕𝟐, 𝒆𝟐 = 𝟕. 𝟑𝟗, 𝒆𝟑 = 𝟐𝟎. 𝟎𝟗, 𝒆𝟒 = 𝟓𝟒. 𝟔
ANSWER:53.87
3. A curve is drawn to pass through the points given by the
following table:
x 1 1.5 2 2.5 3.0 3.5 4.0
y 2 2.4 2.7 2.8 3 2.6 2.1
Estimate the area bounded by the curve, x-axis and the line x=1
and x=4.