You are on page 1of 22

Numerical Methods

Unit 2: Solution of Non-Linear Equations

Jayandra Raj Shrestha

Dept. of Applied Sciences and Chemical Engineering,


Pulchowk Campus, IOE, TU.
jayandra@{gmail.com, ioe.edu.np}

1
Non-linear Equations

• Any single variable function in the form of f (x) = 0 can be classified as a non-linear equation if we
cannot identify it clearly as a linear equation.

2
Non-linear Equations

• Any single variable function in the form of f (x) = 0 can be classified as a non-linear equation if we
cannot identify it clearly as a linear equation.
• Linear equations have one and only one root and the solution for linear equations in standard forms can
be easily computed.

2
Non-linear Equations

• Any single variable function in the form of f (x) = 0 can be classified as a non-linear equation if we
cannot identify it clearly as a linear equation.
• Linear equations have one and only one root and the solution for linear equations in standard forms can
be easily computed.
• Non-linear equations may have multiple or infinite number of roots or they may not possess any real root
at all.

2
Non-linear Equations

• Any single variable function in the form of f (x) = 0 can be classified as a non-linear equation if we
cannot identify it clearly as a linear equation.
• Linear equations have one and only one root and the solution for linear equations in standard forms can
be easily computed.
• Non-linear equations may have multiple or infinite number of roots or they may not possess any real root
at all.
• Analytical solution of non-linear equations demand different approach for each new form of the problem.

2
Non-linear Equations

• Any single variable function in the form of f (x) = 0 can be classified as a non-linear equation if we
cannot identify it clearly as a linear equation.
• Linear equations have one and only one root and the solution for linear equations in standard forms can
be easily computed.
• Non-linear equations may have multiple or infinite number of roots or they may not possess any real root
at all.
• Analytical solution of non-linear equations demand different approach for each new form of the problem.
• Numerical techniques generally employ some mathematical principle iteratively in some tricky manner to
obtain one root at a time, numerically.

2
Non-linear Equations

• Any single variable function in the form of f (x) = 0 can be classified as a non-linear equation if we
cannot identify it clearly as a linear equation.
• Linear equations have one and only one root and the solution for linear equations in standard forms can
be easily computed.
• Non-linear equations may have multiple or infinite number of roots or they may not possess any real root
at all.
• Analytical solution of non-linear equations demand different approach for each new form of the problem.
• Numerical techniques generally employ some mathematical principle iteratively in some tricky manner to
obtain one root at a time, numerically.
• Numerical techniques may be cumbersome than analytical techniques and produce only approximate
results, but may be the only alternate when analytical techniques are hard or impossible to implement.

2
Non-linear Equations

• Any single variable function in the form of f (x) = 0 can be classified as a non-linear equation if we
cannot identify it clearly as a linear equation.
• Linear equations have one and only one root and the solution for linear equations in standard forms can
be easily computed.
• Non-linear equations may have multiple or infinite number of roots or they may not possess any real root
at all.
• Analytical solution of non-linear equations demand different approach for each new form of the problem.
• Numerical techniques generally employ some mathematical principle iteratively in some tricky manner to
obtain one root at a time, numerically.
• Numerical techniques may be cumbersome than analytical techniques and produce only approximate
results, but may be the only alternate when analytical techniques are hard or impossible to implement.
• Compared to analytical techniques, numerical techniques are far more easier to implement as computer
algorithms.

2
2.1 Bisection Method

Iterative application of the Intermediate


Value Theorem to numerically find a real
root of non-linear equation.

f(x)
Intermediate Value Theorem: a
If a function f (x) = 0 is continuous
between an interval (a, b) such that f (a)
and f (b) are of opposite signs, then there
exists at least one real root in the interval
(a, b).
x

1
f (x) = + sin(x)
x3

3
Intermediate Value Theorem

If a function f (x) = 0 is continuous


between an interval (a, b) such that f (a)
and f (b) are of opposite signs, then there
exists at least one real root in the interval
(a, b). a

f(x)
b

Even if f (a) and f (b) are of opposite signs,


existence of root cannot be guaranteed in (a, b)
due to discontinuity.
4
Intermediate Value Theorem

If a function f (x) = 0 is continuous


between an interval (a, b) such that f (a)
and f (b) are of opposite signs, then there
exists at least one real root in the interval
(a, b). b

f(x)
a

Esistence of multiple roots (odd in number).

5
Intermediate Value Theorem

If a function f (x) = 0 is continuous


between an interval (a, b) such that f (a)
and f (b) are of opposite signs, then there
exists at least one real root in the interval
(a, b).

f(x)
a b

No root or even number of roots in (a, b) if


f (a) and f (b) are of same signs.

6
Intermediate Value Theorem

If a function f (x) = 0 is continuous


between an interval (a, b) such that f (a)
and f (b) are of opposite signs, then there
exists at least one real root in the interval
(a, b).

f(x)
a b

No root or even number of roots in (a, b) if


f (a) and f (b) are of same signs.

7
Intermediate Value Theorem

If a function f (x) = 0 is continuous


between an interval (a, b) such that f (a)
and f (b) are of opposite signs, then there
exists at least one real root in the interval
(a, b). a b

f(x)
x

No root or even number of roots in (a, b) if


f (a) and f (b) are of same signs.

8
Intermediate Value Theorem

If a function f (x) = 0 is continuous


between an interval (a, b) such that f (a)
and f (b) are of opposite signs, then there
exists at least one real root in the interval
(a, b). a b

f(x)
x

No root or even number of roots in (a, b) if


f (a) and f (b) are of same signs.

9
Bisection Method

f(a)
f(c)
b
f(x)

a c f(b)
=(a+b)/2

x 10
Bisection Method

b
f(x)

a (old) a (new)

x 11
Bisection Method

b
f(x)

a c

x 12
Bisection Method

c b
f(x)

x 13
Bisection Method

c b
f(x)

|
a

x 14
When to stop?

Absolute Error:
|b − a| ≤ tolerable error

Relative Error:
|b − a|
≤ tolerable error
|c|

Absolute Error in Functional Value:

|f (c)| ≤ tolerable error

For an accuracy of 3 decimal places:


Tolerable Error = 0.0005

15
No. of iterations (n)

Error Tolerance = ε
Initial Interval = (a, b)
|b − a| |b − a|
≤ε ⇒ 2n ≥
2n ε
 
n |b − a|
log(2 ) ≥ log
ε

n log 2 ≥ log(|b − a|) − log(ε)

log(|b − a|) − log(ε)


∴n≥
log 2
16

You might also like