0% found this document useful (0 votes)
11 views

Numerical Integration Techniques

Uploaded by

asdekafg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Numerical Integration Techniques

Uploaded by

asdekafg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Cruz, Erika Mae V.

Juarez, Maria Nichole R.

DCEE 23: LESSON 11: NUMERICAL INTEGRATION TECHNIQUES

Objective: By the end of this lesson, students will learn how to use techniques like the
Midpoint Rule, Trapezoidal Rule, and Simpson’s Rule to approximate the area under
curves.

NUMERICAL INTEGRATION

Numerical integration is the process of approximating the value of a definite integral


using computational methods. Instead of finding an exact analytic solution (which may
be difficult or impossible), numerical integration techniques estimate the area under a
curve by using simple geometric shapes such as rectangles, trapezoids, or higher-
order polynomials.
NUMERICAL INTEGRATION TECHNIQUES
1. MIDPOINT RULE

The Midpoint Rule, also known as the midpoint Riemann sum or midpoint method,
is a numerical technique for estimating the integral of a function, which represents the
area under a curve. This method involves dividing the area into rectangles of equal
width and using the function's value at the midpoint of each subinterval to determine
the height of each rectangle. The sum of the areas of these rectangles provides an
approximation of the total integral.

𝑛
𝐴𝑟𝑒𝑎 = ∑ 𝑓(𝑥𝑖 ) △ 𝑥
𝑖=1

𝑏
𝐴𝑟𝑒𝑎 = ∫ 𝑓(𝑥)𝑑𝑥
𝑎
The Midpoint Rule for approximating a definite integral is expressed as:

𝒃 𝒏
∫ 𝒇(𝒙)𝒅𝒙 ≈ ∑ 𝒇(𝒙𝒊 ) △ 𝒙
𝒂 𝒊=𝟏

Where:
• [𝒂, 𝒃] is the interval over which the integral is evaluated,
• 𝒏 is the number of subintervals,
𝒃−𝒂
• △ 𝒙 is the width of each subinterval, which calculated as △ 𝒙 = ,
𝒏
𝟏
• 𝒙𝒊 is the midpoint, which is calculated as 𝒙𝒊 = 𝒂 + (𝒊 − 𝟐) △ 𝒙

EXAMPLE

Use the Midpoint Rule with n=4 to approximate the integral:


𝟑
∫ (𝒙𝟐 + 𝟕) 𝒅𝒙
𝟏

Solution:

Interval: [1,3]

Number of Subintervals: n = 4
𝑏−𝑎
△𝑥 =
𝑛
3−1
△𝒙= = 𝟎. 𝟓
4
Getting the midpoint of each subinterval:
1
𝑥𝑖 = 𝑎 + (𝑖 − ) △ 𝑥
2

1
𝒙𝟏 = 1 + (1 − ) 0.5 = 𝟏. 𝟐𝟓
2
1
𝒙𝟐 = 1 + (2 − ) 0.5 = 𝟏. 𝟕𝟓
2
1
𝒙𝟑 = 1 + (3 − ) 0.5 𝒙𝟑 = 𝟐. 𝟐𝟓
2
1
𝒙𝟒 = 1 + (4 − ) 0.5 = 𝟐. 𝟕𝟓
2
Evaluate f(x) at each midpoint:

𝑓(𝑥) = 𝑥 2 + 7

𝒇(𝒙𝟏 ) = 1.252 + 7) = 𝟖. 𝟓𝟔𝟐𝟓

𝒇(𝒙𝟐 ) = 1.752 + 7 = 𝟏𝟎. 𝟎𝟔𝟐𝟓

𝒇(𝒙𝟑 ) = 2.252 + 7 = 𝟏𝟐. 𝟎𝟔𝟐𝟓

𝒇(𝒙𝟒 ) = 2.752 + 7 = 𝟏𝟒. 𝟓𝟔𝟐𝟓

Apply to the formula:


𝑏 𝑛
∫ 𝑓(𝑥)𝑑𝑥 ≈ ∑ 𝑓(𝑥𝑖 ) △ 𝑥
𝑎 𝑖=1
3
∫ (𝑥 2 + 7)𝑑𝑥 ≈ (8.5625 + 10.0625 + 12.0625 + 14.5625)0.5
1
𝟑
∫ (𝒙𝟐 + 𝟕)𝒅𝒙 ≈ 𝟐𝟐. 𝟔𝟐𝟓
𝟏

The result, 22.625, is an approximate value of the integral, while the exact value is
22.67.

2. TRAPEZOIDAL RULE

