0% found this document useful (0 votes)
41 views33 pages

Lec #5 (Numerical Integration)

This document discusses numerical integration using the Trapezoidal Rule and Simpson's Rule. It begins by stating the objectives of approximating a definite integral using these two rules and analyzing the approximate errors. It then provides the theorem and formula for the Trapezoidal Rule, which approximates a definite integral based on dividing the interval into subintervals and calculating the area of trapezoids under the curve. An example demonstrates applying the Trapezoidal Rule to approximate a definite integral. The document also discusses Simpson's Rule and provides an example of applying it.

Uploaded by

Hamna Younis
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)
41 views33 pages

Lec #5 (Numerical Integration)

This document discusses numerical integration using the Trapezoidal Rule and Simpson's Rule. It begins by stating the objectives of approximating a definite integral using these two rules and analyzing the approximate errors. It then provides the theorem and formula for the Trapezoidal Rule, which approximates a definite integral based on dividing the interval into subintervals and calculating the area of trapezoids under the curve. An example demonstrates applying the Trapezoidal Rule to approximate a definite integral. The document also discusses Simpson's Rule and provides an example of applying it.

Uploaded by

Hamna Younis
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/ 33

MATH-352 Numerical Methods – 2+1 CHs

By

Prof Dr Safia Akram

(NUMERICAL INTEGRATION)

Lec # 5

1
OBJECTIVES

❖ Approximate a definite integral using the Trapezoidal Rule.

❖ Approximate a definite integral using Simpson’s Rule.

❖ Analyze the approximate errors in the Trapezoidal Rule and


Simpson’s Rule.

2
NUMERICAL INTEGRATION

As we know that various methods of evaluating antiderivatives of certain


functions are available. In order to evaluate definite integrals, the
fundamental theorem of integral calculus is basic tool. But this theorem fails
to deliver if the antiderivative of integral cannot be found in terms of
elementary functions ( i- e functions that can be expressed as a finite
combination of algebraic and transcendental functions). For such cases
Riemann sums provide an approximation of a definite integral when the
number of points in a partition is large. In practice this method is seldom
used since there are better technique and formulas which give a more
efficient way to approximate such integrals .The methods are called
numerical integration.
3
INTRODUCTION
There are two situations in which it is impossible to find the exact value of a
definite integral.
1. The first situation arises from the fact that, in order to evaluate
𝑏
‫ 𝑥𝑑 𝑥 𝑓 𝑎׬‬using the Fundamental Theorem of Calculus (FTC), we
need to know an antiderivative of 𝑓 𝑥 . However, sometimes, it is
difficult, or even impossible, to find an antiderivative.
For example, it is impossible to evaluate the following integrals exactly:

1 1
𝑥2
ධ 𝑒 𝑑𝑥 ධ 1 + 𝑥 3 𝑑𝑥
0 −1

2. The second situation arises when the function is determined from a


scientific experiment through instrument readings or collected data.

In both cases, we need to find approximate values of definite integrals.


4
THEOREM: Trapezoidal rule
Let a function 𝑓 𝑥 be continuous on [𝑎, 𝑏] and let [𝑎, 𝑏] be partitioned into
"𝑛“ equal subintervals 𝑎 = 𝑥0 , 𝑥1 , 𝑥1 , 𝑥2 , 𝑥2 , 𝑥1 , … , 𝑥𝑛−1 , 𝑥𝑛 = 𝑏 each
𝑏−𝑎
of length ℎ = , then
𝑛
𝑏
𝑏−𝑎 1 1
න 𝑓 𝑥 𝑑𝑥 = 𝑓 𝑥0 + 𝑓 𝑥1 + 𝑓 𝑥2 + ⋯ + 𝑓 𝑥𝑛−1 + 𝑓 𝑥𝑛
𝑛 2 2
𝑎

Or
𝑏
𝑏−𝑎
න 𝑓 𝑥 𝑑𝑥 = 𝑓 𝑥0 + 2𝑓 𝑥1 + 2𝑓 𝑥2 + ⋯ + 2𝑓 𝑥𝑛−1 + 𝑓 𝑥𝑛
2𝑛
𝑎

