EEMath 12 Lesson 12
EEMath 12 Lesson 12
Objectives
Discussion
Integral Calculus has countless applications in many engineering fields. A common problem
from Integral Calculus is how to find the value of the definite integral,
𝒃
𝑰(𝒇) = ∫ 𝒇(𝒙)𝒅𝒙
𝒂
The evaluation of the integrals sometimes can be daunting and at other times indeterminate.
We will now look into the methods that can give an accurate approximation to the exact value of
the definite integral. One of these methods is the trapezoidal rule (also known as Newton-Cotes
formula). This method is done by approximating (𝑥) by a piecewise linear function and solving for
the integral of each. Let us have the limits of the integral as interval [a, b]. We will divide this
𝒃−𝒂
interval into n equal subintervals, each having a width of = . Then, the integral approximation
𝒏
can be find using,
𝒏
𝒉
𝑰 ≈ ∑[𝒇(𝒙𝒊−𝟏 ) + 𝒇(𝒙𝒊 )]
𝟐
𝒊=𝟏
Where 𝑥𝑖 = 𝑎 + 𝑖ℎ, and 𝑖 = 0,1, … . 𝑛
𝑓(𝑏) − 𝑓(𝑎)
𝑓1 (𝑥) = 𝑓(𝑎) + (𝑥 − 𝑎)
𝑏−𝑎
Thus,
𝑏 𝑏
∫ 𝑓(𝑥)𝑑𝑥 ≈ ∫ 𝑓1 (𝑥)𝑑𝑥
𝑎 𝑎
ILOILO SCIENCE AND TECHNOLOGY UNIVERISTY
College of Engineering and Architecture
2. Input the limits of the integral in cells A2 and B2 and the number of divisions n in the cell C2.
3. The value of h in D2 can be found using the formula,
= (𝑩𝟐 − 𝑨𝟐)/𝑪𝟐
4. In cell E2, enter the formula =A2. This indicates that the value of 𝑎 = 𝑥𝑜 in E2.
5. Enter the formula in cell F2, based on the function f(x).
6. Drag down cell the contents of cell F2 to cell F3.
7. In cell E3, we need to enter a condition that if 𝑥𝑖 is greater than or equal to b, the value of 𝑥𝑖+1
will be equal to b. Otherwise, it will be equal to the sum of 𝑥𝑖 and h. Thus, the formula in cell
E3 will be,
= 𝑰𝑭(𝑬𝟐 >= $𝑩$𝟐, $𝑩$𝟐, 𝑬𝟐 + $𝑫$𝟐)
This formula will ensure that h is added to the previous value until the value of b is reached.
Later on, it will keep entering the value of b. This is done to enable the changing value of n to
make the solution more accurate.
8. Enter the formula in cell G3 for the approximate value of I (integral). This is based on the
general formula. Thus, for G3, the formula is,
𝑬𝟑−𝑬𝟐
= 𝟐∗ (𝑭𝟐+𝑭𝟑)
Notice that instead using h from cell D2, we used E3-E2. This is an advantage since
the formula outputs zeros when we go beyond the right end point b. Thus, the sum of the
numbers will not be affected by the repetition of b. Also, it allows the use of this method to
non-uniform divisions in the interval [𝒂, 𝒃].
9. In cell H3, we will input 1 so that we can monitor if how many divisions are we going to have
based on n.
10. Drag down, cell H3 (fill series) until the value of a cell in column H is equal to n.
11. Drag down the values in cells E3-G3 up to the line where the value in column H is equal to n.
12. Lastly, we can use the summation function to sum up the values in column G. This will now
be the approximate value of the integral.
ILOILO SCIENCE AND TECHNOLOGY UNIVERISTY
College of Engineering and Architecture
Solution:
a) Two-segmented trapezoidal rule (n=2),
𝑏 − 𝑎 10 − 0
ℎ= = =5
2 2
300(5) 300(10)
𝑓(0) = 0 ; 𝑓(5) = = 10.039 ; 𝑓(10) = = 0.136
1 + 𝑒5 1 + 𝑒 10
𝑛−1
ℎ
𝐼 ≈ [𝑓(𝑎) + 2 {∑ 𝑓(𝑎 + 𝑖ℎ)} + 𝑓(𝑏)]
2
𝑖=1
𝑛−1
𝑏−𝑎
𝐼≈ [𝑓(𝑎) + 2 {∑ 𝑓(𝑎 + 𝑖ℎ)} + 𝑓(𝑏)]
2𝑛
𝑖=1
2−1
10 − 0
𝐼≈ [𝑓(0) + 2 {∑ 𝑓(0 + 5)} + 𝑓(10)]
2(2)
𝑖=1
10
𝐼≈ [𝑓(0) + 2𝑓(5) + 𝑓(10)]
4
10
𝐼≈ [0 + 2(10.039) + 0.136]
4
𝑰 ≈ 𝟓𝟎. 𝟓𝟑𝟕
For the absolute relative error, we need first to solve for the exact value of the integral
(calcu tech).
10
300𝑥
∫ ( ) 𝑑𝑥 = 𝟐𝟒𝟔. 𝟓𝟗
0 1 + 𝑒𝑥
246.59 − 50.537
|Ɛ𝑡 | = | | 𝑥 100 = 7𝟗. 𝟓𝟎𝟔%
246.59
This is a bit huge error. Thus, we need more subintervals to make the approximation more
accurate.
ILOILO SCIENCE AND TECHNOLOGY UNIVERISTY
College of Engineering and Architecture
2. Input the limits of the integral in cells A2 and B2 and the number of divisions’ n in cell
C2.
4. In cell E2, enter the formula =A2. This indicates that the value of 𝑎 = 𝑥𝑜 in E2.
5. Enter the formula in cell F2, based on the function f(x). That is,
8. Enter the formula in cell G3 for the approximate value of I (integral). This is based on the
general formula. Thus, for G3, the formula is,
ILOILO SCIENCE AND TECHNOLOGY UNIVERISTY
College of Engineering and Architecture
Notice that instead using h from cell D2, we used E3-E2. This is an advantage since the
formula outputs zeros when we go beyond the right end point b. Thus, the sum of the numbers
will not be affected by the repetition of b. Also, it allows the use of this method to non-
uniform divisions in the interval [𝒂, 𝒃].
9. In cell H3, we will input 1 so that we can monitor if how many divisions are we going to
have based on n.
10. Drag down, cell H3 (fill series) until the value of a cell in column H is equal to n.
11. Drag down the values in cells E3-G3 up to the line where the value in column H is equal
to n.
12. Lastly, we can use the summation function to sum up the values in column G. This will
now be the approximate value of the integral.
Figure 12.3.a. The upper part of the solution using the Trapezoidal rule in the spreadsheet
application
Figure 12.3.b. Lower part of the solution using the Trapezoidal rule in spreadsheet application
Based on figure 12.3.b. the sum of all the terms column G is equal to I=26.4694. This will be the
approximate value of the integral.
246.59 − 246.4652
|Ɛ𝑡 | = | | 𝑥 100 = 0.0101%
246.59
Laboratory Activity #10. Solve the following integrals using a) two-segmented Trapezoidal rule
(n=2) by manual calculation, b) using multiple-segmented Trapezoidal rule at the indicated number
of subintervals implemented in a spreadsheet application. Also solve for the absolute relative true
error in each of the two approaches.
8
1. ∫0 (5𝑥 3 − 7𝑥 − 24)𝑑𝑥 , for b) n=75
30 13,400
2. ∫8 (3500 𝑙𝑛 [13,400−2500𝑥] − 9.8𝑥)𝑑𝑥 , for b) n=50