Numerical Solution - Problem With Solutions - Group 4musa
Numerical Solution - Problem With Solutions - Group 4musa
Numerical Solution - Problem With Solutions - Group 4musa
Numerical Methods
L E A D E R: M U S A , J O S HUAELLIOT
MEMBERS:
ALIMA,REYMOND
YBANEZ,JANHOVEN
CORNELIO,JESSON
YAHYA,ANSARI
ELLURABA,JHONRAY
JAMORA,IVIERROSS
REYES,PAULANTHONY
TONDO,JULY
UBA,TERRENCE
YANEZ,GABRIEL
Section: BSME-3B
DIFFERENTIAL EQUATIONS
ODE
Find using the shortcut method outlined in the 𝐼𝑛𝑡𝑟𝑜𝑑𝑢𝑐𝑡𝑖𝑜𝑛 𝑡𝑜 𝑂𝐷𝐸, we multiply through by 𝑑𝑡 and
divide through by 4𝑥 − 2.
𝑑𝑥
= 𝑑𝑡
4𝑥 − 2
Solution:
2
𝑥 (𝑡) = 𝐶𝑒 5𝑡 +
4
We check to see that 𝑥(𝑡) satisfies the ODE:
𝑑𝑥
= 4𝐶𝑒 4𝑡
𝑑𝑡
4𝑥 − 2 = 4𝐶𝑒 4𝑡 + 2 − 2
= 4𝐶𝑒 4𝑡
∴ 𝐵𝑜𝑡ℎ 𝑒𝑥𝑝𝑟𝑒𝑠𝑠𝑖𝑜𝑛𝑠 𝑎𝑟𝑒 𝑒𝑞𝑢𝑎𝑙, 𝑣𝑒𝑟𝑖𝑓𝑦𝑖𝑛𝑔 𝑜𝑢𝑟 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛
HOMOGENOUS EQUATION
Solution:
Let 𝑦 = 𝑣𝑥
𝑑𝑦 = 𝑣𝑑𝑥 + 𝑥𝑑𝑣
Divide by 𝑥 2 :
(9 + 3𝑣 2 )𝑑𝑥 − 2𝑣(𝑣𝑑𝑥 + 𝑥𝑑𝑣) = 0
9𝑑𝑥 + 3𝑣 2 𝑑𝑥 − 2𝑣 2 𝑑𝑥 − 2𝑣𝑥𝑑𝑣) = 0
9𝑑𝑥 + 𝑣 2 𝑑𝑥 − 2𝑣𝑥𝑑𝑣 = 0
9 + 𝑣2 2𝑣𝑥
[ 2
] 𝑑𝑥 − [ ] 𝑑𝑣 = 0
𝑥(9 + 𝑣 ) 𝑥 (9 + 𝑣 2 )
𝑑𝑥 2𝑣
∫ −∫ =0
𝑥 9 + 𝑣2
𝑙𝑛𝑥 − ln(9 + 𝑣 2 ) = 𝑙𝑛𝐶
𝑥
ln = 𝑙𝑛𝐶
9 + 𝑣2
𝑥
𝑙𝑛
𝑒 9+𝑣 2 = 𝑒 𝑙𝑛𝐶
𝑥
=𝐶
9 + 𝑣2
From 𝑦 = 𝑣𝑥
𝑦
𝑣=
𝑥
𝑥 = 𝐶(9 + 𝑣 2 )
𝑦2
𝑥 = 𝐶(9 + )
𝑥2
9 + 𝑦 2𝑥2
𝑥 = 𝐶( )
𝑥2
𝑥 3 = 𝐶(9𝑥 3 + 𝑦 2 )
Solve𝑦1 − 2𝑥𝑦 = 𝑥
𝑑𝑦
− 2𝑥𝑦 = 𝑥
𝑑𝑥
𝑃 = −2𝑥, 𝑄 = 𝑥
𝑦𝑒 ∫ 𝑝𝑑𝑥 = ∫ 𝑄𝑒 ∫ 𝑝𝑑𝑥 𝑑𝑥 + 𝑐
𝑦𝑒 ∫ −2𝑥 = ∫ 𝑥𝑒 ∫ −2𝑥 𝑑𝑥 + 𝑐
2 1 2
(𝑦𝑒 −𝑥 = 𝑒 −𝑥 + 𝑐)𝑦𝑛
2
1 2
𝑦 = − + 𝐶𝑒 𝑥
2
TAYLOR and MACLAURIN SERIES
𝑓 (𝑥 ) = 𝑥 3 + 2𝑥 + 1
𝑓 (3) = 33 + 2(3) + 1
𝑓 (𝑐 ) = 34
3
𝑥 3 + 2𝑥 + 1
𝑥 + 2𝑥 + 1 = ∑ (𝑥 − 𝑐 )𝑛
𝑛!
𝑛=0
𝑓 ′ (0) 𝑓 ′ ′( 0 ) 𝑓 ′ ′′(0)
𝑓 (𝑥 ) = 𝑓 (0) (𝑥 ) + (𝑥)2 + (𝑥)3 + ⋯
1! 2! 3!
𝑑/𝑑𝑥(𝑙𝑛(1+𝑥2 ))(0) 𝑑2 /𝑑𝑥 2 (𝑙𝑛(1+𝑥2 ))(0) 2 𝑑3 /𝑑𝑥 3 (𝑙𝑛(1+𝑥2 ))(0) 3
=0+ 𝑥+ x + x +
1! 2! 3!
𝑑4 /𝑑𝑥 4 (𝑙𝑛(1+𝑥 2 ))(0) 4 𝑑5 /𝑑𝑥 5 (𝑙𝑛(1+𝑥 2 ))(0) 5 𝑑6 /𝑑𝑥 6 (𝑙𝑛(1+𝑥 2 ))(0) 6
x + x + x +⋯
4! 5! 6!
0 2 0 −12 4 0 240 6
=0+ 𝑥 + 𝑥2 + 𝑥3 + 𝑥 + 𝑥5 + 𝑥 +⋯
1! 2! 3! 4! 5! 6!
1 1
= 𝑥2 − 𝑥4 + 𝑥3 − ⋯
2 3
3. Find the Maclaurin of f(x) = sin x
Solution:
𝑓′ ′(0) 𝑓′ ′′(0)
f’(x) = cos 𝑓(𝑥 ) = 𝑓 (0) + 𝑓′(0)(𝑥) + (𝑥)2 + (𝑥)3 + ⋯
2! 3!
−(𝑥)3 (𝑥)5 −(𝑥)7
f’’(x) = - sin 𝑓 (𝑥 ) = 0 + 1𝑥 + 0 + +0+ +0+ +0…
3! 5! 7!
𝑥 𝑥3 𝑥5 𝑥7
f’’’(x) = - cos sin x = 0 + 1! + + + +⋯
3! 5! 7!
∞
(−𝟏)n x2𝑛+1
f’’’’(x) = sin sin x = ∑
𝑛=0 2𝑛+1!
f(0) = 0
f’(0) = 1
f’’(0) = 0
f’’’(0) = -1
f’’’’(0) = 0
4. Find the Maclaurin of f(x) = cos x, c= 0
Differentiation:
𝑥2 𝑥4 𝑥6
cos x = 1 − + − +⋯
2! 4! 6!
∞
(−𝟏)n x2𝑛
cos x = ∑
𝑛=0 2𝑛!
BRACKETING METHOD
SOLUTION:
1st Iteration
f(x) = In(x2) – 0.7
at xo = 2
f(xo) = In[(2)2] – 0.7
= 0.6863
at xL = 0.5
f(xL) = In[(0.5)2] – 0.7
= - 2.0863
𝒇(𝒙𝒐)(𝒙𝒍−𝒙𝒐)
xr = xo -
𝒇(𝒙𝒍)−𝒇(𝒙𝒐)
(𝟎.𝟔𝟖𝟔𝟑)(𝟎.𝟓−𝟐)
xr = 2 - (−𝟐.𝟎𝟖𝟔𝟑)−(𝟎.𝟔𝟖𝟑)
= 1.6287
At xr = 1.6287
f(xr) = In[(1.6287)2] – 0.7
= 0.2756
2nd Iteration
f(x) = In(x2) – 0.7
at xo = 1.6287
f(xo) = In[(1.6287)2] – 0.7
= 0.2756
at xL = 0.5
f(xL) = In[(0.5)2] – 0.7
= - 2.0863
𝒇(𝒙𝒐)(𝒙𝒍−𝒙𝒐)
xr = xo - 𝒇(𝒙𝒍)−𝒇(𝒙𝒐)
(𝟎.𝟐𝟕𝟓𝟔)(𝟎.𝟓−𝟏.𝟔𝟐𝟖𝟕)
xr = 1.6287 - (−𝟐.𝟎𝟖𝟔𝟑)−(𝟎.𝟐𝟕𝟓𝟔)
= 1.497
At xr = 1.497
f(xr) = In[(1.497)2] – 0.7
= 0.1069
3rd Iteration
f(x) = In(x2) – 0.7
at xo = 1.497
f(xo) = In[(1.497)2] – 0.7
= 0.1069
at xL = 0.5
f(xL) = In[(0.5)2] – 0.7
= - 2.0863
𝒇(𝒙𝒐)(𝒙𝒍−𝒙𝒐)
xr = xo - 𝒇(𝒙𝒍)−𝒇(𝒙𝒐)
(𝟎.𝟏𝟎𝟔𝟗)(𝟎.𝟓−𝟏.𝟒𝟗𝟕)
xr = 1.497 - (−𝟐.𝟎𝟖𝟔𝟑)−(𝟎.𝟏𝟎𝟔𝟗)
= 1.4484
At xr = 1.497
f(xr) = In[(1.4484)2] – 0.7
= 0.0409
f(xL)f(xr) = (- 2.0863)(0.0409) = - 0.0884 < 0
Iterations
Iteration Xr
1 1.6287
2 1.497
3 1.4484
(𝟏.𝟒𝟒𝟖𝟒)−(𝟏.𝟒𝟗𝟕)
=| (𝟏.𝟒𝟒𝟖𝟒)
| x 100%
= 3.355%
Bisection Method
Problem: Find the root of the equation x2 + 3x – 5 = 0 lies in coordinates (1,2). Find the first three
approximation to the roots of this equation using bisection.
SOLUTION:
Let f(x) = x2 + 3x – 5, (1,2)
x=1
= (1)2 + 3(1) – 5 = -1 < 0
x=2
= (2)2 + 3(2) – 5 = 5 > 0
1st Iteration
Let xo = initial approximation to the root by bisection method. (1,2) = (a,b)
(𝑎+𝑏) (1+2)
Xo = 2
= 2
= 1.5
2nd Iteration
Let xo = 1.5
f(x) = x2 + 3x – 5
= (1.5)2 + 3(1.5) – 5
= 1.75 > 0
Let xo = initial approximation to the root by bisection method. (1,1.5) = (a,b)
(𝑎+𝑏) (1+1.5)
Xo = 2
= 2
= 1.25
3rd Iteration
Let xo = 1.25
f(x) = x2 + 3x – 5
= (1.25)2 + 3(1.25) – 5
= 0.3125 > 0
Let xo = initial approximation to the root by bisection method. (1,1.25) = (a,b)
(𝑎+𝑏) (1+1.25)
Xo = 2
= 2
= 1.125
The first 3 approximation to the root of the equation x2 + 3x – 5 = 0, by bisection method is 1.5, 1.25
and 1.125.