𝑏
𝑏−𝑎
න 𝑓 𝑥 𝑑𝑥 = 𝑓 𝑥0 + 2(𝑓 𝑥1 + 𝑓 𝑥2 + ⋯ + 𝑓 𝑥𝑛−1 ) + 𝑓 𝑥𝑛
2𝑛
𝑎
5
NOTE:
TRAPEZIUM:
Two sides are parallel and other two sides are not parallel then it is
trapezium. If 4 sides are parallel, then it is parallelogram.
AREA OF TRAPEZIUM:
Area of trapezium = ½ (sum of parallel sides) (shortest distance between them)

1
𝒂 𝒉 𝒃 𝐴= 𝑎+𝑏 ℎ
2

6
Proof:
𝑓 𝑥0 +𝑓 𝑥1
𝐴𝑟𝑒𝑎 𝑜𝑓 𝑡𝑟𝑎𝑝𝑒𝑧𝑖𝑢𝑚 = ℎ
2

𝑥1
𝑓 𝑥0 + 𝑓 𝑥1
න 𝑓 𝑥 𝑑𝑥 = ℎ
2
𝑥0

ℎ 𝑓0 + 𝑓1
=
2 2
𝑓(𝑥1 )
𝑓(𝑥0 )

𝑥1 − 𝑥0 = ℎ
𝑎 = 𝑥0 𝑏 = 𝑥1

7
𝑥2
𝑓 𝑥0 + 𝑓 𝑥1 𝑓 𝑥1 + 𝑓 𝑥2
න 𝑓 𝑥 𝑑𝑥 = ℎ+ ℎ
2 2
𝑥0


= 𝑓 𝑥0 + 𝑓 𝑥1 + 𝑓 𝑥1 + 𝑓 𝑥2
2

= 𝑓 𝑥0 + 2𝑓 𝑥1 + 𝑓 𝑥2
2

𝑥2
ℎ 𝑓(𝑥2 )
න 𝑓 𝑥 𝑑𝑥 = 𝑓0 + 2𝑓1 + 𝑓2 𝑓(𝑥0 )
2
𝑥0
𝑥1 − 𝑥0 𝑥2 − 𝑥1
𝑥0 ℎ 𝑥1 ℎ 𝑥2

8
𝑥3
𝑓 𝑥0 + 𝑓 𝑥1 𝑓 𝑥1 + 𝑓 𝑥2 𝑓 𝑥2 + 𝑓 𝑥3
න 𝑓 𝑥 𝑑𝑥 = ℎ+ ℎ+ ℎ
2 2 2
𝑥0


