The Solution of Nonlinear Equations: Doç. Dr. Seher KUMCUOĞLU Doç. Dr. Onur Özdikicierler
The Solution of Nonlinear Equations: Doç. Dr. Seher KUMCUOĞLU Doç. Dr. Onur Özdikicierler
The Solution of Nonlinear Equations: Doç. Dr. Seher KUMCUOĞLU Doç. Dr. Onur Özdikicierler
NONLINEAR
EQUATIONS
f(x)
f(a)
Assume that
x
a ≤ x ≤ b is, true for the
b
root value of f(x)
a xm x
f(b)
f(a)*f(b) ≤ 0
𝑎+𝑏
𝑥𝑚 =
2
f(x)
f(x)
a b
x
x
a b
f(x)
a
b
xm x
Solution:
1st iteration: (a=0, b=1)
𝑎+𝑏 0+1
𝑥𝑚 = = = 0.5
2 2
𝑓 𝑎 = 𝑓 0 = 02 − 5 × 0 + 1 → 𝑓 0 = 1
𝑓 𝑏 = 𝑓 1 = 12 − 5 × 1 + 1 → 𝑓 1 = −3
𝑎 + 𝑏 0 + 0.5
𝑥𝑚 = = = 0.25
2 2
𝑓 0 =1
𝑓 0.5 = −1.25
𝑓 0 =1 𝑓 0 × 𝑓 0.125 ≥ 0 X
𝑓 0.25 = −1.25
𝑓 0.125 × 𝑓 0.25 ≤ 0 ✓ New interval
𝑓 0.125 = 0.39
4th iteration:
6th iteration:
0.2031 + 0.211
𝑥𝑚 = → 𝑥𝑚 = 0.207
2
Relative error for consequent value
0.207 − 0.211 of x satisfies the given condition.
𝜖= = 0.019
0.207 Therefore, the value of root is 0.207
approximately.
Newton Raphson technique requires only one initial value x0, which we
will refer to as the initial guess for the root. To see how the Newton
Raphson method works, we can rewrite the function f(x) using a Taylor
series expansion in (x-x0):
𝑓 ′′ 𝑥0 𝑥 − 𝑥0 2
𝑓 𝑥 = 𝑓 𝑥0 + 𝑓 ′ 𝑥0 𝑥 − 𝑥0 + + ⋯⋯⋯ = 0
2!
By truncating the series at the second term (linear in x), we obtain the
Newton Raphson iteration formula for getting a better estimate of the
true root:
𝑓 ′′ 𝑥0 𝑥 − 𝑥0
𝑓 𝑥 = 𝑓 𝑥0 + 𝑓 ′ 𝑥0 𝑥 − 𝑥0 + + ⋯⋯⋯ = 0
2!
it is difficult to find
0 = 𝑓 𝑥0 + 𝑓 ′ 𝑥0 𝑥 − 𝑥0
𝑓 𝑥0 𝑓 𝑥0
𝑥 − 𝑥0 =− ′ 𝑥1 = 𝑥0 − ′
𝑓 𝑥0 𝑛𝑒𝑤 𝑣𝑎𝑙𝑢𝑒 𝑜𝑓 𝑥 𝑓 𝑥0
Solution: 𝑓 𝑥𝑖
𝑥𝑖+1 = 𝑥𝑖 − ′
𝑓 𝑥𝑖
𝑓 𝑥 = 𝑥 2 − 5𝑥 + 1 𝑓 ′ 𝑥 = 2𝑥 − 5
0.20871 − 0.208
∈= <∈
0.20871
The equation is rewritten for x using this term, or by adding a new term such as x:
𝑥2 − 𝑐
𝑥= 𝑥 = 𝑥2 − 𝑥 − 𝑐
2
In second step:
• the initial value of unknown variable is used to calculate the new value of the
variable such as x1 = f (x0) for first iteration x2 = f (x1) for second iteration and finally
xn = f (xn-1) for nth iteration.
f1
f0 B
0
x0 x1 x2 x3
x
f(x)
f(x)
a x0 x1 x 0 1
x2 x x x3 x
x2
Solution:
𝑥2 + 1
𝑓 𝑥 = 𝑥2 − 5𝑥 +1 𝑥=
5
𝑥 0 2+1 02+1
0.2 − 0
1st iteration: x0=0 𝑥1 = = = 0.2 ∈= >∈
5 5 0.2
𝑥1 2
(0.2)2 +1
+1 0.208 − 0.2
2nd iteration: x1=0.2 𝑥2 = = = 0.208 ∈= >∈
5 5 0.208
3
(0.208)2 +1 0.20865 − 0.208
3rd iteration: x2=0.208 𝑥 = = 0.20865 ∈= >∈
5 0.20865
2 +1
(0.20865)
4th iteration: x3=0.20865 𝑥4 = = 0.2087
5
0.2087 − 0.20865 The relative error satisfies the required condition and
∈= = 0.00024 final value of x is approved as the root value of function.
0.2087 (x=0.2087)