Advanced Engineering Mathematics Finals Proj
Advanced Engineering Mathematics Finals Proj
ADVANCED ENGINEERING
MATHEMATICS
A Simplified Workbook in Advanced
Mathematics for Engineering for ME
WORKBOOK IN EM 225
ADVANCE ENGINEERING MATHEMATICS FOR ME
1|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Preface
2|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
3|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
ACKNOWLEDGMENTS
4|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
5|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
COURSE OUTLINE
Chapter 8: Interpolation
8.1 Interpolation
6|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Learning Objectives:
At the end of the lesson, the students will be able to:
Overview:
This chapter introduces the fundamental concepts of numerical
methods, focusing on the importance of numerical analysis in
solving mathematical problems computationally. It covers the types
of errors that can arise during numerical computations, how to
measure and express these errors, and the distinction between
accuracy and precision. The chapter also discusses common sources
of error, including truncation errors, which occur when infinite
processes are approximated by finite ones.
7|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
8|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
9|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Accuracy vs Precision
Accuracy
10 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
• Significance: High accuracy indicates that the approximation
or measurement is correct or nearly correct.
• Example: If the true value of a quantity is 100, an
approximate value of 99.8 is considered highly accurate.
Precision
Sources of Error
Errors in numerical analysis can be broadly classified into
two main categories: modeling errors and numerical errors. Each
category encompasses several specific types of errors that can
impact the accuracy and reliability of computational results.
Modeling Error
Modeling errors arise from the process of formulating a
mathematical model to represent a real-world problem. These errors
occur before any numerical computation begins and typically stem
from the following sources:
11 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Numerical Error
Numerical errors are introduced during the computational process
when solving mathematical models using numerical methods. The two
principal sources of numerical error are:
12 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Round-off Error
Round-off error, also known as rounding error, is the
discrepancy that arises when a number is approximated due to the
limitations in representing real numbers with finite precision in
digital computations. This error occurs because computers can only
store numbers using a fixed number of digits, leading to the need
to round or truncate values that cannot be exactly represented.
1
For example, numbers like 3
, π, or √2 cannot be expressed
exactly in decimal or binary form. When these numbers are stored
or used in calculations, they are approximated to a nearby value,
and the difference between the true value and the stored value
constitutes the round-off error
Truncation Error
Truncation error is a fundamental concept in numerical
analysis that arises when an infinite mathematical process is
approximated by a finite procedure.
13 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Definition
For example:
o In numerical differentiation, approximating derivatives
using finite differences introduces truncation error
proportional to the step size.
o In numerical integration, methods like the trapezoidal
or Simpson’s rule approximate the integral over finite
intervals, causing truncation error.
14 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Significance
𝑥 𝑥2 𝑥3 𝑥4
➢ Maclaurin series of 𝑒 𝑥 = 1 + 1!
+ 2!
+ 3!
+ 4!
+⋯
𝑥 𝑥2 𝑥3
➢ Approximate 𝑒 𝑥 by 𝑒 𝑥 = 1 + + +
1! 2! 3!
𝑥 𝑥2 𝑥3 𝑥4 𝑥5
➢ Error in Truncation = 𝑒 𝑥 –( 1!
+ 2! + 3!
)= + 4! 5!
+…
EXAMPLES:
∞
𝑥 2𝑛 𝑥2 𝑥4
cos(x)=∑ (−1)𝑛 =1− + −⋯
𝑛=1 (2𝑛) 2! 4!
15 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
𝑥2 𝑥4
cos(x)1 − +
2! 4!
Substitute x=0.5:
0.52 0.54
Cos (0.5)≈1 2
+ 24
=1−0.125+0.00260417=0.87760417
cos(0.5)≈0.87758256
Error ≈ ∣0.87760417−0.87758256∣≈0.00002161
∞
𝑥𝑛 𝑥2 𝑥3 𝑥4
ln (1+x) =∑ (−1)𝑛+1 =𝑥− + − +⋯
𝑛=1 (2𝑛) 2 3 4
=0.2−0.02+0.00266667−0.0004=0.18226667
ln(1.2)≈0.18232156
Error ≈ ∣0.18232156−0.18226667∣≈0.00005489
16 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Let:
𝑎
I= ∫𝑏 𝑓(x)dx(exact value)
Then,
Truncation Error=I−Iapprox
17 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Cause:
• The higher the order of the approximation and the smaller the
step size (Δx or h), the smaller the truncation error
typically is.
Example:
2
∫1 ln(𝑥)𝑑𝑥
We need:
2
∫1 ln(𝑥)𝑑𝑥
∫ 𝑙𝑛 (𝑥)dx =x ln(x)−x+C
So,
2
∫1 ln(𝑥)𝑑𝑥 =[xln(x)−𝑥]12 = (2𝑙𝑛(2) − 2) − (1𝑙𝑛(1) − 1)
=(2ln(2)−2)−(−1)=2ln(2)−1≈2(0.6931)−1=1.3862−1=0.3862
18 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Step size:
2−1
h= 5
= 0.2
Points:
x0=1.0,x1=1.2,x2=1.4,x3=1.6,x4=1.8,x5=2.0
Function values:
f(x0)=ln(1.0)=0.0000
f(x1)=ln(1.2)≈0.1823
f(x2)=ln(1.4)≈0.3365
f(x3)=ln(1.6)≈0.4700
f(x4)=ln(1.8)≈0.5878
f(x5)=ln(2.0)≈0.6931
Trapezoidal Approximation:
ℎ
T= 2
[f(x0)+2f(x1)+2f(x2)+2f(x3)+2f(x4)+f(x5)]
ℎ
T= 2
[0+2(0.1823+0.3365+0.4700+0.5878)+0.6931]
=0.1[0+2(1.5766)+0.6931]=0.1⋅(3.1532+0.6931=0.1⋅3.8463=0.3846
(𝑏−𝑎)3 )
ET=− 12𝑛2
f′′(ξ),for some ξ∈[1,2]
1 1
f′(x)= , f′′(x)
𝑥 𝑥2
19 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
∣f′′(x)∣≤1
(2−1)3 ) 1
ET≤ 12.52
x ⋅1= 300
≈0.0033
3
1. Approximate the integral 𝐼 = ∫1 √𝑥𝑑𝑥 using the Trapezoidal
Rule with 2 subintervals, and estimate the truncation
error.
21
2. Estimate the integral I= ∫1 𝑥
dx using the Trapezoidal Rule
with 4 subintervals, and compare your result to the exact
value ln(2).
3. Use the Trapezoidal Rule with n=4 subintervals to
2
approximate ∫0 𝑥 3 𝑑𝑥 Then estimate the truncation error.
20 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
0.3025
21 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Observation:
22 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Learning Objectives:
Overview
23 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
I. Newton’s Method
𝑥³ + 𝑥 = 4 and 𝑥³ − 3𝑥 + 1 = 0
24 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
2.The point where the tangent line crosses the x-axis is easy to
determine. Consider the first approximation x₁. The tangent line
at (x₁, f(x₁)) is,
x₂ = x₁ - f(x₁) / f'(x₁)
25 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
𝑓(𝑥𝑛)
X n+1=x n-𝑓′ (𝑥𝑛), provide 𝑓 ′ (𝑥𝑛) ≠0 for n=0,1,2, ….
EXAMPLE 1:
1.Approximate a solution of x³ - 3x + 1 = 0.
Solution:
f(x) = x³ - 3x + 1
f'(x) = 3x² - 3
From the graph, we can see there's a root between 0 and 1. Let's
choose x₀ = 0.5.
x₁ = x₀ - f(x₀) / f'(x₀)
26 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
x₂ = x₁ - f(x₁) / f'(x₁)
x₂ ≈ 0.347222
n 𝑥𝑛 𝑥𝑛 𝐷𝑛 𝑋𝑛+1
0 0.500000 -0.375000 -2.250000 0.333333
1 0.333333 -0.018519 -2.666667 0.347222
2 0.347222 0.000101 -2.638889 0.347296
3 0.347296 0.000000 -2.638753 0.347296
7.Conclusion:
Example 2:
Solution:
27 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Graphing y=𝑥 3 −x−1 helps visualize the function and estimate where
it crosses the x-axis (the root).
From the graph, we can see there's a root between x=1 and x=1.5.
Let's choose x 0=1.5.
𝑓(𝑥𝑛) 𝑥 3 𝑛−𝑥𝑛−1
X n+1=x n-𝑓′ (𝑥𝑛) = xn- 3𝑥 2 𝑛−1
≈1.32520
≈1.32472
28 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
7.Conclusion:
Example 3:
Solution:
Let f(x)=cos(x)−x.
From the graph, the root appears to be between x=0.5 and x=1.0.
Let's choose x 0=0.5 radians.
𝑓(𝑥𝑛) 𝑐𝑜𝑠(𝑥𝑛)−𝑥𝑛
X n+1=x n-𝑓′ (𝑥𝑛) = x n− 𝑠𝑖𝑛(𝑥𝑛)−1
𝑓(𝑥𝑛) 𝑐𝑜𝑠(0.5)−0.5
x₁=x 0 -𝑓′ (𝑥𝑛) =0.5− 𝑠𝑖𝑛(0.5)−1
≈0.5- 0.87758−0.5/−0.47943−1 =0.5−
0.37758/−1.47943 ≈ 0.75522
𝑓(𝑥1) 𝑐𝑜𝑠(0.75522)−0.75522
x₂=x₁− ≈0.75522− ≈0.75522−0.72799−0.75522/0.75522≈0
𝑓′ (𝑥1) 𝑠𝑖𝑛(0.75522)−1
𝑓(𝑥2) 𝑐𝑜𝑠(0.73914)−0.73914
x₃=x₂− ≈0.73914− ≈0.73914− 0.73904−0.73914/
𝑓′ (𝑥2) 𝑠𝑖𝑛(0.73914)−1
𝑓(𝑥3) 𝑐𝑜𝑠(0.73908)−0.73908
x₄= x₃ −𝑓′ (𝑥3)≈0.73908− 𝑠𝑖𝑛(0.73908)−1
≈0.73908 − 0.00000/−1.67361
≈0.73908
30 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
7.Conclusion:
EXERCISE PROBLEMS:
1. 𝑥³ + 𝑥 − 8 = 0 on [0,4]
2. 𝑥⁴ + 𝑥 − 10 = 0 on [−6, −2]
3. 𝑥² − 2𝑥 − 7 = 0 on [2,8]
4. 5𝑒 𝑥 + sin 𝑥 − 9 = 0 on [0,2]
31 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
EXAMPLE 1:
Solution:
f(x) = x² - 3x – 2
32 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Let x₀ = 3 and x₁ = 4
5.Calculate x₂:
x₂ = 4 - (2) * (4 - 3) / (2 - (-2))
x₂ = 4 - 2 / 4
x₂ = 4 - 0.5
x₂ = 3.5
x₃ ≈ 3.5556
33 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
n 𝑥𝑛−1 𝑥𝑛 𝑁𝑛 𝐷𝑛 𝑥𝑥+1
1 3.0000 4.0000 2.0000 4.0000 3.5000
2 4.0000 3.5000 -0.1250 -2.2500 3.5556
3 3.5000 3.5556 0.0030 -0.1111 3.5615
4 3.5556 3.5615 -0.0001 -0.0028 3.5616
5 3.5615 3.5616 0.0000 -0.0001 3.5616
8.Conclusion:
Example 2:
Solution:
f(x)= x₃ +x−1
34 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
5.Calculate x 2:
f(x₀)=−1
f(x₁)=1
x₁−x₀
x₂ = x₁ −f(x₁)𝑓(x₁)−𝑓(x0 )=1−(1) 1−0/1−(−1)=1− 1/2 =0.5
x₂−x₁
x³ = x₂ −f(x₂)𝑓(x₂)−𝑓(x₁)=0.5−(−0.375) 0.5−1/−0.375−1 =0.5+0.375 --
0.5/-1.375≈0.5+0.13636...=0.63636...
f(x₃)≈(0.636)³ +0.636−1≈0.257+0.636−1=−0.107
x ₃−x₂
x₄= x ₃−f(x ₃)𝑓(x ₃)−𝑓(x₂)≈0.636−(−0.107) 0.636−0.5/−0.107−(−0.375)
f(x₄)≈ (0.690)³+0.690−1≈0.329+0.690−1=0.019
x 4−x3
x 5=x 4−f(x4)𝑓(x 4)−𝑓(x3)≈0.690−(0.019)0.690−0.636/0.019−(−0.107)
=0.690−0.019 0.054/0.126≈0.690−0.008=0.682
35 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
x 5−x4
x 6=x 5−f(x 5)𝑓(x 5)−𝑓(x4)≈0.682−(−0.001)0.682−0.690/−0.001−0.019
=0.682+0.001 −0.008/−0.020≈0.682+0.0004=0.682
8.Conclusion:
Example 3:
Solution:
36 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
5.Calculate x₂:
f(x₀)=−0.28172
f(x₁)=2.73169
x₁−x₀
x₂ = x₁ −f(x₁)𝑓(x₁)−𝑓(x₀) =1.5−(2.73169) 1.5−1/2.73169−(−0.28172)
=1.5−2.73169 0.5/3.01341≈1.5−0.45324=1.04676
37 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
8.Conclusion:
EXERCISE PROBLEMS:
1. 𝑥² = 2 − 5𝑥 on [0,4]
2. 𝑥³ = 4 − 𝑥 on [2,1]
3. 𝑥² + 6𝑥 − 3 = 0 on [−5, −7]
4. 𝑒 𝑥 + 7𝑥 − 6 = 0 on [1,8]
38 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
39 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Example 1:
Problem:
Use the incremental search method to estimate the root of the
equation
f(x)=cosx−x
f(x)=cosx−x
f(x)=cosx−x
40 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
x cosx f(x)=cosx−x
41 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
• At x= 0.7 f(0.7)=0.0648>0
• At x = 0.8, f(0.8)=−0.1033<0
There is a sign change between 0.7 and 0.8, so the root lies in
[0.7,0.8]
x cosx f(x)=cosx−x
o At x=0.73f(0.73)=0.0109>0
o At x=0.74, f(0.74)=−0.0074<0
42 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Step 7: Refine with Δx=0.001 in [0.73,0.74]
cosx f(x)=cosx−x
x
At x=0.741, f(0.741)≈−0.0000
43 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
0.741
Sample Problem 2
Problem:
Use the incremental search method to estimate the root of the
equation f(x)=x2−3x+2 in the interval. Approximate the root to
three decimal places.
f(x)=x2−3x+2
44 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Step 3: Evaluate
x f(x)=x2−3x+2
02−3(0)+2=2
0.0
0.01−0.3+2=1.71
0.1
0.04−0.6+2=1.44
0.2
0.09−0.9+2=1.19
0.3
0.16−1.2+2=0.96
0.4
0.25−1.5+2=0.75
0.5
0.36−1.8+2=0.56
0.6
45 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
0.64−2.4+2=0.24
0.8
0.81−2.7+2=0.11
0.9
1−3+2=0
1.0
1.21−3.3+2=−0.09
1.1
1.44−3.6+2=−0.16
1.2
1.69−3.9+2=−0.21
1.3
1.96−4.2+2=−0.24
1.4
2.25−4.5+2=−0.25
1.5
2.56−4.8+2=−0.24
1.6
46 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
2.89−5.1+2=−0.21
1.7
3.24−5.4+2=−0.16
1.8
3.61−5.7+2=−0.09
1.9
4−6+2=0
2.0
47 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
x f(x)
1.90 -0.09
1.91 -0.07
1.92 -0.05
1.93 -0.03
1.94 -0.01
1.95 0.01
1.96 0.03
48 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
x f(x)
1.940 -0.010
1.941 -0.009
1.942 -0.008
1.943 -0.007
1.944 -0.006
1.945 -0.005
1.946 -0.004
1.947 -0.003
1.948 -0.002
1.949 -0.001
1.950 0.000
49 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Answer:
1.950
EXERCISE PROBLEMS:
f(x)=x2−2f(x)=x2−2
50 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
51 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Overview
52 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Fourier Series
↓
separation of two “matching” points on the graph
↓
Positive number called the
period of f(x)
53 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
f x + P = 𝑓(𝑥)
f x + 2𝜋 = sin (x + 2π)
𝑓 −𝑥 = −𝑓(𝑥)
𝑓 −𝑥 = 𝑓(𝑥)
𝑁𝑜𝑡𝑒:
sin 𝑥 ( 𝑜𝑑𝑑 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛)
54 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
𝑓 (𝑥 ) = 𝑎0 + ∑∞
𝑛=1(𝑎𝑛 cos 𝑛𝑥 + 𝑏𝑛 𝑠𝑖𝑛𝑥 )
↓ ↓ ↓
1 π 1 π 1 π
∫ 𝑓(𝑥)𝑑𝑥
2𝜋 −π
∫ 𝑓(𝑥)𝑐𝑜𝑠
2𝜋 −π
𝑛𝑥 𝑑𝑥 , ∫ 𝑓(𝑥)𝑠𝑖𝑛
2𝜋 −π
𝑛𝑥 𝑑𝑥 ,
Where:
(𝑎0, 𝑎𝑛 and 𝑏𝑛 )
“FOURIER CONFIDENTS”
55 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Example 1:
Find the Fourier series of the function f(x) = x2, –𝜋 < x < 𝜋.
Solution:
Let us find the values of the real numbers a0, an, and bn. The
period of the given function is 2𝜋, then,
1 𝜋 1 𝜋
𝑎0 = 𝜋 ∫−𝜋 𝑓(𝑥)𝑑𝑥 = 𝜋 ∫−𝜋 𝑥 2 𝑑𝑥
1 𝑥3 2𝜋2
= 𝜋 [ 3 ]𝜋−𝜋 = 3
⇒ a0 = 2𝜋2/3.
𝑎
1 𝜋 2 𝜋 2 𝑎 2 ∫ 𝑓(𝑥)𝑑𝑥 , 𝑤ℎ𝑒𝑛𝑓 𝑖𝑠 𝑎𝑛 𝑒𝑣𝑒𝑛 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛
𝑎𝑛 = ∫ 𝑓(𝑥)𝑐𝑜𝑠𝑛𝑥𝑑𝑥
𝜋 −𝜋
= ∫ 𝑥 𝑐𝑜𝑠𝑛𝑥𝑑𝑥 [∫−𝑎 𝑓(𝑥)𝑑𝑥
𝜋 0
={ 0 ]
0 , 𝑤ℎ𝑒𝑛𝑓 𝑖𝑠 𝑎𝑛 𝑜𝑑𝑑 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛
4(−1)𝑛
= 𝑛2
[∵ 𝑠𝑖𝑛𝑛𝜋 = 0𝑎𝑛𝑑𝑐𝑜𝑠𝑛𝜋 = (−1)𝑛 ]
4
− 2 , 𝑤ℎ𝑒𝑛𝑛𝑖𝑠𝑜𝑑𝑑
⇒ 𝑎𝑛 = { 4𝑛
𝑛2
, 𝑤ℎ𝑒𝑛𝑛𝑖𝑠𝑒𝑣𝑒𝑛
∴ bn = 0.
∞
𝜋2 4(−1)𝑛
𝑥2 = 3
+∑ 2 𝑐𝑜𝑠𝑛𝑥 + ∑∞
𝑛=1 0. 𝑠𝑖𝑛𝑛𝑥
𝑛=1 𝑛
𝜋2 1 1
𝑥2 = 3
+ 4[−𝑐𝑜𝑠𝑥 + 4 𝑐𝑜𝑠2𝑥 − 9 𝑐𝑜𝑠3𝑥 + ⋯ ]
56 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Example 2:
Solution:
1 𝑒 𝑎𝑥 𝜋 1 𝑒 𝑎𝜋 −𝑒 −𝑎𝜋 2𝑠𝑖𝑛ℎ𝑎𝜋
= 𝜋[ ]
𝑎 −𝜋
= 𝜋[ 𝑎
] = 𝑎𝜋
1 𝜋 1 𝜋
𝑎𝑛 = 𝜋 ∫−𝜋 𝑓(𝑥)𝑐𝑜𝑠𝑛𝑥𝑑𝑥 = 𝜋 ∫−𝜋 𝑒 𝑎𝑥 𝑐𝑜𝑠𝑛𝑥𝑑𝑥
Similarly,
1 2𝑛(−1)𝑛 .𝑠𝑖𝑛ℎ𝑎𝜋
𝑏𝑛 =
𝜋 (𝑎 2 +𝑛2 )
∞ ∞
𝑠𝑖𝑛ℎ𝑎𝜋 2𝑎(−1)𝑛 𝑠𝑖𝑛ℎ𝑎𝜋 2𝑛(−1)𝑛 𝑠𝑖𝑛ℎ𝑎𝜋
∴ 𝑒 𝑎𝑥 = 𝑎𝜋
+∑ 𝜋(𝑎 2 +𝑛2 )
𝑐𝑜𝑠𝑛𝑥 +∑ 𝜋(𝑎 2 +𝑛2 )
𝑠𝑖𝑛𝑛𝑥
𝑛=1 𝑛=1
Example 3:
57 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
58 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
59 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Example 1:
Solution:
Fourier Series Form:
f(x) = a₀/2 + Σ [aₙ cos(nx) + bₙ sin(nx)], n=1 to ∞
For a₀:
a₀ = (1/π) ∫[from -π to π] x² dx
= (1/π) * [x³/3] from -π to π
= (1/π) * (π³/3 - (-π)³/3) = 2π²/3
For aₙ:
aₙ = (1/π) ∫[from -π to π] x² cos(nx) dx
Using integration by parts:
Let u = x², dv = cos(nx) dx
Then du = 2x dx, v = (1/n) sin(nx)
60 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
61 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Example 1:
Solution:
For a₀:
a₀ = (1/2L) ∫[-L to L] f(x) dx = (1/6)[(-1)(3) + (1)(3)] = 0
For aₙ:
aₙ = (1/L) ∫[0 to 3] cos(nπx/3) dx - ∫[-3 to 0] cos(nπx/3) dx
Due to the symmetry and nature of cosine being even, this integral
evaluates to zero:
aₙ = 0
For bₙ:
bₙ = (1/L) ∫[0 to 3] sin(nπx/3) dx - ∫[-3 to 0] (-sin(nπx/3)) dx
This gives: bₙ = (2/3) ∫[0 to 3] sin(nπx/3) dx
= (2/3) * [(-3/nπ)(cos(nπx/3))] evaluated from 0 to 3
= (2/3) * (-3/nπ) [cos(nπ) - cos(0)] = (-2/nπ)(cos(nπ) - 1)
= (4/nπ) if n is odd, and 0 if n is even
62 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Example 2:
Solution:
Final Answer:
f(x) = Σ [2(−1)ⁿ⁺¹/n] sin(nx)
Example 3:
Solution:
Step 1: Compute a₀
a₀ = (1/) ∫[0 to ] xdx = /2
Step 2: Compute aₙ
aₙ = (1/) ∫[0 to ] x cos(nx) dx (using integration by parts)
= (1/) * (1 - (−1)ⁿ)/n²
= 0 for even n, 2/(n²) for odd n
Step 3: Compute bₙ
bₙ = (1/) ∫[0 to ] xsin(nx)dx
= (−1)ⁿ⁺¹/n
63 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Final Answer:
Exercises:
Find the Fourier series of the following functions over [−,]:
1. f(x) = x²
2. f(x) = |x|
3. f(x) = {-1,- < x < 0 ; 1,0 < x < }
4. f(x) = { + x,- < x < 0 ; - x,0 < x < }
5. f(x) = sin(x) for 0 < x < (find sine and cosine series
separately)
64 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Example 1:
Solution:
For a₀:
a₀ = (1/2L) ∫[-L to L] f(x) dx = (1/6)[(-1)(3) + (1)(3)] = 0
For aₙ:
aₙ = (1/L) ∫[0 to 3] cos(nx/3)dx - ∫[-3 to 0] cos(nx/3)dx
65 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
For bₙ:
bₙ = (1/L) ∫[0 to 3] sin(nx/3)dx - ∫[-3 to 0] (-sin(nx/3))dx
This gives:
Example 2:
Solution:
Let L = π. This is an even function, so we use only cosine terms.
For a₀:
a₀ = (1/π) ∫ from -π to π of |x| dx = (2/π) ∫from 0 to π of x dx
= π
For aₙ:
aₙ = (2/π) ∫ from 0 to π of x cos(nx) dx
= (2/π) * [x sin(nx)/n + cos(nx)/n²] from 0 to π
= (2/π) * [π sin(nπ)/n + (cos(nπ) - 1)/n²] = (2/π) * (0+((-1)^n
- 1)/n²)
66 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Final Answer:
f(x) = π/2 + Σ [2((-1)^n - 1)/(π n²)] cos(nx), n = 1 to ∞
Example 3:
Solution:
Let L = π. This is an even function, so only cosine terms appear.
For a₀:
a₀ = (1/π) ∫ from -π to π of x²dx = (2/π) ∫ from 0 to π of x² dx
= (2/π)*(π³/3) = (2π²)/3
For aₙ:
aₙ = (1/π) ∫ from -π to π of x² cos(nx)dx
Final Answer:
f(x) = (π²/3) + Σ [4*(-1)^n / n²] cos(nx), n = 1 to ∞
67 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Exercises
1. f(x) = x³ on [0,1]
2. f(x) = x on [−2,2]
3. f(x) = 1 on [−L,L]
4. f(x) = x² on [0,] (cosine series)
5. f(x) = x( − x) on [0,] (sine series)
68 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Chapter 8: Interpolation
8.1 Interpolation
Learning Objectives:
At the end of the lesson, the students will be able to:
Overview:
69 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
8.1 Interpolation
INTERPOLATION
Formula: f₁(x) = p₁ x + p₂
70 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
EXAMPLE 1:
Solution:
x f(x)
1 2
2 5
4 17
x₁ = 2, f(x₁) = 5
x₂ = 4, f(x₂) = 17
f₁(x) = p₁ x + p₂
2p₁ = 12
71 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
p₁ = 6
2(6) + p₂ = 5
12 + p₂ = 5
p₂ = -7
f₁(x) = 6x - 7
When x = 3:
f₁ (3) = 6(3) - 7 = 18 - 7 = 11
x₁ = 1, f(x₁) = 2
x₂ = 2, f(x₂) = 5
x₃ = 4, f(x₃) = 17
f₂(x) = p₁x² + p₂ x + p₃
72 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
f₂(x) = 1x² + 0x + 1 = x² + 1
When x = 3:
f₂ (3) = 3² + 1 = 9 + 1 = 10
73 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
EXERCISE PROBLEMS:
74 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Estimate the height of the projectile at time 3 seconds using
linear and quadratic interpolation.
Estimate the sales when the price is $18 using linear and quadratic
interpolation.
75 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Learning Objectives:
At the end of this chapter, students will be able to:
Overview:
76 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
NUMERICAL INTEGRATION
Example:
Solution:
I. Trapezoidal Rule
Let 𝑓(𝑥) be continuous on the interval [𝑎, 𝑏]. Consider the figure
below,
77 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
where 𝑛 are the subintervals of [𝑎, 𝑏] and each one has a length
𝑏−𝑎
of 𝑛
.
Taking the two Riemann sums of the two endpoints 𝑥𝑖−1 and 𝑥𝑖,
1 1
2
[∑𝑛𝑖=1 𝑓(𝑥𝑖−1 )∆𝑥𝑖 =1 and ∑𝑛𝑖=1 𝑓(𝑥𝑖 )∆𝑥𝑖 ,] ∑𝑛𝑖=1 2 [𝑓(𝑥𝑖−1 )∆𝑥𝑖 =1 and ∑𝑛𝑖=1 𝑓(𝑥𝑖 )∆𝑥𝑖 ,]
𝑏−𝑎 𝑛
= ∑𝑖=1[𝑓(𝑥𝑖−1 )∆𝑥𝑖 [𝑓(𝑥𝑖−1 ) + 𝑓(𝑥𝑖 )]
2𝑛
𝑏−𝑎
= = 2𝑛
{[ 𝑓 (𝑥0 ) + 𝑓(𝑥1 )] + [𝑓(𝑥1 ) + 𝑓(𝑥2 )] + ⋯ + [𝑓(𝑥𝑛−1 ) + 𝑓(𝑥𝑛 )]}
𝑏−𝑎
= [𝑓(𝑎) + 2𝑓 (𝑥𝑖 ) + ⋯ + 2𝑓(𝑥𝑛−1 ) + 𝑓(𝑏)]
2𝑛
Therefore,
𝒃 𝒃−𝒂
∫𝒂 𝐟(𝐱)𝐝𝐱 ≈ 𝟐𝒏
[f(a) + 2f(𝒙𝟏 ) + ⋯ + 2f (𝒙𝒏−𝟏 ) + f(b)]
78 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
EXAMPLE 1:
Solution:
79 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
EXAMPLE 2:
1
Approximate the integral ∫0 √1 + 𝑥 2 using the trapezoidal rule
with n=4.
SOLUTION:
𝑏−𝑎 1
a=0,b=1,n=4, =4=0.25
𝑛
80 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
f(0)= √1 + 02 =1.0000
2 f(0.25)=2√1 + 0.0625=2(1.0308)=2.0616
2 f(0.25)=2√1 + 0.25=2(1.1180)=2.2360
=1.0000+2.0616+2.2360+2.5496+1.4142=9.2614
𝑏−𝑎 1
T≈ .sum8.9.2614≈1.1577
2𝑛
4.Exact value:
1
∫0 √1 + 𝑥 2 𝑑𝑥 ≈1.1478
Relative Error:
[1.1577−1.1478]
RE= ≈ 0.0086
1.1478
81 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
EXAMPLE 3:
3
Approximate the integral ∫1 ln(𝑥 + 1)𝑑𝑥 using the trapezoidal
rule with n=4
SOLUTION:
𝑏−𝑎 2
a=1,b=3,n=4, =4=0.5
𝑛
f(1)= ln(2)=0.6931
2 f(1.5)=2 ln(2.5)=2(0.9163)=1.8326
2 f(2.0)=2 ln(3)=2(1.0986)=2.1972
2 f(2.5)= 2 ln(3.5)=2(1.2528)=2.5056
f(3)= ln(4)=1.3863
=0.6931+1.8326+2.1972+2.5056+1.3863=8.6148
𝑏−𝑎 2
T≈ .sum8x8.6148=0.25x8.6148 ≈2.1537
2𝑛
82 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
4.Exact value:
3
∫1 ln(𝑥 + 1)𝑑𝑥 ≈2.1462
Relative Error:
[2.1537−2.1462]
RE= ≈ 0.0035
2.1462
83 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Then,
∆𝑥
𝐴 = ∫−∆𝑥𝑖 (A𝑥 2 + Bx + C) dx
𝑖
𝐴 𝐵 2 ∆𝑥𝑖
= [3 𝑥 3 + 2
𝑥 + 𝐶 𝑥] −∆𝑥𝑖
2𝐴
= ∆𝑥𝑖 3 +2C∆𝑥𝑖
3
𝑓(𝑥1 ) = 𝐶
2𝐴
A = 3
∆𝑥𝑖 3 +2C∆𝑥𝑖
∆𝑥𝑖
= 3
[𝑓 (𝑥𝑖−1 ) + 𝑓 (𝑥𝑖+1 ) − 2𝑓 (𝑥𝑖 ] + 2𝑓 (𝑥𝑖 )∆ 𝑥𝑖
1 1 4
=∆ 𝑥𝑖 [3𝑓(𝑥𝑖−1) + 3
𝑓(𝑥𝑖+1 )) + 3
𝑓(𝑥𝑖 )]
84 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
∆𝑥𝑖
= 3
[𝑓 (𝑥𝑖−1 ) + 𝑓 (𝑥𝑖+1 ) + 4 𝑓 (𝑥𝑖 )]
𝑏−𝑎
Since ∆ ( 𝑥𝑖 = 𝑛
, then,
𝑏−𝑎
𝐴 = 𝑛
[𝑓 (𝑥𝑖−1) + 𝑓 (𝑥𝑖+1 ) + 4 𝑓 (𝑥𝑖 )]
𝒃 𝒃−𝒂
∫𝒂 𝐟(𝐱)𝐝𝐱 ≈ 𝒏
[f(a) + 4 𝑓 (𝒙𝒊 )+ 2 f (𝒙𝟐 ) + 4 𝑓 (𝒙𝒏−𝟏 )] + ⋯ + 𝑓 (𝒙𝒏−𝟐 )
+ + 4 𝑓 (𝒙𝒏−𝟏 )+ f(b)]
EXAMPLE 1:
Solution:
85 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
-4f(x₃) = 4f(5/2) = 4((5/2)³ - 2(5/2) + 1) = 4(125/8 - 5 + 1) =
4(125/8 - 4) = 4(93/8) = 93/2 = 46.5
86 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
EXAMPLE 2:
3
1. Approximate the integral ∫0 (1 + 𝑥 2 )𝑑𝑥 using the simpson’s
rule. Use with n=6.
SOLUTION:
1.Interval:
𝑏−𝑎 3
a=0,b=3,n=6,∆𝑥= = = 0.5
𝑛 6
Partition:
Function:
f(x)= 1 + 𝑥 2
2.Compute:
f(0)= 1
4 f(0.5)=4(1+0.25)=4(1.25)=5.0000
2 f(1)=2(1+1)=2(2)=4.0000
4 f(1.5)= 4(1+4)=2(3.25)=13.0000
4 f(2.5)= 4(1+6.25)=4(7.25)=29.0000
f(3)= 1+9=10.0000
87 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
3.Sum:
Sum:1+5+4+13+10+29+10
=72
𝑏−𝑎 3 1
Multiply by = 18=
𝑛 6
3 1
∫0 (1 + 𝑥 2 )𝑑𝑥 ≈ 6 (72)
=12.0000
EXAMPLE 2:
2
2. Approximate the integral ∫1 𝑙𝑛(𝑥 + 1)𝑑𝑥 using the simpson’s
rule. Use with n=6.
SOLUTION:
1.Interval:
1
a=1,b=2,n=6,∆𝑥= = 0.1667
6
Partition:
Function:
f(x)= 𝑙𝑛(𝑥 + 1)
88 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
2.Compute:
f(1)= ln(2)≈0.6931
4 f(1.5)= 4xln(2.5)=4(0.9163)=3.6652
2 f(1.6667)=2xln(2.6667)= 2(0.9808)=1.9616
4 f(1.8333) ≈ 4xln(2.8333)=4(1.0413)=4.1652
f(2)= ln(3)≈1.0986
3.Sum:
Sum: 0.6931+3.0880+1.6946+3.6652+1.9616+4.1652+1.0986
=16.3663
𝑏−𝑎 1
Multiply by = 18
3𝑛
2 1
∫1 𝑙𝑛(𝑥 + 1)𝑑𝑥 ≈ 18(16.3663)
=0.9092
89 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
where 𝑛 are the subintervals of [𝑎, 𝑏] and each one has a length
𝑏−𝑎
of 𝑛
.
Then,
Thus,
90 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
EXAMPLE 1:
Solution:
91 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
4.Add the results and multiply by (b-a)/n: The sum is 0.8 + 0.5714
+ 0.4444 + 0.3636 + 0.3077 + 0.2667 ≈2.7538 (b-a)/n = (4-1)/6 =
3/6 = 1/2
92 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
EXAMPLE 2:
2 2
1.Approximate the integral ∫0 𝑒 −𝑋 𝑑𝑥 using the midpoint rule.
Use n=6.
SOLUTION:
𝑏−𝑎 2 1
1.a=0,b=2,n=6,so ∆𝑥= =6=3
𝑛
Partition:
2.Compute:
𝑥0+𝑥1 1 2
1
f( )= f(6)= 𝑒 −(6) ≈ 0.9862
2
𝑥1+𝑥2 1
f( )= f(2)= 𝑒 −0.25 ≈ 0.7788
2
𝑥2+𝑥3 5
f( )= f(6)= 𝑒 −0.6944 ≈ 0.4994
2
𝑥3+𝑥4 7
f( )= f(6)= 𝑒 −1.3611 ≈ 0.2563
2
𝑥4+𝑥5 11
f( )= f( )= 𝑒 −3.3611 ≈ 0.0347
2 6
𝑥5+𝑥6 17
f( )= f( 6 )= 𝑒 −8.0278 ≈ 0.0003
2
1
3.Add and Multiply by ∆𝑥= 3 :
=2.5557
93 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
2 2 1
∫0 𝑒 −𝑋 𝑑𝑥 ≈ 3
x2.5557 = 0.8519
Relative Error:
0.8821−0.8519
RE= ≈ 𝟎. 𝟎𝟑𝟒𝟐
0.8821
EXAMPLE 3:
3
2.Approximate the integral ∫1 ln (𝑥 2 + 1) 𝑑𝑥 using the midpoint
rule. Use n=6.
SOLUTION:
2 1
1.a=1,b=3,n=6,so ∆𝑥= 6 = 3
Partition:
Midpoint:
94 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
2.Compute:
7 7
f(6)=ln((6)2+1)=ln(1.3611+1) ≈ln(2.3611)≈ 0.8594
3
f(2)= ln(3.25)≈ 1.1787
11
f( 6 )=ln(1.3611+1)=ln(3.3611) ≈ln(2.3611)≈ 1.2123
13
f( 6 )= ln(3.6944)≈ 1.3075
5
f(2)= ln(7.25)≈ 1.9810
17
f( 6 )= ln(9.3611)≈ 2.2375
3.Sum:
Sum = 0.8594+1.1787+1.2123+1.3075+1.9810+2.2375
=8.7764
1
Multiply by :
3
3 1
∫1 ln (𝑥 2 + 1) 𝑑𝑥 ≈ 3(8.7764)= 2.9255
95 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
EXERCISE PROBLEM:
3
1. ∫0 (1 − x) ⁴dx, use trapezoidal method, n=8
2
2. ∫1 x (2x² − 4) dx, use midpoint rule, n=2
2
3. ∫0 sin x cos x dx use Simpson’s rule, n=9
0
4. ∫−2 𝑥 2𝑥 dx, use midpoint rule, n=5
7
5. ∫3 x e³dx, use midpoint rule, n=7
96 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
REFERENCES
97 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE
Zill, D. G., & Wright, W. S. (2017). Advanced
Engineering Mathematics (6th ed.). Jones & Bartlett
Learning.
Cengage Learning.
98 | P a g e