= 𝑓 𝑥0 + 𝑓 𝑥1 + 𝑓 𝑥1 + 𝑓 𝑥2 + 𝑓 𝑥2 + 𝑓 𝑥3
2
ℎ (𝑥3 , 𝑓 𝑥3
= 𝑓 𝑥0 + 2𝑓 𝑥1 + 2𝑓 𝑥2 + 𝑓 𝑥3
2

𝑥3

න 𝑓 𝑥 𝑑𝑥 = 𝑓 + 2𝑓1 + 2𝑓2 + 𝑓3
2 0

𝑓(𝑥3 )
𝑥0

𝑓(𝑥2 )
𝑓(𝑥0 )

𝑥1 − 𝑥0 𝑥2 − 𝑥1 𝑥3 − 𝑥2
𝑥0 ℎ 𝑥1 ℎ 𝑥2 ℎ 𝑥3

9
In general, trapezoidal rule is defined as
𝑥𝑛

න 𝑓 𝑥 𝑑𝑥 = 𝑓 𝑥0 + 2(𝑓 𝑥1 + 𝑓 𝑥2 + ⋯ + 𝑓 𝑥𝑛−1 ) + 𝑓 𝑥𝑛
2
𝑥0

where
𝑏−𝑎
ℎ=
𝑛

10
EXAMPLE: Use the trapezoidal rule with 𝑛 = 4 to approximate.
4

𝐼 = න 𝑥 2 + 1 𝑑𝑥
0
SOLUTION:
𝑏−𝑎 4−0 4
ℎ= = = =1
𝑛 4 4
𝑥𝑛

න 𝑓 𝑥 𝑑𝑥 = 𝑓 𝑥0 + 2(𝑓 𝑥1 + 𝑓 𝑥2 + 𝑓 𝑥3 ) + 𝑓 𝑥4
2
𝑥0
𝑥0 = 0
𝑥𝑛 𝑓(𝑥𝒏 ) 𝑥1 = 𝑥0 + ℎ
𝑥0 = 0 𝑓 𝑥𝟎 = 𝑥0 2 + 1 = 0 + 1 = 1 𝑥1 = 0 + 1 = 1
𝑥1 = 1 𝑓 𝑥𝟏 = 𝑥1 2 + 1 = 1 + 1 = 1.41421 𝑥2 = 𝑥1 + ℎ = 𝑥0 + 2ℎ
𝑥2 = 2 𝑓 𝑥𝟐 = 𝑥2 2 + 1 = 22 + 1 = 2.23607 =1+1=2
𝑥3 = 3 𝑓 𝑥𝟑 = 𝑥3 2 + 1 = 32 + 1 = 3.16228 𝑥3 = 𝑥2 + ℎ = 2 + 1 = 3
𝑥4 = 4 𝑓 𝑥𝟒 = 𝑥4 2 + 1 = 42 + 1 = 4.12311 𝑥4 = 𝑥3 + ℎ = 3 + 1 = 4
11
𝑥𝑛

න 𝑓 𝑥 𝑑𝑥 = 𝑓 𝑥0 + 2(𝑓 𝑥1 + 𝑓 𝑥2 + 𝑓 𝑥3 ) + 𝑓 𝑥4
2
𝑥0
4
1
න 𝑥2 + 1 𝑑𝑥 = 1 + 2(1.41421 + 2.23607 + 3.16228) + 4.12311
2
0

1 18.74823
= 1 + 2(6.81256) + 4.12311 =
2 2
4

න 𝑥 2 + 1 𝑑𝑥 = 9.37412
0
The exact value of the integral can be found as
4 4
2
𝑥 1 1
𝐼 =න 𝑥 +1= 𝑥 + 1 + ln(𝑥 + 𝑥 2 + 1)
2 = 2 17 + ln(4 + 17)
2 2 0
2
0
= 8.24621 + 0.04736 = 9.29357
4
The approximation 9.37412 of I = ධ 𝑥 2 + 1𝑑𝑥 found by the trapezoidal rule
0
differ from the true value by 0.08054. The error would be reduced if the number of
subintervals partitioning [0, 4] is increased.
12
EXAMPLE: Use the trapezoidal rule with 𝑛 = 6 to estimate.
2
𝑑𝑥
ln 2 = න
𝑥
1
SOLUTION: Here length of each subintervals is

𝑏−𝑎 2−1 1
ℎ= = =
𝑛 6 6
The interval is

𝑥0 = 1
1 6+1 7 7 1 8
𝑥1 = 𝑥0 + ℎ = 1 + = = , 𝑥2 = 𝑥1 + ℎ = + =
6 6 6 6 6 6
8 1 9 9 1 10
𝑥3 = 𝑥2 + ℎ = + = , 𝑥4 = 𝑥3 + ℎ = + =
6 6 6 6 6 6
10 1 11 11 1 12
𝑥5 = 𝑥4 + ℎ = + = , 𝑥6 = 𝑥5 + ℎ = + = =2
6 6 6 6 6 6
13
EXAMPLE: Use the trapezoidal rule with 𝑛 = 6 to estimate.
2
𝑑𝑥
ln 2 = න
𝑥
1
SOLUTION: Here length of each subintervals is

𝑏−𝑎 2−1 1
ℎ= = =
𝑛 6 6
The interval is

𝑥0 = 1
1 6+1 7 7 1 8
𝑥1 = 𝑥0 + ℎ = 1 + = = , 𝑥2 = 𝑥1 + ℎ = + =
6 6 6 6 6 6
8 1 9 9 1 10
𝑥3 = 𝑥2 + ℎ = + = , 𝑥4 = 𝑥3 + ℎ = + =
6 6 6 6 6 6
10 1 11 11 1 12
𝑥5 = 𝑥4 + ℎ = + = , 𝑥6 = 𝑥5 + ℎ = + = =2
6 6 6 6 6 6
14
𝒙𝒏 𝟏
𝒇 𝒙𝒏 =
𝒙
𝑥0 = 1 1 1
𝑓 𝑥𝟎 = = =1
𝑥𝟎 1
7 1 1
𝑥1 = 𝑓 𝑥𝟏 = = = 0.85714
6 𝑥𝟏 7/6
8 1 1
𝑥2 = 𝑓 𝑥𝟐 = = = 0.75
6 𝑥𝟐 8/6
9 1 1
𝑥3 = 𝑓 𝑥𝟑 = = = 0.66667
6 𝑥𝟑 9/6
10 1 1
𝑥4 = 𝑓 𝑥𝟒 = = = 0.6
6 𝑥𝟒 10/6
11 1 1
𝑥5 = 𝑓 𝑥𝟓 = = = 0.54545
6 𝑥𝟓 11/6
𝑥6 = 2 1 1
𝑓 𝑥𝟔 = = = 0.5
𝑥𝟔 2
15
𝑥6

න 𝑓 𝑥 𝑑𝑥 = 𝑓 𝑥0 + 2(𝑓 𝑥1 + 𝑓 𝑥2 + 𝑓 𝑥3 + 𝑓 𝑥4 + 𝑓 𝑥5 ) + 𝑓 𝑥6
2
𝑥0

1
= 1 + 2(0.85714 + 0.75 + 0.66667 + 0.6 + 0.54545) + 0.5
12

1 8.33852
= 1 + 6.83852 + 0.5 = = 0.69487
12 12

By calculator, ln 2 = 0.69487

16
THEOREM: SIMPSON’S 1/3 rule
If a function 𝑓 𝑥 be continuous on [𝑎, 𝑏] and let [𝑎, 𝑏] be partitioned
into an even number "𝑛“ equal subintervals
𝑎 = 𝑥0 , 𝑥1 , 𝑥1 , 𝑥2 , 𝑥2 , 𝑥1 , … , 𝑥𝑛−1 , 𝑥𝑛 = 𝑏 then
𝑏 𝑓 𝑥0 + 4(𝑓 𝑥1 + 𝑓 𝑥3 + 𝑓 𝑥5 + ⋯ + 𝑓 𝑥𝑛−1 )

න 𝑓 𝑥 𝑑𝑥 =
3
𝑎 +2(𝑓 𝑥2 + 𝑓 𝑥4 + 𝑓 𝑥6 … + 𝑓 𝑥𝑛−2 ) + 𝑓 𝑥𝑛

𝑏 𝑓0 + 𝑓𝑛 + 4 𝑓1 + 𝑓3 + 𝑓5 + ⋯ + 𝑓𝑛−1

න 𝑓 𝑥 𝑑𝑥 =
3
𝑎 +2 𝑓2 + 𝑓4 + 𝑓6 + ⋯ + 𝑓𝑛−2

𝑏−𝑎
Where, ℎ=
𝑛
17
PROOF: The trapezoidal rule tries to
simplify integration by approximating the
function to be integrated by a straight line or a
series of line segments.
In Simpson's rule, we try to approximate by a
series of parabolic segments hoping that the
parabola will move closely match the given
curve f(x) then would the straight line in
trapezoidal rule.
To estimate
𝑥2

I = න 𝑓 𝑥 𝑑𝑥
𝑥0

The curve is approximated by a parabolic 𝑓(𝑥2 )


𝑓(𝑥0 )
𝑓 𝑥 = 𝑎 + 𝑏𝑥 + 𝑐𝑥 2 Eq. (1)

Passing through
𝑥0 , 𝑓 𝑥0 , 𝑥1 , 𝑓 𝑥1 , 𝑥2 , 𝑓 𝑥2 𝑥0 𝑥2
𝑥1
That is 18
2
𝑓 𝑥0 = 𝑎 + 𝑏𝑥0 + 𝑐𝑥0
2
𝑓 𝑥1 = 𝑎 + 𝑏𝑥1 + 𝑐𝑥1
2
𝑓 𝑥2 = 𝑎 + 𝑏𝑥2 + 𝑐𝑥2
But if 𝑥0 = 0, 𝑥1 = 𝑥0 + ℎ = 0 + ℎ = ℎ, 𝑥2 = 𝑥0 + 2ℎ = 0 + 2ℎ = 2ℎ
2
𝑓 𝑥0 = 𝑎 + 𝑏𝑥0 + 𝑐𝑥0
=𝑎+𝑏 0 +𝑐 0 =𝑎 ⇒ 𝑓0 = 𝑎 Eq. (2)

𝑓 𝑥1 = 𝑎 + 𝑏 ℎ + 𝑐ℎ2 ⇒ 𝑓1 = 𝑎 + 𝑏 ℎ + 𝑐ℎ2 Eq. (3)

𝑓 𝑥2 = 𝑎 + 2𝑏ℎ + 𝑐(2ℎ)2 ⇒ 𝑓2 = 𝑎 + 2𝑏 ℎ + 2𝑐ℎ2 Eq. (4)


Now solving Eq. (3) and (4) we get the values of 𝑏 and c
𝑓0 − 2𝑓1 + 𝑓2
𝑐=
2ℎ2
Similarly
4𝑓1 − 𝑓2 − 3𝑓0
𝑏=
2ℎ
Now replace the values of a, 𝑏 and c in Eq. (1)
19
𝑥2 2ℎ

I = න 𝑓 𝑥 𝑑𝑥 = න 𝑎 + 𝑏𝑥 + 𝑐𝑥 2 𝑑𝑥
𝑥0 0
2ℎ
4𝑓1 − 𝑓2 − 3𝑓0 𝑓0 − 2𝑓1 + 𝑓2 2
I = ඲ 𝑓0 + 𝑥+ 2
𝑥 𝑑𝑥
2ℎ 2ℎ
0

2ℎ 2ℎ 2ℎ
4𝑓1 − 𝑓2 − 3𝑓0 𝑓0 − 2𝑓1 + 𝑓2 2 𝑑𝑥
I = 𝑓0 න 𝑑𝑥 + න 𝑥 𝑑𝑥 + න 𝑥
2ℎ 2ℎ2
0 0 0

Now integrate above expression w. r. t x

4𝑓1 − 𝑓2 − 3𝑓0 (2ℎ)2 −0 𝑓0 − 2𝑓1 + 𝑓2 2ℎ 3 −0


𝐼 = 𝑓0 2ℎ − 0 + +
2ℎ 2 2ℎ2 3
4
𝐼 = 2𝑓0 ℎ + 4𝑓1 − 𝑓2 − 3𝑓0 ℎ + ℎ 𝑓0 − 2𝑓1 + 𝑓2
3
ℎ ℎ
𝐼 = 6𝑓0 + 12𝑓1 − 3𝑓2 − 9𝑓0 + 4𝑓0 − 8𝑓1 + 4𝑓2 = 𝑓0 + 4𝑓1 + 𝑓2
3 3
20
𝑥𝑛 𝑥2𝑚

න 𝑓 𝑥 𝑑𝑥 = න 𝑓 𝑥 𝑑𝑥
𝑥0 𝑥0

𝑥2 𝑥4 𝑥6 𝑥2𝑚

= න 𝑓 𝑥 𝑑𝑥 + න 𝑓 𝑥 𝑑𝑥 + න 𝑓 𝑥 𝑑𝑥 + ⋯ + න 𝑓 𝑥 𝑑𝑥
𝑥0 𝑥2 𝑥4 𝑥2𝑚−2

ℎ ℎ ℎ
= 𝑓0 + 4𝑓1 + 𝑓2 + 𝑓2 + 4𝑓3 + 𝑓4 + 𝑓4 + 4𝑓5 + 𝑓6 + ⋯
3 3 3


+ 𝑓2𝑚−2 + 4𝑓2𝑚−1 + 𝑓2𝑚
3


= 𝑓0 + 4 𝑓1 + 𝑓3 + 𝑓5 + ⋯ + 𝑓2𝑚−1 + 2 𝑓2 + 𝑓4 + 𝑓6 + ⋯ + 𝑓2𝑚−2 + 𝑓2𝑚
3
𝑥𝑛

න 𝑓 𝑥 𝑑𝑥 = 𝑓0 + 4 𝑓1 + 𝑓3 + 𝑓5 + ⋯ + 𝑓𝑛−1 + 2 𝑓2 + 𝑓4 + 𝑓6 + ⋯ + 𝑓𝑛−2 + 𝑓𝑛
3
𝑥0
21
EXAMPLE: Use the Simpson’s 1/3 rule with 𝑛 = 4 to approximate.
1
𝑑𝑥

1 + 𝑥2
0
SOLUTION: Here length of each subintervals is

𝑏−𝑎 1−0 1
ℎ= = =
𝑛 4 4
The interval is
𝑥0 = 0
1 1 1 1 1
𝑥1 = 𝑥0 + ℎ = 0 + = , 𝑥2 = 𝑥1 + ℎ = + =
4 4 4 4 2
1 1 3 3 1
𝑥3 = 𝑥2 + ℎ = + = , 𝑥4 = 𝑥3 + ℎ = + = 1
2 4 4 4 4
So, Simpson’s 1/3 rule is
1
𝑑𝑥 ℎ
න 2
= 𝑓0 + 4 𝑓1 + 𝑓3 + 2𝑓2 + 𝑓4
1+𝑥 3
0 22
𝑥𝑛 1
𝑓 𝑥𝑛 =
1 + 𝑥𝑛 2
𝑥0 = 0 1 1
𝑓 𝑥𝟎 = = =1
1 + 𝑥0 2 1 + 0
1 1 1 1
𝑥1 = 𝑓 𝑥𝟏 =𝑓 = = = 0.941176
4 4 1 + 𝑥1 2 1 + 1
16
1 1 1 1
𝑥2 = 𝑓 𝑥2 = 𝑓 = = = 0.8
2 2 1 + 𝑥2 2 1 + 1
4 As we know that
3 3 1 1
𝑥3 = 𝑓 𝑥3 = 𝑓 = = = 0.64 1
4 4 1 + 𝑥3 2 1 + 9 𝑑𝑥 𝜋
16 න = 𝑎𝑟𝑐 tan 1 =
1+𝑥 2 4
0
𝑥4 = 1 1 1 1
𝑓 𝑥4 =𝑓 1 = = = = 0.5 = 0.7854
1 + 𝑥4 2 1 + 1 2
1
𝑑𝑥 ℎ
න 2
= 𝑓0 + 4 𝑓1 + 𝑓3 + 2𝑓2 + 𝑓4
1+𝑥 3
0
ℎ ℎ 1
= (1 + 4 0.941176 + 0.64 + 2 0.8 + 0.5) = 9.424704 = 9.424704
3 3 12

= 0.785392 = 0.7854 23
THEOREM: SIMPSON’S 3/8 rule
To apply this rule, the number of intervals “ 𝑛 ” must be a multiple of
3. The formula is
𝑏

න 𝑓 𝑥 𝑑𝑥
𝑎
𝑓 𝑥0 + 3(𝑓 𝑥1 + 𝑓 𝑥2 + 𝑓 𝑥4 + 𝑓 𝑥5 + 𝑓 𝑥7 + 𝑓 𝑥8 + ⋯ + 𝑓 𝑥𝑛−1 )
3ℎ
=
8
+2(𝑓 𝑥3 + 𝑓 𝑥6 + 𝑓 𝑥9 … + 𝑓 𝑥𝑛−3 ) + 𝑓 𝑥𝑛

𝑏 𝑓0 + 𝑓𝑛 + 3 𝑓1 + 𝑓2 + 𝑓4 + 𝑓5 + 𝑓7 + 𝑓8 … + 𝑓𝑛−1
3ℎ
න 𝑓 𝑥 𝑑𝑥 =
8
𝑎 +2 𝑓3 + 𝑓6 + 𝑓9 + ⋯ + 𝑓𝑛−3

𝑏−𝑎
Where, ℎ=
𝑛
HINT: To Proof this rule use cubic polynomial 𝑓 𝑥 = 𝑎𝑥 3 +𝑏𝑥 2 +𝑐𝑥 + 𝑑 and
adopt similar procedure as done in Simpson’s 1/3 rule.
(Try yourself)
24
NOTE:
1. In trapezoidal rule, 𝑓 𝑥 is a linear function of 𝑥, i.e., of the form
𝑓 𝑥 = 𝑎𝑥 + 𝑏. It is the simplest rule but least accurate.

2. In Simpson’s 1/ 3 rule, 𝑓 𝑥 is a polynomial of 2nd degree, i.e.,


𝑓 𝑥 = 𝑎𝑥 2 + 𝑏𝑥 + 𝑐. To apply this rule, the number of intervals
“ 𝑛 ” must be even.

3. In Simpson’s 3/8 rule, 𝑓 𝑥 is a polynomial of 3rd degree, i.e.,


𝑓 𝑥 = 𝑎𝑥 3 +𝑏𝑥 2 +𝑐𝑥 + 𝑑. To apply this rule, the number of
intervals “ 𝑛 ” must be a multiple of 3.

25
EXAMPLE: Use the Simpson’s 3/8 rule to find the integral of
−𝑥 2
𝑓 𝑥 =𝑒 between the limits of 𝑎 = 0.2 and 𝑏 = 1.5. Taking
𝑛 = 3, 6, 9 𝑎𝑛𝑑 12.
SOLUTION: For 𝑛 = 3,
𝑏 − 𝑎 1.5 − 0.2 1.3 13 13
ℎ= = = = =
𝑛 3 3 3 × 10 30
2 1
𝑥0 = 0.2 = =
10 5
1 13 6 + 13 19 19 13 32
𝑥1 = 𝑥0 + ℎ = + = = , 𝑥2 = 𝑥1 + ℎ = + =
5 30 30 30 30 30 30
32 13 45
𝑥3 = 𝑥2 + ℎ = + = = 1.5
30 30 30
So, Simpson’s 3/8 rule is
1.5
−𝑥 2
3ℎ
න 𝑒 𝑑𝑥 = 𝑓0 + 3 𝑓1 + 𝑓2 + 𝑓3
8
0.2 26
2
𝑥𝑛 𝑓 𝑥𝑛 = ⅇ−𝑥𝑛
2 2
1 𝑓 𝑥𝟎 = 𝑒 −𝑥0 = 𝑒 −(0.2) = 0.960789
𝑥0 =
5
19 19 2
𝑥1 = 𝑓 𝑥𝟏 =𝑓 = 𝑒 −𝑥1 = 0.669575659
30 30
32 32
𝑥2 = 𝑓 𝑥2 = 𝑓 = 0.320530521
30 30
𝑥3 = 1.5 𝑓 𝑥3 = 𝑓 1.5 = 0.105399224

1.5
−𝑥 2
3ℎ
න 𝑒 𝑑𝑥 = 𝑓 + 3 𝑓1 + 𝑓2 + 𝑓3
8 0
0.2

3ℎ
= 0.960789 + 3 0.669575659 + 0.320530521 + 0.105399224
8

3 13
= 4.036506766 = 0.65593
8 30
27
For
𝑛=6 Ans 0.65872
𝑛=9 Ans 0.65881
𝑛 = 12 Ans 0.65882

Try yourself

28
EXERCISES

29
30
31
32
33

You might also like