The Trapezoidal Rule is a method for estimating the area under a curve by breaking
it into smaller trapezoid-shaped sections rather than rectangles. It works by treating
the space under the curve as a series of trapezoids and adding up their areas.
Essentially, it takes the average of the values at the left and right ends of each interval
to make the calculation.
THE ACCURACY OF TRAPEZOIDAL RULE OVER OTHER METHODS

While the Trapezoidal Rule is a useful tool for approximation, it’s not as accurate
as Simpson’s Rule, especially when dealing with smooth functions. This is because
Simpson’s Rule uses a curved (quadratic) approach to approximate the area, while
the Trapezoidal Rule uses straight lines (linear approximation). Both methods aim to
estimate the area, but Simpson’s Rule tends to be more precise.

FORMULA

We need to consider the formula of a trapezoid for this rule. As such, the area of a
trapezoid is given by:
𝒉
𝑨𝒓𝒆𝒂 = (𝒑 + 𝒒)
𝟐

𝒃−𝒂
Where 𝒉 is the new base and 𝒉 = 𝜟𝒙. Where: 𝜟𝒙 = 𝒏

𝒑 and 𝒒 become 𝒚𝟎 and 𝒚𝟏

THE TOTAL AREA WOULD THEN BE GIVEN AS:

1 1 1
𝐴𝑟𝑒𝑎 = (𝑦0 + 𝑦1 ) △ 𝑥 + (𝑦1 + 𝑦2 ) △ 𝑥 + (𝑦2 + 𝑦3 ) △ 𝑥 + …
2 2 2

Where the formula is just a summation of all the areas of n no. of trapezoids.

We can simplify this to give us the trapezoidal rule, for n trapezoids:

𝒚𝟎 𝒚𝒏
𝑨𝒓𝒆𝒂 ≈△ 𝒙 ( + 𝒚𝟏 + 𝒚𝟐 + 𝒚𝟑 + . … . + )
𝟐 𝟐
To find the △ 𝑥 for the area from x = a to x = b, we use:
𝑏−𝑎
△𝑥 =
𝑛
And we also need

𝑦0 = 𝑓(𝑎)

𝑦1 = 𝑓(𝑎 +△ 𝑥)

𝑦2 = 𝑓(𝑎 + 2 △ 𝑥)

𝑦𝑛 = 𝑓(𝑏)

EXAMPLE 1

𝟏
Using n = 3, approximate the integral ∫𝟎 √(𝒙𝟐 + 𝟏)

𝑏−𝑎 1−0 1
𝜟𝒙 = = = = 𝟎. 𝟑𝟑𝟑𝟑
𝑛 3 3

𝒚𝒐 = 𝑓(𝑎) = 𝑓(0) = √02 + 1 = 𝟏

𝒚𝟏 = 𝑓(𝑎 + 𝛥𝑥) = 𝑓(0.3333) = √0.33332 + 1 = 𝟏. 𝟎𝟓𝟒𝟎𝟖𝟐𝟎𝟏𝟑

𝒚𝟐 = 𝑓(𝑎 + 2𝛥𝑥) = 𝑓(0.6667) = √0.66672 + 1 = 𝟏. 𝟐𝟎𝟏𝟖𝟔𝟖𝟗𝟏𝟓

𝒚𝟑 = 𝑓(𝑎 + 3𝛥𝑥) = 𝑓(0.9999) = √0.99992 + 1 = 𝟏. 𝟒𝟏𝟒𝟏𝟒𝟐𝟖𝟓𝟑

0.3333
𝑨𝒓𝒆𝒂 = (1 + 2(1.054082013 + 1.201868915) + 1.414142853) = 𝟏. 𝟏𝟓𝟒𝟐
2

EXAMPLE 2

𝟏
Using n= 5, approximate the integral ∫𝟎 √(𝒙𝟐 + 𝟏)

𝑏−𝑎 1−0
𝜟𝒙 = = = 𝟎. 𝟐
𝑛 5

𝒚𝒐 = 𝑓(𝑎) = 𝑓(0) = √02 + 1 = 𝟏

𝒚𝟏 = 𝑓(𝑎 + 𝛥𝑥) = 𝑓(0.2) = √0.22 + 1 = 𝟏. 𝟎𝟏𝟗𝟖𝟎𝟑𝟗𝟎𝟑

𝒚𝟐 = 𝑓(𝑎 + 2𝛥𝑥) = 𝑓(0.4) = √0.42 + 1 = 𝟏. 𝟎𝟕𝟕𝟎𝟑𝟐𝟗𝟔𝟏


𝒚𝟑 = 𝑓(𝑎 + 3𝛥𝑥) = 𝑓(0.6) = √0.62 + 1 = 𝟏. 𝟏𝟔𝟔𝟏𝟗𝟎𝟑𝟕𝟗

