Class 3
Class 3
ME – 263
Credit: 3.00 Contact hour: 3.00
Class: 3
Date: 4 December 2024 (Wednesday)
Expansion of a function 𝑓 𝑥 = 𝑐𝑜𝑠𝑥 = 1
𝑑
𝑓′ 𝑥 = (𝑐𝑜𝑠𝑥) = 0
𝑑𝑥
′′ 𝑥
𝑑2
𝑓 = 2 𝑐𝑜𝑠𝑥 = −1
𝑑𝑥
𝑑 3
𝑓 ′′′ 𝑥 = 3 𝑐𝑜𝑠𝑥 = 0
𝑑𝑥
′𝑣 𝑥
𝑑4
𝑓 = 4 𝑐𝑜𝑠𝑥 = 1
𝑑𝑥
𝑣 𝑥
𝑑5
𝑓 = 5 𝑐𝑜𝑠𝑥 = 0
𝑑𝑥
cos 𝑥 = 𝐶0 + 𝐶1 𝑥 + 𝐶2 𝑥 2 + 𝐶3 𝑥 3 + 𝐶4 𝑥 4 + ⋯
1 1
= 1 + 0. 𝑥 − 2 𝑥 2 + 0. 𝑥 3 + 24 𝑥 4 + ⋯
1 1 2 1 1
= 1 + 0. . 𝑥 + −1 𝑥 + 0. . 𝑥 3 + 1 . 24 𝑥 4 + ⋯
1 2 6
1 1 1 𝑣 1
= f 0 + 𝑓′ 0 . . 𝑥 + 𝑓 ′′ 0 . 2 𝑥 2 + 𝑓 ′′′ 0 . . 𝑥 3 + 𝑓 ′ 0 . 24 𝑥 4 + ⋯
1 6
1 1 1 𝑣 1
= f 0 + 𝑓′ 0 . . 𝑥 + 𝑓 ′′ 0 . 2! 𝑥 2 + 𝑓 ′′′ 0 . . 𝑥 3 + 𝑓 ′ 0 . 4! 𝑥 4 + ⋯
1! 3!
1 1 1 𝑣 1
= f 𝑎 + 𝑓′ 𝑎 . . (𝑥 − 𝑎) + 𝑓 ′′ 𝑎 . 2! (𝑥 − 𝑎)2 + 𝑓 ′′′ 𝑎 . . (𝑥 − 𝑎)3 + 𝑓 ′ 𝑎 . 4! (𝑥 − 𝑎)4 + ⋯
1! 3!
3
Finding Roots of an Equations
We can define the root of an equation 𝑓 𝑥 as the value 𝑥 that makes 𝑓 𝑥 = 0
𝑓 𝑥 = 𝑎𝑥 2 + 𝑏𝑥 + 𝑐
The root of this equation is
−𝑏 ±√(𝑏2 −4𝑎𝑐)
𝑥= 2𝑎
The values obtained from this formula will result in 𝑓 𝑥 being equal to zero
Example:
3𝑥 − 24 = 0
𝑥=8
𝑓 𝑥 = 3𝑥 − 24
𝑥 = 8 𝑖. 𝑒. 𝑓 𝑥 = 0
There are two types of equation:
1. Algebraic equation 𝑎𝑥 5 + 𝑏𝑥 4 + 𝑐𝑥 3 + 𝑑𝑥 2 + 𝑒𝑥 + 𝑓
𝑒𝑥 𝑒𝑥
2. Transcendental equation cos 𝑥 , sin 𝑥 , 𝑒𝑥, ,1 − sin(𝑥)
cos(𝑥)
Transcendental function
Algebraic equation root → fairly easier to find A function that cannot be expressed as a finite
Transcendental equations → difficult to solve polynomial. Examples include exponential,
logarithmic, trigonometric, and hyperbolic functions.
Some methods that are available to solve such equations Algebraic equation
1. Bracketing method An equation that can be written using only the basic
2. Open method operations of addition, subtraction, multiplication, and
division. 4
Bracketing Method
A function typically changes sign in the vicinity of a root. A method that exploits this feature is called bracketing
method
1. Graphical method
2. Bisection method
3. False position method
Graphical Method
667.38
𝑓 𝑥 = 1 − 𝑒 −0.146843𝑥 − 40
𝑥
We have to find the value of 𝑥 for which 𝑓 𝑥 evaluates to zero. By taking some 𝑥 and corresponding 𝑓(𝑥) and
plotting them in an 𝑥, 𝑓(x) graph we can generate a figure Validity check
f(x) 𝑓 14.75 = 0.059
Which is close to zero
40
4, 34.115
x f(x) 30
4 34.115 20 8, 17.653
8 17.653
10
12 6.067 12, 6.067
3. Multiple roots can also be bracketed by a negative and a positive values of 𝑓(𝑥)
6
Notes
4. In general, if 𝑓(𝑥𝑙 ) and 𝑓(𝑥𝑢 ) have opposite signs there is an odd number of roots in the interval
5. If 𝑓 𝑥𝑙 and 𝑓 𝑥𝑢 have same signs, there are either no roots or even number of roots
6. Special cases
𝑓 𝑥𝑙 and 𝑓 𝑥𝑢 have same signs but the graph is tangent to the 𝑥 − 𝑎𝑥𝑖𝑠
𝑓 𝑥𝑙 and 𝑓 𝑥𝑢 have opposite signs but graph is tangent to the 𝑥 − 𝑎𝑥𝑖𝑠 and also intersects the 𝑥 − 𝑎𝑥𝑖𝑠
7
Bisection Method
1. If 𝑓(𝑥) is real and continuous in the interval from 𝑥𝑙 and 𝑥𝑢 and 𝑓 𝑥𝑙 and 𝑓 𝑥𝑢 have opposite signs, there is at
least one real root between 𝑥𝑙 and 𝑥𝑢
2. The main objective is to find an interval where the function changes sign and use that interval with the bisection
algorithm to find and refine the root
3. Bisection method is also called “chopping”, “interval halving” or “Bolzano’s Method”
Steps
1. Chose 𝑥𝑙 and 𝑥𝑢 such that the function changes sign over the interval. This can be done by checking if
𝑓 𝑥𝑙 ⋅ 𝑓 𝑥𝑢 < 0
𝑥𝑙 → 3 → 𝑓 𝑥𝑙 → −55 −
𝑥𝑢 → 10 → 𝑓 𝑥𝑢 → 15 +
+ ⋅ + >0
− ⋅ − >0
+ ⋅ − <0
− ⋅ + <0
8
Steps
3. Evaluate 𝑓 𝑥𝑟1
4. Repeat step (2) and (3) to get 𝑥𝑟2 , 𝑥𝑟3 , 𝑥𝑟4 , … . Until the stopping criteria is met
9
Example of Bisection Method
667.38
𝑓 𝑥 = 1 − 𝑒 −0.146843𝑥 − 40
𝑥
Iteration 1:
𝑥𝑙 = 12 → 𝑓 𝑥𝑙 = 6.067 +
𝑥𝑢 = 16 → 𝑓 𝑥𝑢 = −2.269 −
𝑥𝑙 + 𝑥𝑢 12 + 16
𝑥𝑟1 = = = 14
2 2
𝑓 𝑥𝑟1 = 1.569
𝑓 12 ⋅ 𝑓 14 = 9.517 +
𝑓 14 ⋅ 𝑓 16 = −3.56 −
Iteration 2:
𝑥𝑙 = 14 → 𝑓 𝑥𝑙 = 1.569 +
𝑥𝑢 = 16 → 𝑓 𝑥𝑢 = −2.269 −
𝑥𝑙 + 𝑥𝑢 14 + 16
𝑥𝑟2 = = = 15
2 2
𝑓 𝑥𝑟2 = −0.4248
Iteration 3:
𝑥𝑙 = 14 → (1.569) and 𝑥𝑢 = 15 → (−0.4248)
14 + 15
𝑥𝑟3 = = 14.5
2
𝑓 𝑥𝑟3 = 0.55
10
Example of Bisection Method
Iteration 4:
𝑥𝑙 = 14.5 and 𝑥𝑢 = 15 → (−0.4248)
14.5 + 15
𝑥𝑟3 = = 14.75
2
Iteration 5:
𝑥𝑟5 = 14.875
Iteration 𝒙𝒍 𝒙𝒖 𝒙𝒓 𝝐𝒂 𝑓 𝑥𝑙 , 𝑓 𝑥𝑢 , 𝑓 𝑥𝑟
1 12 16 14 -
2 14 16 15 6.67
3 14 15 14.5 3.44
4 14.5 15 14.75 1.69
5 14.75 15 14.875 0.84
6 14.75 14.875 14.8125 0.42
11