0% found this document useful (0 votes)
8 views98 pages

Advanced Engineering Mathematics Finals Proj

The document is a workbook for Advanced Engineering Mathematics aimed at Mechanical Engineering students at Camarines Sur Polytechnic Colleges. It covers essential mathematical concepts and techniques necessary for engineering applications, including numerical methods, error analysis, and Fourier series. The workbook emphasizes a simplified approach to learning advanced mathematics, making it accessible for students and professionals in the engineering field.
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)
8 views98 pages

Advanced Engineering Mathematics Finals Proj

The document is a workbook for Advanced Engineering Mathematics aimed at Mechanical Engineering students at Camarines Sur Polytechnic Colleges. It covers essential mathematical concepts and techniques necessary for engineering applications, including numerical methods, error analysis, and Fourier series. The workbook emphasizes a simplified approach to learning advanced mathematics, making it accessible for students and professionals in the engineering field.
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/ 98

Republic of the Philippines

CAMARINES SUR POLYTECHNIC COLLEGES


Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

ADVANCED ENGINEERING
MATHEMATICS
A Simplified Workbook in Advanced
Mathematics for Engineering for ME

WORKBOOK IN EM 225
ADVANCE ENGINEERING MATHEMATICS FOR ME

BACHELOR OF SCIENCE IN MECHANICAL ENGINEERING

MARK JUNALD P. DELGACO


ROGER JAMES ANDREW ONDING
TYCHE CEDRIC N. PENETRANTE
JHON FELIX TRIUMFANTE
BSME 2B

ENGR. APRIL JOY AGUADO


INSTRUCTOR

1|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Preface

Mathematics is the cornerstone of engineering, providing the


essential tools and techniques necessary for solving complex real-
world problems. From the foundational principles of algebra to the
advanced concepts of calculus, mathematical disciplines form the
backbone of engineering studies. This book, Advanced Engineering
Mathematics, delves into the advanced topics in mathematics that
are crucial for the study of various engineering fields. It offers
a simplified approach to understanding these complex concepts,
making it an invaluable resource for engineering students and
professionals alike.

Mathematics plays a pivotal role in engineering by enabling


the design, analysis, and optimization of structures, systems, and
processes. It provides a precise and concise language for
expressing complex ideas and theories, facilitating effective
communication and collaboration among engineers. Key mathematical
disciplines such as calculus, differential equations, linear
algebra, and probability theory are essential for modeling physical
systems, analyzing circuits, and designing algorithms in
engineering

This book covers advanced topics in mathematics, providing a


comprehensive understanding of the mathematical tools required for
engineering applications. It consists of ten chapters that explore
the basics of advanced engineering mathematics

2|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

By mastering these advanced mathematical concepts, engineers


can develop innovative solutions, enhance system efficiency, and
ensure the reliability of their designs. This book aims to simplify
the learning process, making advanced engineering mathematics
accessible to a wide range of readers.

3|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

ACKNOWLEDGMENTS

We would like to express my sincere gratitude to everyone who


supported me throughout the semester in completing this workbook
for EM 225: Advanced Engineering Mathematics for Mechanical
Engineering.

First and foremost, we are deeply thankful to our course


instructor, ENGR. APRIL JOY AGUADO, whose guidance, patience, and
expertise made understanding complex mathematical concepts much
more accessible and engaging. Your encouragement and insightful
feedback were invaluable in the preparation of this workbook.

We also extend my appreciation to my classmates and friends


for their collaboration, motivation, and helpful discussions that
enriched our learning experience. The teamwork and shared knowledge
truly made a difference.

Special thanks to our family for their unwavering support,


understanding, and encouragement during the busy and challenging
times of this semester. Your belief in me kept me motivated to
persevere.

Lastly, we acknowledge the resources and references that


provided the foundational knowledge and examples used throughout
this workbook. This accomplishment is a collective effort, and we
are grateful to all who contributed to the journry completing this
workbook for EM 225: Advanced Engineering Mathematics for
Mechanical Engineering.

Thank you all.

4|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

MARK JUNALD P. DELGACO


ROGER JAMES ANDREW ONDING
TYCHE CEDRIC N. PENETRANTE
JHON FELIX TRIUMFANTE
Bachelor of Science in Mechanical Engineering
EM 225: Advanced Engineering Mathematics
2nd Semester 2024-2025

Copyright © 2025 by:


MARK JUNALD P. DELGACO
ROGER JAMES ANDREW ONDING
TYCHE CEDRIC N. PENETRANTE
JHON FELIX TRIUMFANTE
Camarines Sur Polytechnic Colleges
Nabua, Camarines Sur

All Rights Reserved. No part of this workbook may be copied,


reproduced, transmitted, or stored in any form or by any means-
whether electronic, mechanical, photocopying, recording, or
scanning-without the prior written consent of the author.

5|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

COURSE OUTLINE

Chapter 5: Numerical Methods: Introduction, Accuracy, Errors

5.1 Numerical Analysis


5.2 Numerical Methods
5.3 Common Ways to Express Error
5.4 Accuracy vs Precision
5.5 Sources of Error
5.6 Truncation Error

Chapter 6: Roots of Equation using Numerical Solution

6.1 Newton’s Method


6.2 Secant Method
6.3 Incremental Search Method

Chapter 7: FOURIER SERIES

7.1 Fourier Series for Periodic Functions of Period 2𝜋


7.2 Fourier Series for a Non-Periodic Function over Range 2𝜋
7.3 Fourier Series over Any Range

Chapter 8: Interpolation

8.1 Interpolation

Chapter 9: Numerical Integration

9.1 Trapeziodal Rule


9.2 Simpson’s Rule
9.3 Midpoint Rule

6|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Chapter 5: Numerical Methods: Introduction, Accuracy,


Errors
5.1 Numerical Analysis
5.2 Numerical Methods
5.3 Common Ways to Express Error
5.4 Accuracy vs Precision
5.5 Sources of Error
5.6 Sources of Truncation Error

Learning Objectives:
At the end of the lesson, the students will be able to:

1. Define numerical analysis and numerical methods.


2. Explain different types of errors encountered in numerical
computations.
3. Differentiate between accuracy and precision.
4. Identify common ways to express error in numerical results.
5. Describe the sources of errors including truncation errors in
numerical methods.

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

5.1 Numerical Analysis

What is Numerical Analysis?


Numerical Analysis is a specialized branch of applied
mathematics that focuses on developing and analyzing algorithms to
obtain approximate solutions to complex mathematical problems.
Unlike exact analytical methods, numerical analysis emphasizes
practical computation, enabling the resolution of problems that
are otherwise difficult or impossible to solve analytically. This
discipline plays a critical role in scientific computing,
engineering, and various fields where mathematical modeling and
simulation are essential.

Key aspects of Numerical Analysis include:

• Formulating mathematical models and translating them into


computational algorithms.
• Estimating errors and ensuring the stability and convergence
of numerical methods.
• Applying techniques such as interpolation, numerical
integration, differentiation, and the solution of
differential equations.
• Utilizing iterative methods for solving systems of linear and
nonlinear equations.

Through these approaches, numerical analysis provides reliable


and efficient tools for approximating solutions, facilitating
decision-making and problem-solving in both theoretical and
practical contexts.

8|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

5.2 Numerical Methods

What are Numerical Methods?


Numerical Methods refer to a collection of systematic
procedures employed to obtain approximate solutions to mathematical
problems through iterative processes or a sequence of computational
steps. These methods are particularly valuable when exact
analytical solutions are either unavailable or impractical to
determine due to the complexity of the problem.

Key characteristics of Numerical Methods include:

• Stepwise Approach: The original problem is transformed into


a series of simpler, manageable steps or repetitive
calculations that progressively lead to an approximate
solution.
• Efficiency and Accuracy: Numerical methods are designed to
provide solutions that are both computationally efficient and
sufficiently accurate for practical purposes.
• Applicability: They are widely used to solve problems
involving differential equations, integrals, linear and
nonlinear systems, optimization, and other complex
mathematical models.
• Error Control: Numerical methods incorporate techniques to
estimate and minimize errors, ensuring the reliability of the
approximations.

In summary, numerical methods serve as essential tools in


applied mathematics and scientific computing, enabling the
resolution of problems that are otherwise too complex for exact
analytical treatment.

9|Page
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

5.3 Common Ways to Express Error

Common Ways to Express Error

o Absolute Error (AE) is the magnitude of the difference


between the approximate value (x’) and the true value
(x), given by |x – x’|.

o Relative Error (RE) is a normalized measure of error,


calculated as the absolute error divided by the true
x – x’ 𝐴𝐸
value(| x
| = |𝑇𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒|). Useful for comparing accuracy

across different scales.

o Percentage Error is the relative error expressed as a


percentage (RE×100), providing an intuitive
understanding of the error’s proportion.

5.4 Accuracy vs Precision

Accuracy vs Precision

In numerical analysis and scientific measurement, it is


essential to distinguish between accuracy and precision, as both
terms describe different aspects of the quality of numerical
results.

Accuracy

• Definition: Accuracy refers to the degree to which a measured


or computed value is close to the true or exact value of the
quantity being measured.

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

• Definition: Precision describes the degree to which repeated


measurements or computations yield values that are close to
each other, regardless of their closeness to the true value.
• Significance: High precision indicates consistency and
repeatability in the results.
• Example: If repeated measurements of a quantity yield values
such as 99.5, 99.6, and 99.4, these results are precise, even
if they are not close to the true value.