𝒚𝟒 = 𝑓(𝑎 + 4𝛥𝑥) = 𝑓(0.8) = √0.82 + 1 = 𝟏. 𝟐𝟖𝟎𝟔𝟐𝟒𝟖𝟒𝟕

𝒚𝟓 = 𝑓(𝑎 + 5𝛥𝑥) = 𝑓(1) = √12 + 1 = 𝟏. 𝟒𝟏𝟒𝟐𝟏𝟑𝟓𝟔𝟐

0.2
𝑨𝒓𝒆𝒂 = (1 + 2(1.019803903 + 1.077032961 + 1.166190379 + 1.280624847)
2
+ 1.414213562) = 𝟏. 𝟏𝟓𝟎𝟏𝟓𝟏𝟕𝟕𝟒

Based on the 2 examples above, the more subdivisions (n) you have, the smaller
the error, therefore, the approximation is more accurate.

3. SIMPSON'S RULE

Simpson's Rule is a numerical method to estimate the area under a curve by splitting
it into sections and using curved lines (parabolas) to match the shape of the curve.
This method provides a more accurate estimate of an integral compared to using
rectangles or trapezoids.

SIMPSON'S 1/3 RULE

Simpson's 1/3 Rule is a type of Simpson's Rule for approximating the area under a
curve by dividing it into an even number of intervals and using parabolas to fit groups
of three points. It calculates the integral more accurately than simpler methods like the
Trapezoidal Rule.
The Simpson's 1/3 Rule approximation formula is:

𝒃
𝟏
∫ 𝒇(𝒙)𝒅𝒙 ≈ △ 𝒙 [𝒇(𝒙𝟎 ) + 𝟒 ∑ 𝒇(𝒙𝒊 ) + 𝟐 ∑ 𝒇(𝒙𝒊 ) + 𝒇(𝒙𝒏 )]
𝒂 𝟑
𝒊=𝒐𝒅𝒅 𝒊=𝒆𝒗𝒆𝒏

Where:
• [𝒂, 𝒃] is the interval over which the integral is evaluated,
• 𝒏 is the number of subintervals (must be even for the formula to work
properly),
𝒃−𝒂
• △ 𝒙 is the width of each subinterval, which calculated as △ 𝒙 = ,
𝒏
• 𝒙𝒊 are the partition points, which is calculated as 𝒙𝒊 = 𝒂 + 𝒊 △ 𝒙

EXAMPLE
Use the Simpson’s Rule with n=6 to approximate the integral:
𝟑
𝟏
∫ 𝒅𝒙
𝟎 𝒙𝟐 +𝟒

Solution:
Interval: [0,3]

Number of Subintervals: n = 6
𝑏−𝑎
△𝑥 =
𝑛
3−0
△𝒙= = 𝟎. 𝟓
6

Getting the value of each partition point:

𝑥𝑖 = 𝑎 + 𝑖 △ 𝑥

𝒙𝟎 = 0 + 0(0.5) = 𝟎

𝒙𝟏 = 0 + 1(0.5) = 𝟎. 𝟓

𝒙𝟐 = 0 + 2(0.5) = 𝟏

𝒙𝟑 = 0 + 3(0.5) = 𝟏. 𝟓

𝒙𝟒 = 0 + 4(0.5) = 𝟐
𝒙𝟓 = 0 + 5(0.5) = 𝟐. 𝟓

𝒙𝟔 = 0 + 6(0.5) = 𝟑

Evaluate f(x) at each partition point:


1
𝑓(𝑥𝑖) =
𝑥2 + 4

1
𝒇(𝒙𝒐) = = 𝟎. 𝟐𝟓
02 + 4
1
𝒇(𝒙𝟏) = = 𝟎. 𝟐𝟑𝟓𝟑
0.52 +4
1
𝒇(𝒙𝟐) = = 𝟎. 𝟐
12 + 4
1
𝒇(𝒙𝟑) = = 𝟎. 𝟏𝟔
1.52 +4
1
𝒇(𝒙𝟒) = = 𝟎. 𝟏𝟐𝟓
22 +4
1
𝒇(𝒙𝟓) = = 𝟎. 𝟎𝟗𝟕𝟔
2.52 + 4
1
𝒇(𝒙𝟔) = = 𝟎. 𝟎𝟕𝟔𝟗
32 +4

Apply to the formula:


𝑏
1
∫ 𝑓(𝑥)𝑑𝑥 ≈ △ 𝑥 [𝑓(𝑥0 ) + 4 ∑ 𝑓(𝑥𝑖 ) + 2 ∑ 𝑓(𝑥𝑖 ) + 𝑓(𝑥𝑛 )]
𝑎 3
𝑖=𝑜𝑑𝑑 𝑖=𝑒𝑣𝑒𝑛

3
1 1
∫ 𝑑𝑥 ≈ (0.5)[0.25 + 4(0.2353 + 0.16 + 0.0976) + 2(0.2 + 0.125) + 0.0769]
0 𝑥2 + 4 3
𝟑
𝟏
∫ 𝒅𝒙 ≈ 𝟎. 𝟒𝟗𝟏𝟒
𝟎 𝒙𝟐 +𝟒

SIMPSON’S 3/8 RULE

The Simpson's 3/8 rule offers an alternative way to perform numerical


integration. Instead of using quadratic interpolation, it relies entirely on cubic
interpolation. And unlike the Simpson’s 1/3 rule where the integral is divided into 2
subintervals, this rule divides the integral into 3 subintervals like the figure below.

THE ACCURACY OF THE SIMPSON’S 3/8 RULE OVER OTHER METHODS

As stated earlier, the Simpson’s rule in general, is more accurate than both the
trapezoidal and bisection methods. Additionally, compared to the Simpson’s 1/3 rule,
the Simpson’s 3/8 rule allows one more degree of freedom as it is a cubic function
while the Simpson’s 1/3 rule is a quadratic function.

SIMPSON’S 3/8 RULE FORMULA

The formula for the Simpson’s 3/8 rule is derived from the Lagrange interpolation.
𝑏−𝑎
Like usual, h=𝛥𝑥. Where: 𝛥𝑥 = 𝑛

The formula is given by:

𝑏
3
∫ 𝑓(𝑥)𝑑𝑥 = △ 𝑥 [(𝑦0 + 𝑦𝑛 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 + ⋯ 𝑦𝑛−1 )
𝑎 8
+ 2(𝑦3 + 𝑦6 + 𝑦9 + 𝑦𝑛−3 )]

EXAMPLE

Evaluate the following using Simpson’s 3/8 Rule

x 4 4.2 4.4 4.6 4.8 5.0 5.2


f(x) 1.3863 1.4351 1.4816 1.5261 1.5686 1.6094 1.6487

To solve, the number of subintervals must be multiples of 3.

a=4, b=5.2, and n=6

𝑏 − 𝑎 5.2 − 4
𝛥𝑥 = = = 0.2
𝑛 6

Put the values in the Simpson’s 3/8 Rule formula:

𝑏
3
∫ 𝑓(𝑥)𝑑𝑥 = △ 𝑥 [(𝑦0 + 𝑦𝑛 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 + ⋯ 𝑦𝑛−1 )
𝑎 8
+ 2(𝑦3 + 𝑦6 + 𝑦9 + 𝑦𝑛−3 )]
3 (0.2)
= [𝑓(4) + 𝑓(5.2) + 2(𝑓(4.6)) + 3(𝑓(4.2) + 𝑓(4.4) + 𝑓(4.8) + 𝑓(5.0)]
8
0.6
= [1.3863 + 1.6487 + 2(1.5261) + 3(1.4351 + 1.4816 + 1.5686 + 1.6094)]
8
0.6
= [1.3863 + 1.6487 + 3.0522 + 18.2841]
8
0.6
= (24.3713)
8
= 𝟏. 𝟖𝟐𝟕𝟖𝟒𝟕𝟓 , is the required solution.

REFERENCES:

BYJU'S. (2022, August 26). Trapezoidal Rule for Integration (Definition,

Formula, and Examples). https://byjus.com/maths/trapezoidal-rule/

Bourne, M. (n.d.). Trapezoidal rule. https://www.intmath.com/integration/5-

trapezoidal-rule.php

Mount Royal University. (n.d.). Numerical integration: Midpoint, trapezoid,

Simpson’s rule.

https://math.libretexts.org/Courses/Mount_Royal_University/MATH_2200%3A

_Calculus_for_Scientists_II/2%3A_Techniques_of_Integration/2.5%3A_Nume

rical_Integration_-_Midpoint%2C_Trapezoid%2C_Simpson's_rule
ScienceDirect. (n.d.). Simpson's rule.

https://www.sciencedirect.com/topics/engineering/simpsons-rule

Simon Fraser University. (n.d.). Numerical integration.

https://www.sfu.ca/math-

coursenotes/Math%20158%20Course%20Notes/sec_Numerical_Integration.h

tml

Cuemath. (n.d.). Simpson’s Rule (Simpson’s 1/3 Rule): Formula, derivation,

examples. https://www.cuemath.com/simpsons-rule-formula/

Testbook. (2023, May 4). Simpson’s Rule: Definition & Formula for 1/3 & 1/8

examples. https://testbook.com/maths/simpsons-rule

Vedantu. (n.d.). Simpson’s Rule. https://www.vedantu.com/maths/simpsons-

rule

You might also like