5.5 Sources of Error

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:

• Blunders: Gross mistakes or human errors made during the


formulation or implementation of the model, such as incorrect
equations or computational mistakes.

11 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

• Formulation Error: Inaccuracies introduced by making


simplifying assumptions or approximations when developing the
mathematical model. For example, assuming linear behavior
where the actual relationship is nonlinear can lead to
significant errors in the model's predictions137.
• Data Uncertainty: Errors resulting from inaccuracies or
uncertainties in the input data, such as measurement errors,
instrument tolerances, or inherent variability in the
physical system being modeled38.

Modeling errors are often unavoidable but can be minimized by


careful model development, validation, and the use of high-quality
data.

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:

• Round-off Error: This error occurs due to the finite precision


with which computers represent real numbers. Since most real
numbers cannot be represented exactly in digital form, they
are rounded to the nearest representable value, leading to
small discrepancies. These errors can accumulate through
successive arithmetic operations, especially in large or
sensitive computations157.
• Truncation Error: Truncation error arises when an infinite
mathematical process is approximated by a finite one.

• For instance, when an infinite Taylor series is truncated


after a finite number of terms, or when derivatives are
approximated by finite differences, the resulting error is
called truncation error1479. This type of error reflects the

12 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

difference between the exact mathematical solution and its


numerical approximation.

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

5.6 Truncation 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.

This type of error occurs because numerical methods often


involve limiting an infinite series, infinite iterations, or
infinitesimally small steps to a manageable, finite number.

13 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Definition

• Truncation Error is the discrepancy introduced when a process


that ideally requires an infinite number of steps is truncated
to a finite number of steps for practical computation.

Sources of Truncation Error


Truncation error commonly appears in various numerical
approximation methods, including:

• Limiting Infinite Series: When an infinite series (such as a


Taylor or Fourier series) is approximated by summing only a
finite number of terms, the omitted terms contribute to the
truncation error.
• Limiting Iterations: In iterative methods for solving
equations or optimization problems, the process is stopped
after a finite number of iterations rather than continuing
until exact convergence, resulting in truncation error.
• Finite Step Size: In numerical differentiation and
integration, the use of a finite step size instead of an
infinitesimally small step leads to truncation error.

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

Truncation error reflects the inherent limitation of


numerical methods in approximating continuous or infinite
processes. It is crucial to balance truncation error with
computational cost by choosing appropriate step sizes, number of
terms, or iterations to achieve desired accuracy without excessive
computation.

Truncating Infinite Series

𝑥 𝑥2 𝑥3 𝑥4
➢ Maclaurin series of 𝑒 𝑥 = 1 + 1!
+ 2!
+ 3!
+ 4!
+⋯

➢ To find the value of 𝑒 𝑥 use the words on the right.

➢ We are limited to using the first four terms since we cannot


utilize infinite terms.

𝑥 𝑥2 𝑥3
➢ Approximate 𝑒 𝑥 by 𝑒 𝑥 = 1 + + +
1! 2! 3!

𝑥 𝑥2 𝑥3 𝑥4 𝑥5
➢ Error in Truncation = 𝑒 𝑥 –( 1!
+ 2! + 3!
)= + 4! 5!
+…

EXAMPLES:

1. Approximate cos(0.5)using its maclaurin series

Maclaurin series For Cos(x):


𝑥 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

Truncate after 3 nonzero terms:

𝑥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

Compare to actual value:

cos(0.5)≈0.87758256

Error ≈ ∣0.87760417−0.87758256∣≈0.00002161

Very accurate with just 3 terms!

2. Approximate ln (1.2) using the series for ln (1+x)

Maclaurin series for ln(1+x):


𝑥𝑛 𝑥2 𝑥3 𝑥4
ln (1+x) =∑ (−1)𝑛+1 =𝑥− + − +⋯
𝑛=1 (2𝑛) 2 3 4

Truncate after 4 terms with x=0.2x

(0.2)2 (0.2)3 (0.2)4


ln(1.2)≈0.2− − 2
+ 3
+ 4

=0.2−0.02+0.00266667−0.0004=0.18226667

Compare to actual value:

ln(1.2)≈0.18232156

Error ≈ ∣0.18232156−0.18226667∣≈0.00005489

Again, high accuracy with only 4 terms.

16 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Sample Problem Exercises:

1. Approximate 𝑒 0.5 using the first 4 nonzero terms of the


Maclaurin series for 𝑒 𝑥 .
2. Approximate sin(0.2) using the first 3 nonzero terms of the
Maclaurin series for sin(x).
3. Approximate cos(0.3) using the first 3 nonzero terms of its
Maclaurin series.
4. Use the Maclaurin series for ln(1+x) to approximate
ln(1.3).
Use the first 4 nonzero terms. (Hint: Let x=0.3)
5. Find the degree-4 Maclaurin polynomial of the function
1
f(x)=
1+𝑥
Then use it to approximate f(0.2).

Truncating Error Integration

Truncation error in integration is the difference between the


exact value of a definite integral and its approximate value
obtained using a numerical integration method such as the
Trapezoidal Rule, Simpson’s Rule, or other quadrature formulas.

Let:

𝑎
I= ∫𝑏 𝑓(x)dx(exact value)

I approx = numerical approximation

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:

• Truncation error arises because numerical integration methods


replace the curve of the function with simpler geometric
shapes (like trapezoids or parabolas).

• The higher the order of the approximation and the smaller the
step size (Δx or h), the smaller the truncation error
typically is.

Example:

Use the Trapezoidal Rule with n = 5n subintervals to


approximate the integral

2
∫1 ln(𝑥)𝑑𝑥

Then, estimate the truncation error, and compare it to the


exact value.

We need:

2
∫1 ln(𝑥)𝑑𝑥

Use integration by parts or a calculator:

∫ 𝑙𝑛 (𝑥)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

The error in the Trapezoidal Rule is:

(𝑏−𝑎)3 )
ET=− 12𝑛2
f′′(ξ),for some ξ∈[1,2]

We compute the second derivative of f(x)=ln(x):

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

So, maximum ∣f′′(x)on[1,2] is at 1x=1:

∣f′′(x)∣≤1

(2−1)3 ) 1
ET≤ 12.52
x ⋅1= 300
≈0.0033

Sample Exercises Problem:

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.

4. . Use Simpson’s Rule with n=6 subintervals to approximate


𝜋
∫0 (𝑠𝑖𝑛𝑥)𝑑𝑥 Then estimate the truncation error.
5. Use the Trapezoidal Rule with n=4 subintervals to
1
approximate ∫0 𝑥 2 dx Then estimate the truncation error using
the appropriate formula.

20 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Truncation Error in Differentiation

What Is Truncation Error in Differentiation?

When using numerical methods to approximate derivatives (like


forward, backward, or central difference), we truncate an infinite
Taylor series. The difference between the exact derivative and the
approximation is called the truncation error.

➢ If we repeat the same procedure with ℎ reduced to 0.05, the


estimate that is achieved is

𝑓 (2.05)−𝑓(0.2) 2.053 −23


𝑓 ➢ = = = 12.3025 giving an absolute error of
0.5 0.05

0.3025

21 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Observation:

The truncation mistake

o Occurs because the problem is being solved using a numerical


approximation method.

o Occurs primarily when the procedure is truncated to a limited


number of steps.

o The truncation error diminishes when the step size is reduced.

o Step size reduction and step count increase.

22 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Chapter 6: Roots of Equation using Numerical Solution

6.1 Newton’s Method


6.2 Secant Method
6.3 Incremental Search Method

Learning Objectives:

At the end of the lesson, the students will be able to:

• Define what a numerical method is in the context of solving


equations.
• Apply and compare Newton’s Method, Secant Method, and
Incremental Search Method to solve for roots of nonlinear
equations.
• Analyze the advantages and limitations of each method.

Overview

This chapter introduces numerical methods for finding the


roots of equations-values of x that satisfy f(x)=0. Analytical
solutions are often unavailable for complex or higher-order
equations, making numerical techniques essential in engineering,
science, and applied mathematics. The focus will be on three
primary methods: Newton’s Method, the Secant Method, and the
Incremental Search Method. Each method provides a systematic,
iterative approach to approximate solutions when exact answers are
difficult or impossible to obtain analytically.

23 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

6.1 Newton’s Method

I. Newton’s Method

algebraic manipulations are sufficient for solving linear


equations. Quadratic equations, while slightly more complex, can
be solved using the well-known quadratic formula. However, when
dealing with equations involving polynomials of degree three or
higher, or those containing transcendental functions (like
trigonometric, exponential, or logarithmic functions), finding
precise, analytical solutions becomes significantly difficult, if
not entirely impossible. This is where numerical methods, like
Newton's Method, become essential.

Such equations are,

𝑥³ + 𝑥 = 4 and 𝑥³ − 3𝑥 + 1 = 0

There are techniques for approximating solutions and one of


them is the Newton’s Method, also known as Newton-Raphson Method.

Consider a function 𝑦 = 𝑓(𝑥) and its graph as shown below,

24 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

where x₁ is the first approximation, x₂ is the second, x₃ is the


third and so on. Newton's Method are based on,

1. If f is differentiable at x , then the tangent line at (


x ,y ), can be used to approximate the values of f near x.

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,

y - f(x₁) = f'(x₁) (x - x₁)

Consider x₂ the point where the tangent line crosses the x-


axis, when x = x₂ and y = 0, thus,

0 - f(x₁) = f'(x₁) (x₂ - x₁)

x₂ = x₁ - f(x₁) / f'(x₁)

Now, let x₂ be the second approximation and repeat the


process, we find, x₃ = x₂ - f(x₂) / f'(x₂)

For the fourth approximation, fifth approximation and so on,


the process are the same, therefore, for nth approximation, we
have,

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:

1.Set f(x) and f'(x):

f(x) = x³ - 3x + 1

f'(x) = 3x² - 3

2.Graph the function (optional but helpful):

You can use a graphing calculator or software to visualize


the function and estimate where it crosses the x-axis. This will
help you choose a good initial approximation.

3.Choose an initial approximation (x₀):

From the graph, we can see there's a root between 0 and 1. Let's
choose x₀ = 0.5.

4.Apply Newton's method formula:

x₁ = x₀ - f(x₀) / f'(x₀)

x₁ = 0.5 - (0.5³ - 3(0.5) + 1) / (3(0.5) ² - 3)

x₁ = 0.5 - (-0.375) / (-2.25)

x₁ = 0.5 - 0.166667 ≈ 0.333333

26 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

5.Continue the iterations:

x₂ = x₁ - f(x₁) / f'(x₁)

x₂ = 0.333333 - (0.333333³ - 3(0.333333) + 1) / (3(0.333333) ² -


3)

x₂ ≈ 0.347222

6.Create a table of iterations:

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:

x₃ and x₄ are the same to six decimal places (0.347296). Therefore,


the approximate solution of x³ - 3x + 1 = 0 is 0.347296. Thus, the
positive solution of x³ - 3x + 1 = 0 is approximately 0.347296.

Example 2:

Approximate a solution of x 3−x−1=0.

Solution:

1.Set f(x) and find f ′(x):

Let f(x)=x 3−x−1.

Then the derivative is f ′ (x)=3𝑥 2 −1.

27 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

2.Graph the function (optional but helpful):

Graphing y=𝑥 3 −x−1 helps visualize the function and estimate where
it crosses the x-axis (the root).

3.Choose an initial approximation (x 0):

From the graph, we can see there's a root between x=1 and x=1.5.
Let's choose x 0=1.5.

4.Apply Newton's method formula:

𝑓(𝑥𝑛) 𝑥 3 𝑛−𝑥𝑛−1
X n+1=x n-𝑓′ (𝑥𝑛) = xn- 3𝑥 2 𝑛−1

5.Continue the iterations:

𝑓(𝑥0) (1.5)3 −1.5−1 0.875


x₁=x 0−𝑓′ (𝑥0)=1.5−−1=1.5− 3(1.5)2 −1
=1.5- 5.75 ≈1.34783

𝑓(𝑥1) (1.34783)3 −1.34783−1


x₂=x₁− ′ ≈1.34783− ≈1.34783−0.1007/4.4496
𝑓 (𝑥1) 3(1.34783)2 −1

≈1.32520

𝑓(𝑥2) (1.32520)3 −1.32520−1


x₃= x₂− 𝑓′ (𝑥2)
≈1.32520− 3(1.32520)2 −1
≈1.32520−0.00206/4.2685 ≈1.32472

𝑓(𝑥3) (1.32472)3 −1.32472−1


x₄= x₃ − 𝑓 ′ (𝑥3)
≈1.32472 − 3(1.32472)2−1
≈1.32472−0.00000/4.2646

≈1.32472

28 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

6.Create a table of iterations:

n 𝑥𝑛 f(𝑥𝑛 ) f′(𝑥𝑛 ) 𝑋𝑛+1


0 1.50000 0.87500 5.75000 1.34783
1 1.34783 0.10070 4.44961 1.34783
2 1.32520 0.00206 4.26847 1.32472
3 1.32472 0.00000 4.26463 1.32472

7.Conclusion:

The iterations converge quickly. x ₃ and x₄ are the same to


five decimal places (1.32472). Therefore, the approximate solution
of x 3−x−1=0 is approximately 1.32472.

Example 3:

Approximate a solution of cos(x)=x.

Solution:

1.Set f(x) and find f ′(x):

We want to find the root of cos(x)−x=0.

Let f(x)=cos(x)−x.

Then the derivative is f′(x)=−sin(x)−1.

(Note: Calculations must be done in radians)

2.Graph the function (optional but helpful):

Graphing y=cos(x)−x helps visualize the root.


29 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

3.Choose an initial approximation (x 0):

From the graph, the root appears to be between x=0.5 and x=1.0.
Let's choose x 0=0.5 radians.

4.Apply Newton's method formula:

𝑓(𝑥𝑛) 𝑐𝑜𝑠(𝑥𝑛)−𝑥𝑛
X n+1=x n-𝑓′ (𝑥𝑛) = x n− 𝑠𝑖𝑛(𝑥𝑛)−1

5.Continue the iterations:

𝑓(𝑥𝑛) 𝑐𝑜𝑠(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

.75522 −0.02723/−1.68513−0.02723 ≈ 0.73914

𝑓(𝑥2) 𝑐𝑜𝑠(0.73914)−0.73914
x₃=x₂− ≈0.73914− ≈0.73914− 0.73904−0.73914/
𝑓′ (𝑥2) 𝑠𝑖𝑛(0.73914)−1

−0.67365−1 ≈0.73914 − −0.00010/−1.67365 ≈ 0.73908

𝑓(𝑥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

6.Create a table of iterations:

n 𝑥𝑛 f(𝑥𝑛 ) f′(𝑥𝑛 ) 𝑋𝑛+1


0 0.50000 0.37758 -1.47943 0.75522
1 0.75522 -0.02723 1.68513 0.73914
2 0.73914 -0.00010 -1.67365 0.73908
3 0.73908 0.00000 -1.67361 0.73908

7.Conclusion:

The iterations converge rapidly. x₃ and x₄ are the same to


five decimal places (0.73908). Therefore, the approximate solution
of cos(x)=x is approximately x≈0.73908 radians.

EXERCISE PROBLEMS:

Solve the following equations using Newton’s Method.

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

6.2 Secant Method

II. Secant Method

The Secant Method is a numerical technique used to find the


root of a function. It's an alternative to Newton's Method,
especially useful when the derivative of the function is difficult
or impossible to calculate.

Instead of using the derivative, the Secant Method


approximates it using the slope of a secant line between two points
on the function. This approximation is expressed as:

f'(x n) ≈ [ f (x n) - f(xn-1) ] / [ x n - xn-1 ]

This leads to the iterative formula for finding the next


approximation (xn+1):

xn+1 = x n - [ f(x n) * (x n - xn-1) ] / [ f( x n) - f(xn-1) ]

In essence, the Secant Method refines its estimate of the


root by repeatedly finding the x-intercept of the secant line
between the two most recent approximations.

EXAMPLE 1:

1.Find, to four decimal places, the positive root of the equation


x² - 3x - 2 = 0.

Solution:

1.Define the function:

f(x) = x² - 3x – 2

2.Find initial guesses:

Let's try x = 3: f (3) = 3² - 3(3) - 2 = -2

32 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Let's try x = 4: f (4) = 4² - 3(4) - 2 = 2

Since f (3) is negative and f (4) is positive, there's a root


between 3 and 4.

3.Set initial values:

Let x₀ = 3 and x₁ = 4

4.Apply the Secant Method formula:

x₂ = x₁ - f(x₁) * (x₁ - x₀) / (f(x₁) - f(x₀))

5.Calculate x₂:

x₂ = 4 - (2) * (4 - 3) / (2 - (-2))

x₂ = 4 - 2 / 4

x₂ = 4 - 0.5

x₂ = 3.5

6.Continue the iterations: Now, x₁ = 4 and x₂ = 3.5. Repeat the


process.

x₃ = x₂ - f(x₂) * (x₂ - x₁) / (f(x₂) - f(x₁))

x₃ = 3.5 - f(3.5) * (3.5 - 4) / (f(3.5) - f(4)) f(3.5) = 3.5² -


3(3.5) - 2 = 12.25 - 10.5 - 2 = -0.25

x₃ = 3.5 - (-0.25) * (-0.5) / (-0.25 - 2)

x₃ = 3.5 - 0.125 / (-2.25) x₃ = 3.5 + 0.05555...

x₃ ≈ 3.5556

33 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

7.Create a table of iterations:

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:

We see that x₅ and x₄ are the same to four decimal places


(3.5616). Therefore, the positive root of x² - 3x - 2 = 0, to four
decimal places, is 3.5616.

Example 2:

Find, to three decimal places, the positive root of the equation


x₃+x−1=0.

Solution:

1.Define the function:

f(x)= x₃ +x−1

2.Find initial guesses:

Let's try x=0: f(0)= 03 +0−1=−1

Let's try x=1: f(1)= 13 +1−1=1

Since f(0) is negative and f(1) is positive, there's a root between


0 and 1.

34 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

3.Set initial values:

Let x₀ =0 and x₁=1.

4.Apply the Secant Method formula:

xn+1 = x n - [ f(x n) * (x n - xn-1) ] / [ f( x n) - f(xn-1) ]

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

6.Continue the iterations:

Now, x₁=1 and x₂=0.5. Repeat the process.

f(x₂)= (0.5)³ +0.5−1=0.125+0.5−1=−0.375

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...

x ₃≈0.636 (to three decimal places)

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

f(x 5)≈ (0.682)³+0.682−1≈0.317+0.682−1=−0.001

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

7.Create a table of iterations (values rounded to 5 d.p. for


intermediate steps):

n 𝑥𝑛−1 𝑥𝑛 f(𝑥𝑛 −1) f(𝑥𝑛 ) 𝑋𝑛+1


1 0.00000 1.00000 -1.00000 -1.00000 0.50000
2 1.00000 0.50000 1.00000 -0.37500 0.63636
3 0.50000 0.63636 -0.37500 -0.10650 -0.10650
4 0.63636 0.63636 -0.10650 0.01870 0.68202
5 0.68202 0.68202 0.68202 -0.00063 -0.00063
6 0.68202 0.68233 0.68233 0.00000 0.68233

8.Conclusion:

We see that x 5 and x 6(when calculated more accurately and


rounded) are the same to three decimal places (0.682). Therefore,
the positive root of x ₃+x−1=0, to three decimal places, is 0.682.

Example 3:

Find, to five decimal places, the root of the equation e x +x


2−4=0.

Solution:

1.Define the function: f(x)= 𝑒 𝑥 +𝑥 2 −4

36 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

2.Find initial guesses:

Let's try x=1: f(1)= 𝑒 1 + 12 −4=e−3≈2.71828−3=−0.28172

Let's try x=1.5: f(1.5)= 𝑒 1.5 +(1.5)2 −4≈4.48169+2.25−4=2.73169

Since f(1) is negative and f(1.5) is positive, there's a root


between 1 and 1.5.

3.Set initial values:

Let x₀ =1 and x₁=1.5.

4.Apply the Secant Method formula:

xn+1 = x n - [ f(x n) * (x n - xn-1) ] / [ f( x n) - f(xn-1)

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

6.Continue the iterations: Repeat the process. (Calculations shown


in thought block above, results summarized in table).

37 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

7.Create a table of iterations (values rounded to 7 d.p. for


intermediate steps):

n 𝑥𝑛−1 𝑥𝑛 f(𝑥𝑛 −1) f(𝑥𝑛 ) 𝑋𝑛+1


1 1.0000000 1.5000000 -0.2817182 2.7316890 1.0467598
2 1.5000000 1.0467598 2.7316890 -0.0558008 1.0558269
3 1.0467598 1.0558269 -0.0558008 -0.0106915 1.0579808
4 1.0558269 1.0579808 -0.0106915 -0.0106915 1.0579745
5 1.0579808 1.0579745 0.0000304 -0.0000000 1.0579745

8.Conclusion:

We see that x 4 and x 5are the same to five decimal places


(1.05797). Therefore, the root of e 𝑒 𝑥 +𝑥 2 −4=0, to five decimal
places, is 1.05797.

EXERCISE PROBLEMS:

Solve the following equations using Secant Method.

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

6.3 Incremental Search Method

III. Incremental Search Method for Solving Roots of


Equations
The incremental search method is a straightforward numerical
technique used to identify intervals where the roots of a real and
continuous function may exist. This method is particularly useful
as a preliminary step in root-finding, especially when the location
of the root is not known in advance.

Principle and Procedure


The incremental search method is based on the observation
that if a continuous function f(x) changes sign between two points,
then there is at least one root in that interval. Specifically,

if f(xl)⋅f(xu)<0 f(x)⋅f(xu)<0, where xI and xu are consecutive points,


a root exists between them.

The general steps of the incremental search method are as follows:

1. Select an Interval and Increment:


o Define the interval [xstart,xend] over which to search for
roots.Choose a step size (increment) Δx that determines
how finely the interval is divided.
2. Evaluate the Function:
o Compute f(x) at each point in the interval, incrementing
by Δx each time.
3. Detect Sign Changes:
o Check for a change in sign between consecutive function
values. If f(xi) and f(xi+1) have opposite signs, a root
lies between xi and xi+1

39 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

4. Bracket the Root:


o Record the interval where the sign change occurs. This
interval can be used as the starting point for more
precise root-finding methods, such as the bisection
method.
5. Repeat as Needed:
o Continue the process across the entire interval to
identify all possible root-containing subintervals

Example 1:

Problem:
Use the incremental search method to estimate the root of the
equation

f(x)=cosx−x

f(x)=cosx−x

in the interval [0, Approximate the root to three decimal places.

Step 1: Define the function and interval

f(x)=cosx−x

We want to find x such that f(x)=0 in the interval

Step 2: Choose an increment size


Start with a step size
Δx=0.1
Δx=0.1 to locate the interval where the root lies, then refine with
smaller increments.

40 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Step 3: Evaluate f(x) at increments of 0.1

x cosx f(x)=cosx−x

0.0 1.0000 1.0000 - 0.0 = 1.0000

0.1 0.9950 0.9950 - 0.1 = 0.8950

0.2 0.9801 0.9801 - 0.2 = 0.7801

0.3 0.9553 0.9553 - 0.3 = 0.6553

0.4 0.9211 0.9211 - 0.4 = 0.5211

0.5 0.8776 0.8776 - 0.5 = 0.3776

0.6 0.8253 0.8253 - 0.6 = 0.2253

0.7 0.7648 0.7648 - 0.7 = 0.0648

0.8 0.6967 0.6967 - 0.8 = -0.1033

0.9 0.6216 0.6216 - 0.9 = -0.2784

1.0 0.5403 0.5403 - 1.0 = -0.4597

41 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Step 4: Identify sign change

• 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]

Step 5: Refine search with Δx=0.01 in [0.7,0.8]

x cosx f(x)=cosx−x

0.70 0.7648 0.0648

0.71 0.7570 0.0470

0.72 0.7490 0.0290

0.73 0.7409 0.0109

0.74 0.7326 -0.0074

0.75 0.7241 -0.0259

Step 6: Identify finer sign change

o At x=0.73f(0.73)=0.0109>0
o At x=0.74, f(0.74)=−0.0074<0

Root lies between 0.73 and 0.74.

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

0.730 0.7409 0.0109

0.731 0.7400 0.0090

0.732 0.7391 0.0081

0.733 0.7382 0.0072

0.734 0.7373 0.0063

0.735 0.7364 0.0054

0.736 0.7355 0.0045

0.737 0.7346 0.0036

0.738 0.7337 0.0027

0.739 0.7328 0.0018

0.740 0.7319 0.0009

0.741 0.7310 -0.0000

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

f(0.741)≈−0.0000 (negative), and at x=0.740, f(0.740)=0.0009


(positive).

Step 8: Final root approximation


The root lies between 0.740 and 0.741. Since the function
changes sign between these two points and we want three decimal
places, the root is approximately:

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.

Step 1: Define the function and interval

f(x)=x2−3x+2

We want to find such that f(x)=0 in the interval.

Step 2: Choose an increment size


Start with a step size Δx=0.1 to locate intervals where roots may
lie, then refine as needed.

44 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Step 3: Evaluate

f(x) at increments of 0.1

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

Step 4: Identify sign changes

• Between x=0.9 and x=1.0, f(0.9)=0.11>0 and f(1.0)=0, so root


at x=1.0.
• Between x=1.0 and x=1.1, f(1.0)=0 and f(1.1)=−0.09<0, root at
x=1.0.
• Between x=1.9 and x=2.0, (1.9)=−0.09<0 and f(2.0)=0, root at
x=2.0.

47 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Step 5: Refine search near the root at

x=2.0 with Δx=0.01

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

Sign change between 1.94 and 1.95.

48 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Step 6: Refine further with Δx=0.001 between 1.94 and 1.95

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

Step 7: Final root approximation


The root lies at approximately
x=1.950 (to three decimal places).

Answer:

The root of the equation x2−3x+2=0 in the interval is


approximately:

1.950

EXERCISE PROBLEMS:

1. Locate an interval containing a root of:


f(x)=x3−4x+1f(x)=x3−4x+1

Use incremental search with step size Δx=0.5Δx=0.5 starting


from x=0x=0.

2. Find an interval containing a root of:


f(x)=tanx−xf(x)=tanx−x

Use incremental search with step size Δx=0.1Δx=0.1 starting


from x=1x=1.

3. Locate an interval containing a root of:

f(x)=x2−2f(x)=x2−2

Use incremental search with step size Δx=0.2Δx=0.2 starting


from x=0x=0.

4. Find an interval containing a root of:


f(x)=ln(x)−1f(x)=ln(x)−1

Use incremental search with step size Δx=0.5Δx=0.5 starting


from x=1x=1.

50 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

5. Locate an interval containing a root of:


f(x)=ex−3xf(x)=ex−3x

Use incremental search with step size Δx=0.1Δx=0.1 starting


from x=0x=0.

51 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Chapter 7: FOURIER SERIES

7.1 Fourier Series for Periodic Functions of Period 2𝜋


7.2 Fourier Series for a Non-Periodic Function over Range 2𝜋
7.3 Fourier Series over Any Range

At the end of the lesson, the students will be able to:

1. Define Fourier series and understand its significance in


representing functions.
2. Derive the Fourier series representation for periodic
functions.
3. Extend the concept to obtain Fourier series for non-periodic
functions through appropriate techniques.
4. Calculate Fourier series expansions over any specified range,
not limited to standard intervals.

Overview

Fourier series are powerful mathematical tools that express


a wide variety of periodic functions as infinite sums of sine and
cosine terms. This decomposition allows complex waveforms and
signals to be analyzed and synthesized using simple harmonic
components. In this chapter, we will explore the foundational
theory behind Fourier series, learn how to derive them for periodic
functions, and extend these concepts to non-periodic functions
using methods such as function extension and interval adjustments.
Additionally, we will cover how to obtain Fourier series over
arbitrary intervals, broadening the applicability of Fourier
analysis in engineering, physics, and applied mathematics.

52 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Fourier Series

What is a Fourier series?

A Fourier series is a way to represent a periodic function as


a sum of simpler sine and cosine functions (or complex
exponentials). It's a fundamental tool in mathematics and
engineering, especially in signal processing, acoustics, and
solving differential equations.

A Fourier series is a mathematical method for breaking down


any periodic function into a sum of simpler sine and cosine
functions (or equivalently, complex exponentials). This is based
on the idea that any periodic waveform—no matter how complex—can
be expressed as a combination of pure sine and cosine waves with
different frequencies, amplitudes, and phases.

What is a Periodic function?

function that exhibits a recurring pattern over time


separation of two “matching” points on the graph

Basic sine and cosine functions have a period of 2𝜋.

A function f(x) is said to be periodic if f x + P = 𝑓(𝑥)


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

Prove that 𝑓(𝑥) = sin x has a period of 2𝜋.

f x + P = 𝑓(𝑥)

f x + 2𝜋 = sin (x + 2π)

= sin x cos 2π + cos 𝑥 𝑠𝑖𝑛2𝜋


[ f x + 2𝜋 = sin x]
Therefore, 𝑓 𝑥 = 𝑠𝑖𝑛𝑥 𝑖𝑠 𝑎 𝑝𝑒𝑟𝑖𝑜𝑑𝑖𝑐 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝑜𝑓 𝑝𝑒𝑟𝑖𝑜𝑑 2𝜋.

7.3 Odd and Even Function

A function 𝑓 𝑥 𝑖𝑠 𝑠𝑎𝑖𝑑 𝑡𝑜 𝑏𝑒 𝑜𝑑𝑑 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝑖f

𝑓 −𝑥 = −𝑓(𝑥)

A function 𝑓 𝑥 𝑖𝑠 𝑠𝑎𝑖𝑑 𝑡𝑜 𝑏𝑒 𝑒𝑣𝑒𝑛 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝑖𝑓

𝑓 −𝑥 = 𝑓(𝑥)

𝑁𝑜𝑡𝑒:
sin 𝑥 ( 𝑜𝑑𝑑 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛)

𝑐𝑜𝑠 𝑥 ( 𝑒𝑣𝑒𝑛 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛)

7.4 Graph of Sine and Cosine

54 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

7.1 FOURIER SERIES FOR PERIODIC FUNCTIONS OF PERIOD 𝟐π.

Consider the figure,

The function is periodic of


period 2𝜋 and is defined by,

f(x)={-1, when -π < x < 0


{+1, when 0< x < 0

A function f (x) represented by a Fourier series across the


interval -𝜋 ≤ x ≤ 𝜋 is provided by the phrase,

𝑓 (𝑥 ) = 𝑎0 + ∑∞
𝑛=1(𝑎𝑛 cos 𝑛𝑥 + 𝑏𝑛 𝑠𝑖𝑛𝑥 )

↓ ↓ ↓
1 π 1 π 1 π
∫ 𝑓(𝑥)𝑑𝑥
2𝜋 −π
∫ 𝑓(𝑥)𝑐𝑜𝑠
2𝜋 −π
𝑛𝑥 𝑑𝑥 , ∫ 𝑓(𝑥)𝑠𝑖𝑛
2𝜋 −π
𝑛𝑥 𝑑𝑥 ,

(n=1,2,3, ….) (n=1,2,3, …)

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 , 𝑤ℎ𝑒𝑛𝑓 𝑖𝑠 𝑎𝑛 𝑜𝑑𝑑 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛

2 𝑠𝑖𝑛𝑛𝑥 𝑐𝑜𝑠𝑛𝑥 𝑠𝑖𝑛𝑛𝑥 𝜋


= 𝜋 [𝑥 2 𝑛
+ 2𝑥( 𝑛2
)+ 2(− 𝑛2
)]0

4(−1)𝑛
= 𝑛2
[∵ 𝑠𝑖𝑛𝑛𝜋 = 0𝑎𝑛𝑑𝑐𝑜𝑠𝑛𝜋 = (−1)𝑛 ]

4
− 2 , 𝑤ℎ𝑒𝑛𝑛𝑖𝑠𝑜𝑑𝑑
⇒ 𝑎𝑛 = { 4𝑛
𝑛2
, 𝑤ℎ𝑒𝑛𝑛𝑖𝑠𝑒𝑣𝑒𝑛

Now x2sin nx is an odd function

∴ bn = 0.

The Fourier series of x2 is


𝜋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:

Find the Fourier series to represent eax for x ∈ (–𝜋, 𝜋).

Solution:

Since x ∈ (–𝜋, 𝜋), therefore, the period of the given function


is 2𝜋. Then,
1 𝜋 1 𝜋
𝑎0 = ∫−𝜋 𝑓(𝑥)𝑑𝑥 = ∫−𝜋 𝑒 𝑎𝑥 𝑑𝑥
𝜋 𝜋

1 𝑒 𝑎𝑥 𝜋 1 𝑒 𝑎𝜋 −𝑒 −𝑎𝜋 2𝑠𝑖𝑛ℎ𝑎𝜋
= 𝜋[ ]
𝑎 −𝜋
= 𝜋[ 𝑎
] = 𝑎𝜋

1 𝜋 1 𝜋
𝑎𝑛 = 𝜋 ∫−𝜋 𝑓(𝑥)𝑐𝑜𝑠𝑛𝑥𝑑𝑥 = 𝜋 ∫−𝜋 𝑒 𝑎𝑥 𝑐𝑜𝑠𝑛𝑥𝑑𝑥

1 𝑒 𝑎𝑥 1 𝑎𝑐𝑜𝑠𝑛𝜋 1 2𝑎(−1)𝑛 .𝑠𝑖𝑛ℎ𝑎𝜋


= 𝜋 [(𝑎2 +𝑛2 ) (𝑎𝑐𝑜𝑠𝑛𝑥 + 𝑛𝑠𝑖𝑛𝑛𝑥)]𝜋−𝜋 = 𝜋 (𝑎2 +𝑛2 ) (𝑒 𝑎𝜋 − 𝑒 −𝑎𝜋 ) = 𝜋 (𝑎 2 +𝑛2 )

Similarly,
1 2𝑛(−1)𝑛 .𝑠𝑖𝑛ℎ𝑎𝜋
𝑏𝑛 =
𝜋 (𝑎 2 +𝑛2 )

∞ ∞
𝑠𝑖𝑛ℎ𝑎𝜋 2𝑎(−1)𝑛 𝑠𝑖𝑛ℎ𝑎𝜋 2𝑛(−1)𝑛 𝑠𝑖𝑛ℎ𝑎𝜋
∴ 𝑒 𝑎𝑥 = 𝑎𝜋
+∑ 𝜋(𝑎 2 +𝑛2 )
𝑐𝑜𝑠𝑛𝑥 +∑ 𝜋(𝑎 2 +𝑛2 )
𝑠𝑖𝑛𝑛𝑥
𝑛=1 𝑛=1

Example 3:

If f(x) = cos x for 0 < x < 𝜋, f(x) = 50 for 𝜋 ≤ x < 2𝜋 and


f(x + 2𝜋) = f(x) ∀ x. Find the sum of the Fourier series of f at x
= 𝜋.
Solution:

Sum of the Fourier series at x = 𝜋 is given by

½ [f(𝜋–) + f(𝜋+)] = ½ (cos 𝜋 + 50) = ½ (–1 + 50) = 24.5.

57 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Sample Problem Exercises:

1. Find the Fourier series of |x| where –𝜋 < x < 𝜋.


2. Find the value of the real number a0 of the Fourier series
if f(x) = x2 for 0 ≤ x ≤ 2𝜋.
3. Express f(x) = sin(𝜋x/l) as half range cosine series for
0 ≤ x ≤ l.
4. Deduce the half-range cosine series for f(x) = kx when 0
≤ x ≤ l/2 and f(x) = k(l – x) when l/2 < x ≤ l.
5. For f(x) = x2(1 – x4) find the bn of the Fourier series x
∈ (–l,l).

7.2 Fourier Series for a Non-Periodic Function over Range


2𝜋

Fourier Series for a Non-Periodic Function Over Range 𝟐

A non-periodic function f(x) cannot be represented by a


Fourier series for all values of x. However, it is possible to
express such a function using a Fourier series within any interval
of length 2.

Take the example of the function f(x)=x, which is not


periodic. To create a periodic version, we can take the values of
f(x) within a specific interval and extend them beyond that
interval by repeating the same pattern every 2 units.

This creates a new version of the function that is periodic


with a period of 2, as illustrated in the accompanying figure.

58 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

The Fourier series of a non-periodic function, when


considered over an interval of length 2, follows the same formula
used for periodic functions.

The general expression is:

f(x) = a₀ + Σ (aₙ cos(nx) + bₙ sin(nx)), where n = 1 to ∞

The coefficients are determined using the following integrals:

• a₀ = (1 / 2π) ∫[from -π to π] f(x) dx

• aₙ = (1 / π) ∫[from -π to π] f(x) cos(nx) dx

• bₙ = (1 / π) ∫[from -π to π] f(x) sin(nx) dx

These constants a₀, aₙ, and bₙ are referred to as Fourier


coefficients, and they are used to build the Fourier series
representation of the function.

59 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Example 1:

Determine the Fourier series to represent the function f(x)


= x2 over the interval − x .

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)

Apply integration by parts twice to get:


aₙ = (4(-1)ⁿ)/n²
For bₙ:
Since f(x) = x² is even and sin(nx) is odd:
bₙ = 0
Final Answer:
f(x) = x² = π²/3 + Σ [4(-1)ⁿ/n² * cos(nx)], n=1 to ∞

60 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

7.3 Fourier Series over Any Range

Fourier Series Over Any Range

In previous discussions, the Fourier series was considered


for functions with a period of 2π. However, in practice, functions
may have different periods. To generalize the approach from a
period of 2π to a period of 2L, the function f(x) is rewritten in
terms of a new variable u, leading to the Fourier series:
f(u) = a₀ + Σ (aₙ cos(nu) + bₙ sin(nu)), for n = 1 to ∞

Where the coefficients are given by:


• a₀ = (1 / 2π) ∫[from -π to π] f(u) du
• aₙ = (1 / π) ∫[from -π to π] f(u) cos(nu) du
• bₙ = (1 / π) ∫[from -π to π] f(u) sin(nu) du

Now, to shift the period from 2π to 2L, we introduce a


substitution where u = kx. Since the old period is 2π and the new
one is 2L, we get k = π / L. Hence, u = (π / L)x and du = (π /
L)dx.

Applying this change in variable, the Fourier series becomes:


f(x) = a₀ + Σ [aₙ cos((nπ / L)x) + bₙ sin((nπ / L)x)], for n = 1 to

With updated coefficients:


• a₀ = (1 / 2L) ∫[from -L to L] f(x) dx
• aₙ = (1 / L) ∫[from -L to L] f(x) cos(nπx / L) dx
• bₙ = (1 / L) ∫[from -L to L] f(x) sin(nπx / L) dx

61 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

This transformation allows the Fourier series to accommodate


functions with arbitrary periods, not just 2π.

Example 1:

Find the Fourier series of the function f(x), where:


f(x) = { -1, when -3 < x < 0
{ +1, when 0 < x < 3

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

Therefore, the Fourier series is:


f(x) = ∑[n=1,3,5,...] (4 / (nπ)) * sin(nπx/3)

62 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Example 2:

Find the Fourier sine series of f(x) = x, defined over [0,]

Solution:

bₙ = (2/) ∫[0 to ] xsin(nx)dx (integration by parts)


= 2(−1)ⁿ⁺¹ / n

Final Answer:
f(x) = Σ [2(−1)ⁿ⁺¹/n] sin(nx)

Example 3:

Find the Fourier series of:


f(x) = {0, - < x < 0 ; x, 0 < x < }

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:

f(x) = /4 + Σ [2/(n²)] cos(nx) (n odd) + Σ [(−1)ⁿ⁺¹/n] sin(nx)

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)

7.4 Fourier Series Over Any Range

In previous discussions, the Fourier series was considered


for functions with a period of 2. However, in practice, functions
may have different periods. To generalize the approach from a
period of 2 to a period of 2L, the function f(x) is rewritten in
terms of a new variable u, leading to the Fourier series:
f(u) = a₀ + Σ (aₙ cos(nu) + bₙ sin(nu)), for n = 1 to ∞

Where the coefficients are given by:


• a₀ = (1 / 2) ∫[from - to ] f(u) du
• aₙ = (1 / ) ∫[from - to ] f(u) cos(nu) du
• bₙ = (1 / ) ∫[from - to ] f(u) sin(nu) du

Now, to shift the period from 2 to 2L, we introduce a


substitution where u = kx. Since the old period is 2 and the new
one is 2L, we get k = /L. Hence, u = (/L)x and du = ( / L)dx.

64 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Applying this change in variable, the Fourier series


becomes:
f(x) = a₀ + Σ [aₙ cos((n / L)x) + bₙ sin((n / L)x)], for n = 1 to

With updated coefficients:


• a₀ = (1/2L) ∫[from -L to L] f(x) dx
• aₙ = (1/L) ∫[from -L to L] f(x) cos(nx/L) dx
• bₙ = (1/L) ∫[from -L to L] f(x) sin(nx/L) dx

This transformation allows the Fourier series to accommodate


functions with arbitrary periods, not just 2.

Example 1:

Find the Fourier series of the function f(x), where:


f(x) = {-1, when -3 < x < 0
{+1, when 0 < x < 3

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

Due to the symmetry and nature of cosine being even, this


integral evaluates to zero:
aₙ = 0

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:

bₙ = (2/3) ∫[0 to 3] sin(nx/3)dx


= (2/3) * [(-3/n)(cos(nx/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

Therefore, the Fourier series is:


f(x) = ∑[n=1,3,5,...] (4/(n)) * sin(nx/3)

Example 2:

Find the Fourier series of the function f(x), where:


f(x) = |x| over [-L, L]

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:

Find the Fourier series of the function f(x), where:


f(x) = x² over [-L, L]

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

Using integration by parts or known result:


aₙ = (2/π) ∫ from 0 to π of x² cos(nx)dx = 4*(-1)^n/n²

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

Find the Fourier series (full, sine or cosine) of the following


functions over the given range:

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:

1. Define interpolation and understand its purpose in numerical


analysis.
2. Explain different interpolation methods, including polynomial
and spline interpolation.
3. Construct interpolation polynomials using methods such as
Lagrange and Newton’s divided differences.
4. Understand the concept of spline interpolation and its
advantages for smooth approximations.
5. Analyze the sources of error in interpolation and recognize
the limitations of interpolation techniques.

Overview:

This chapter introduces the concept of interpolation, a


fundamental numerical method used to estimate values of a
function at points between known data points. It covers the
construction of interpolation polynomials, including Lagrange
and Newton methods, and introduces spline interpolation for
smoother approximations. The chapter also discusses error
considerations in interpolation, emphasizing the importance of
choosing appropriate methods based on data characteristics and
desired accuracy.

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

General Formula for (n-1) th order polynomial:

f(x) = p₁𝑥 𝑛−1 + p₂𝑥 𝑛−2 + ... + 𝑝𝑛−1 x + 𝑝𝑛

This formula represents a general polynomial of degree (n-1), where


p₁, p₂, ..., 𝑝𝑛 are the coefficients.

Common Interpolating Polynomials:

1.First-order (linear) interpolating polynomial: Connects two


points.

Formula: f₁(x) = p₁ x + p₂

2.Second-order (quadratic or parabolic) interpolating polynomial:


Connects three points.

Formula: f₂(x) = p₁x² + p₂ x + p₃

3.Third-order (cubic) interpolating polynomial: Connects four


points.

Formula: f₃(x) = p₁x³ + p₂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:

1.Estimate the value of f (3) given f (1) = 2, f (2) = 5, and f


(4) = 17. Use linear and quadratic interpolation.

Solution:

The data is given as:

x f(x)
1 2
2 5
4 17

For linear interpolation:

x₁ = 2, f(x₁) = 5

x₂ = 4, f(x₂) = 17

The interpolating polynomial is:

f₁(x) = p₁ x + p₂

Solve for p₁ and p₂:

5 = p₁ (2) + p₂ => 2p₁ + p₂ = 5

17 = p₁ (4) + p₂ => 4p₁ + p₂ = 17

Solving the system of equations:

Subtract the first equation from the second equation:

(4p₁ + p₂) - (2p₁ + p₂) = 17 - 5

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

Substitute p₁ = 6 into the first equation:

2(6) + p₂ = 5

12 + p₂ = 5

p₂ = -7

The first-order interpolating polynomial is:

f₁(x) = 6x - 7

When x = 3:

f₁ (3) = 6(3) - 7 = 18 - 7 = 11

By linear interpolation, f(3) ≈ 11.

For quadratic interpolation:

x₁ = 1, f(x₁) = 2

x₂ = 2, f(x₂) = 5

x₃ = 4, f(x₃) = 17

The interpolating polynomial is:

f₂(x) = p₁x² + p₂ x + p₃

Solve for p₁, p₂, and p₃:

2 = p₁ (1) ² + p₂ (1) + p₃ => p₁ + p₂ + p₃ = 2

5 = p₁ (2) ² + p₂ (2) + p₃ => 4p₁ + 2p₂ + p₃ = 5

17 = p₁ (4) ² + p₂ (4) + p₃ => 16p₁ + 4p₂ + p₃ = 17

72 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Solving the system of equations:

Subtract the first equation from the second equation:

(4p₁ + 2p₂ + p₃) - (p₁ + p₂ + p₃) = 5 - 2 3p₁ + p₂ = 3

Subtract the second equation from the third equation:

(16p₁ + 4p₂ + p₃) - (4p₁ + 2p₂ + p₃) = 17 - 5 12p₁ + 2p₂ = 12 6p₁ +


p₂ = 6

Subtract the equation 3p₁ + p₂ = 3 from 6p₁ + p₂ = 6: (6p₁ + p₂) -


(3p₁ + p₂) = 6 - 3 3p₁ = 3 p₁ = 1

Substitute p₁ = 1 into 3p₁ + p₂ = 3: 3(1) + p₂ = 3 3 + p₂ = 3 p₂ = 0

Substitute p₁ = 1 and p₂ = 0 into p₁ + p₂ + p₃ = 2: 1 + 0 + p₃ = 2


p₃ = 1

The second-order interpolating polynomial is:

f₂(x) = 1x² + 0x + 1 = x² + 1

When x = 3:

f₂ (3) = 3² + 1 = 9 + 1 = 10

By quadratic interpolation, f(3) ≈ 10.

73 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

EXERCISE PROBLEMS:

Solve the following problems.

1.Population Growth: The population of a town was recorded at


different years:

Year Population (Thousands)


2010 12
2015 18
2020 25

Estimate the population in the year 2018 using linear and


quadratic interpolation.

2.Fuel Consumption: The fuel consumption of a car was measured at


different speeds:

Speed (km/h) Fuel Consumption (L/100km)


40 6.5
60 5.2
80 4.8

Estimate the fuel consumption at a speed of 70 km/h using linear


and quadratic interpolation.

3.Height of a Projectile: The height of a projectile was recorded


at different times:

Time (seconds) Height (meters)


1 20
2 35
4 40

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.

4.Sales Data: The sales of a product were recorded at different


prices:

Price ($) Sales (Unit)


10 100
15 80
20 65

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

Chapter 9: Numerical Integration

9.1 Trapeziodal Rule


9.2 Simpson’s Rule
9.3 Midpoint Rule

Learning Objectives:
At the end of this chapter, students will be able to:

1. Understand the concept and importance of numerical


integration (quadrature).
2. Apply the trapezoidal rule to approximate definite integrals.
3. Utilize Simpson’s rule for more accurate numerical
integration.
4. Implement the midpoint rule and recognize its applications.
5. Compare the accuracy and conditions of different numerical
integration methods.

Overview:

This chapter introduces numerical integration methods that


approximate definite integrals when analytical solutions are
impractical. It covers the trapezoidal rule, Simpson’s rule, and
the midpoint rule, explaining their formulas, assumptions, and
applications. The chapter emphasizes the balance between
computational simplicity and accuracy in choosing an appropriate
numerical integration technique

76 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

NUMERICAL INTEGRATION

When calculating definite integrals using the Fundamental


Theorem of Calculus, we need to find the antiderivative of the
function being integrated. However, finding antiderivatives isn't
always straightforward.

Example:

Consider the integral ∫ e^(-x²) dx. There's no known


analytical method to find the antiderivative of e^(-x²).

The Challenge: If a function f(x) is continuous on an interval


[a, b], but we can't find its antiderivative, how do we determine
the value of the definite integral ∫[a,b] f(x) dx?

Solution:

Besides Riemann sums, we can use numerical methods to


approximate definite integrals. Common methods include the
Trapezoidal Rule, Simpson's Rule, and the Midpoint Rule.

9.1 Trapeziodal Rule

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 )∆𝑥𝑖 =1 and ∑𝑛𝑖=1 𝑓(𝑥𝑖 )∆𝑥𝑖 ,

and their average,

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𝑛

The average is the area of the trapezoid which is


approximately the area under the curve from 𝑥𝑖−1 to 𝑥𝑖.

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:

1.Approximate the integral ∫₀² √ (1 + x³) dx using the trapezoidal


rule. Use n = 4.

Solution:

1.Find the points of the partition: Using n = 4, the length of each


subinterval is (b-a)/n = (2-0)/4 = 1/2.

Therefore, x₀ = a = 0, x₁ = 1/2, x₂ = 1, x₃ = 3/2, x₄ = b = 2.

2.Compute f(a), f(b), and 2f(xᵢ):

f(a) = f (0) = √ (1 + 0³) = √1 = 1.0000

2f(x₁) = 2f (1/2) = 2√ (1 + (1/2) ³) = 2√ (1 + 1/8) = 2√ (9/8) ≈


2.1213

2f(x₂) = 2f (1) = 2√ (1 + 1³) = 2√2 ≈ 2.8284

2f(x₃) = 2f (3/2) = 2 √ (1 + (3/2) ³) = 2√ (1 + 27/8) = 2√ (35/8)


≈ 4.1833

f(b) = f (2) = √ (1 + 2³) = √9 = 3.0000

3.Add the results and multiply by (b-a)/(2n):

The sum is 1 + 2.1213 + 2.8284 + 4.1833 + 3 = 13.1330

(b-a)/(2n) = (2-0)/ (2*4) = 2/8 = ¼

Thus, ∫₀² √ (1 + x³) dx ≈ 13.1330 * (1/4) ≈ 3.2833

79 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

4.Compare with the actual value (if available):

Using a numerical integration calculator, the actual value of ∫₀²


√ (1 + x³) dx is approximately 3.2413.

5.Calculate the relative error:

Relative error = | (Approximate value - Actual value) / Actual


value| Relative error = | (3.2833 - 3.2413) / 3.2413| ≈ |0.042 /
3.2413| ≈ 0.01296 ≈ 1.30%

Therefore, using the trapezoidal rule with n = 4, the


approximation of ∫₀² √ (1 + x³) dx is approximately 3.2833, with a
relative error of about 1.30%.

EXAMPLE 2:

1
Approximate the integral ∫0 √1 + 𝑥 2 using the trapezoidal rule
with n=4.

SOLUTION:

1.Interval and subinterval length:

𝑏−𝑎 1
a=0,b=1,n=4, =4=0.25
𝑛

𝑥0=0, 𝑥1=0.25, 𝑥2=0.5, 𝑥3=0.75, 𝑥4=1,

80 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

2.Compute the f(x)=1+𝑥 2 at all points:

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

2 f(0.75)= 2√1 + 0.5625=2(1.2748)=2.5496

f(1)= √1 + 1=√2 =1.4142

3.Apply the trapezoidal rule:

Sum= f(0)+ 2 f(0.25)+ 2 f(0.25)+ 2 f(0.75)+ f(1)

=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

Percentage Error≈ 0.86%

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:

1.Interval and subinterval length:

𝑏−𝑎 2
a=1,b=3,n=4, =4=0.5
𝑛

𝑥0=1, 𝑥1=1.5, 𝑥2=2.0, 𝑥3=2.5, 𝑥4=3,

2. Compute the f(x)=ln (x+1) at all points:

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

3.Apply the trapezoidal rule:

Sum= f(1)+ 2 f(1.5)+ 2 f(2.0)+ 2 f(2.5)+ f(3)

=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

Percentage Error≈ 0.35%

9.2 Simpson’s Rule

II. Simpson’s Rule

Simpson’s rule uses parabolas to approximate the area under


a curve. Simpson’s rule is more accurate than the trapezoidal rule.

Consider the figure below,

83 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

Let 𝑦 = 𝐴𝑥 2 + 𝐵𝑥 + 𝐶 be the equation of the parabola passing


through the three points as indicated in the illustration. The area
∆𝑥
under the curve is ∫∆ 𝑖(A𝑥 2 + Bx + C) dx.

Then,

∆𝑥
𝐴 = ∫−∆𝑥𝑖 (A𝑥 2 + Bx + C) dx
𝑖

𝐴 𝐵 2 ∆𝑥𝑖
= [3 𝑥 3 + 2
𝑥 + 𝐶 𝑥] −∆𝑥𝑖

2𝐴
= ∆𝑥𝑖 3 +2C∆𝑥𝑖
3

Since the coordinates of the three points satisfy the equation


of the curve 𝑦 = 𝐴𝑥2 + 𝐵𝑥 + 𝐶, therefore,

𝑓(𝑥𝑖−1) = 𝐴∆𝑥𝑖 2 − 𝐵∆𝑥𝑖 + 𝐶

𝑓(𝑥1 ) = 𝐶

𝑓 ((𝑥𝑖+1) = 𝐴∆𝑥𝑖 2 + 𝐵∆𝑥1 + 𝐶

Equating the equations, we can show,

2 𝐴∆𝑥𝑖 2 = 𝑓 ( 𝑥𝑖−1 ) + 𝑓 (𝑥𝑖+1 ) − 2𝑓 (𝑥𝑖 )

Substituting 2 𝐴∆𝑥𝑖 2 =) 𝑓 (𝑥𝑖−1) + 𝑓 (𝑥𝑖+1 ) − 2𝑓 (𝑥𝑖 to the equation of


the area obtained, we have,

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 𝑓 (𝑥𝑖 )]

The Simpson’s rule is,

𝒃 𝒃−𝒂
∫𝒂 𝐟(𝐱)𝐝𝐱 ≈ 𝒏
[f(a) + 4 𝑓 (𝒙𝒊 )+ 2 f (𝒙𝟐 ) + 4 𝑓 (𝒙𝒏−𝟏 )] + ⋯ + 𝑓 (𝒙𝒏−𝟐 )

+ + 4 𝑓 (𝒙𝒏−𝟏 )+ f(b)]

where 𝑃 = {𝑥0 , 𝑥1 , …, 𝑥𝑛 }, is a regular partition and 𝑛 is an even


integer.

EXAMPLE 1:

1.Approximate the integral ∫₁³ (x³ - 2x + 1) dx using Simpson's


rule. Use n = 4.

Solution:

1.Find the points of the partition:

Using n = 4, the length of each subinterval is (b-a)/n = (3-1)/4 =


2/4 = 1/2.

Therefore, x₀ = a = 1, x₁ = 3/2, x₂ = 2, x₃ = 5/2, x₄ = b = 3.

2.Compute f(a), f(b), 4f(xᵢ) and 2f(xᵢ):

-f(a) = f(1) = 1³ - 2(1) + 1 = 1 - 2 + 1 = 0

-4f(x₁) = 4f(3/2) = 4((3/2)³ - 2(3/2) + 1) = 4(27/8 - 3 + 1) =


4(27/8 - 2) = 4(11/8) = 11/2 = 5.5

-2f(x₂) = 2f(2) = 2(2³ - 2(2) + 1) = 2(8 - 4 + 1) = 2(5) = 10

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

-f(b) = f(3) = 3³ - 2(3) + 1 = 27 - 6 + 1 = 22

3.Add the results and multiply by (b-a)/(3n):

The sum is 0 + 5.5 + 10 + 46.5 + 22 = 84 (b-a)/(3n) = (3-1)/(3*4)


= 2/12 = 1/6

Thus, ∫₁³ (x³ - 2x + 1) dx ≈ 84 * (1/6) = 14

4.Compare with the actual value (if available):

Using the Fundamental Theorem of Calculus:

∫₁³ (x³ - 2x + 1) dx = [x⁴/4 - x² + x]₁³ = (81/4 - 9 + 3) - (1/4 -


1 + 1) = (81/4 - 6) - (1/4) = 80/4 - 6 = 20 - 6 = 14

The actual value is 14.

5.Calculate the relative error:

Relative error = | (Approximate value - Actual value) / Actual


value| Relative error = | (14 - 14) / 14| = 0

Therefore, using Simpson's rule with n = 4, the approximation


of ∫₁³ (x³ - 2x + 1) dx is exactly 14, with a relative error of 0.
In this case, Simpson's rule provides the exact value because the
integrand is a polynomial of degree 3, and Simpson's rule is exact
for polynomials of degree 3 or less.

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:

𝑥0=0, 𝑥1=0.5, 𝑥2=1, 𝑥3=1.5, 𝑥4=2, 𝑥5=2.5, 𝑥4=3,

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

2 f(2)=2 (1+4)= 2(5)=10.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:

𝑥0=1, 𝑥1=1.1667, 𝑥2=1.3333, 𝑥3=1.5, 𝑥4=1.6667, 𝑥5=1.8333, 𝑥6=2,

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.1667) ≈4xln(2.1667) ≈ 4(0.7720)=3.0880

2 f(1.3333) ≈ 2xln(2.3333) ≈2(0.8473)=1.6946

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

9.3 Midpoint Rule

III. Midpoint Rule

Let 𝑓(𝑥) be continuous on the interval [𝑎, 𝑏]. Consider the


figure below,

where 𝑛 are the subintervals of [𝑎, 𝑏] and each one has a length
𝑏−𝑎
of 𝑛
.

Then,

𝑥𝑖−1+𝑥𝑖 𝑏−𝑎 𝑥0+𝑥1 𝑥1+2 𝑥𝑛−1+𝑥𝑛


∑𝑛𝑖=1 f ( ) ∆𝑥𝑖 = [f ( ) + f ( ) ) + ⋯ +f ( )]
2 𝑛 2 2 2

Thus,

𝑏 𝑏−𝑎 𝑥0+𝑥1 𝑥1+2 𝑥𝑛−1+𝑥𝑛


∫𝑎 𝑓(𝑥)𝑑𝑥≈ 𝑛
[f ( 2
) + f ( 2
) ) + ⋯ +f ( 2
)]

90 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

EXAMPLE 1:

1.Approximate the integral ∫₁⁴ (1/x) dx using the midpoint rule.


Use n = 6.

Solution:

1.Find the points of the partition:

Using n = 6, the length of each subinterval is (b-a)/n = (4-1)/6 =


3/6 = 1/2.

Therefore, the endpoints of the subintervals are: x₀ = 1, x₁ = 3/2,


x₂ = 2, x₃ = 5/2, x₄ = 3, x₅ = 7/2, x₆ = 4.

2.Find the midpoints of each subinterval:

Midpoint of [1, 3/2]: (1 + 3/2)/2 = 5/4

Midpoint of [3/2, 2]: (3/2 + 2)/2 = 7/4

Midpoint of [2, 5/2]: (2 + 5/2)/2 = 9/4

Midpoint of [5/2, 3]: (5/2 + 3)/2 = 11/4

Midpoint of [3, 7/2]: (3 + 7/2)/2 = 13/4

Midpoint of [7/2, 4]: (7/2 + 4)/2 = 15/4

3.Compute f(midpoint) for each midpoint:

f (5/4) = 1/ (5/4) = 4/5 = 0.8

f (7/4) = 1/ (7/4) = 4/7 ≈ 0.5714

f (9/4) = 1/ (9/4) = 4/9 ≈ 0.4444

f 11/4) = 1/ (11/4) = 4/11 ≈ 0.3636

91 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

f (13/4) = 1/ (13/4) = 4/13 ≈ 0.3077

f (15/4) = 1/ (15/4) = 4/15 ≈ 0.2667

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

Thus, ∫₁⁴ (1/x) dx ≈ 2.7538 * (1/2) ≈ 1.3769

5.Compare with the actual value (if available):

Using the Fundamental Theorem of Calculus:

∫₁⁴ (1/x) dx = [ln |x|] ₁⁴ = ln (4) – ln (1) = ln(4) ≈ 1.3863

6.Calculate the relative error:

Relative error = | (Approximate value - Actual value) / Actual


value| Relative error = |(1.3769 - 1.3863) / 1.3863| ≈ |-0.0094 /
1.3863| ≈ 0.00677 ≈ 0.68%

Therefore, using the midpoint rule with n = 6, the


approximation of ∫₁⁴ (1/x) dx is approximately 1.3769, with a
relative error of about 0.68%.

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:

𝑥0 =0, 𝑥1=1, 𝑥2=2, 𝑥3=1, 𝑥4=4, 𝑥5 𝑥6=2,


3 3 3 5=3,

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 :

Sum = 0.9862+0.7788+0.4994+ 0.2563+0.0347+0.0003

=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

Actual Value ≈ 0.8519

Relative Error:

0.8821−0.8519
RE= ≈ 𝟎. 𝟎𝟑𝟒𝟐
0.8821

Percentage Error≈ 𝟑. 𝟒𝟐%

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:

𝑥0 =1, 𝑥1=4, 𝑥 5 𝑥3=2, 𝑥4=7, 𝑥5=8, 𝑥6=3,


3 2= , 3 3
3

Midpoint:

𝑥0+𝑥1 7 𝑥1+𝑥2 3 𝑥2+𝑥3 11


= 6, = 2, =
2 2 2 6

𝑥3+𝑥4 13 𝑥4+𝑥5 5 𝑥0+𝑥1 17


=6, =2, =6
2 2 2

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

Actual Value: 2.9444

Relative Error: 0.0064

Percentage Error: 0.64%

95 | P a g e
Republic of the Philippines
CAMARINES SUR POLYTECHNIC COLLEGES
Nabua, Camarines Sur
COLLEGE OF ENGINEERING AND ARCHITECTURE

EXERCISE PROBLEM:

Solve the following.

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

Terano, H. J. R. (n.d.). Advanced engineering


mathematics: A simplified textbook in advanced
mathematics for engineering. College of
Engineering and Graduate School, Camarines Sur
Polytechnic Colleges.

Kreyszig, E. (2020). Advanced Engineering Mathematics (10th


ed.).

Wiley. ISBN: 97811194559291.

Keller, S. S., & Knox, W. F. (1907). Mathematics


for Engineering Students: Analytical Geometry and
Calculus. D. Van Nostrand Company. Retrieved from
https://www.loc.gov/item/07038435/2.

Wynne, W. E., & Spraragen, W. (1916). Handbook of


Engineering Mathematics. D. Van Nostrand Company.
Retrieved from https://www.loc.gov/item/17000712/3.

Kreyszig, E. (2011). Advanced Engineering Mathematics (10th


ed.).

Wiley. Retrieved from


https://openlibrary.org/books/OL5760644M/Advanced_
engineeri ng_mathematics4.

Lewis, B., Onder, N., & Prudil, A. (2021). Advanced


Mathematics for Engineering Students: The Essential
Toolbox. Elsevier Press. ISBN: 97801282368195.

Stroud, K. A., & Booth, D. J. (2020). Engineering


Mathematics

(8th ed.). Red Globe Press.

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.

Greenberg, M. D. (1998). Advanced Engineering


Mathematics (2nd ed.). Prentice Hall.

Simmons, G. F., & Krantz, S. G. (2007). Differential


Equations: Theory, Technique, and Practice. McGraw-
Hill.

Boyce, W., & DiPrima, R. C. (2017). Elementary


Differential Equations and Boundary Value Problems
(11th ed.). Wiley.

O'Neil, P. V. (2018). Advanced Engineering Mathematics (8th


ed.).

Cengage Learning.

Spiegel, M., Lipschutz, S., Schiller, J., & Spellman,


D. (2009). Schaum's Outline of Advanced Mathematics
for Engineers and Scientists. McGraw-Hill Education.

98 | P a g e

You might also like