You are on page 1of 27

Linear and Nonlinear

Equations
Chapter 02
Objective
Solving 2nd and 3rd degree polynomials using:
Factorization,
Bisection method,
Regula-falsi method,
Newton-Raphson method,
Error analysis.
Polynomial functions
• A polynomial of degree n is a function of the form
𝑓 𝑥 = 𝑎𝑛 𝑥 𝑛 + 𝑎𝑛−1 𝑥 𝑛−1 + ⋯ + 𝑎1 𝑥 1 + 𝑎0 𝑥 0
where the 𝑎 ’s are real numbers (called the coefficients of the
polynomial). And n is a non-negative integer value.
Although this general formula might look quite complicated, particular
examples are much simpler. For example
𝑓 𝑥 = 4𝑥 3 − 5𝑥 2 + 2
is a polynomial of degree 3, as 3 is the highest power of 𝑥 in the
formula. This is called a cubic polynomial, or just a cubic.
Polynomial functions(cont..)
I. 𝑓 𝑥 = 2𝑥 6 − 3𝑥 2 + 8
II. 𝑓 𝑥 = 𝑥 2 − 2 (𝑄𝑢𝑎𝑑𝑟𝑎𝑡𝑖𝑐)
III. 𝑓 𝑥 = 3𝑥 3 − 4𝑥
IV. 𝑓 𝑥 = 4𝑥 5 − 5𝑥 2 + 2

4
V. 𝑓 𝑥 = 7𝑥 3 − Not a polynomial function
𝑥
VI. 𝑓 𝑥 = 2𝑥 4 − 𝑥 Not a polynomial function
Solving Polynomial Functions
Solving a polynomial function means finding the roots of that
polynomial function.
A root is where the function cuts the x axis.
eg: Solve the following quadratic function.
𝑓 𝑥 = 𝑥2 − 4
𝑥2 − 4 = 0
𝑥 2 − 22 = 0
𝑥−2 𝑥+2 =0
𝑥 − 2 = 0 𝑜𝑟 𝑥 + 2 = 0
𝑥 = 2 𝑜𝑟 𝑥 = −2
1. Factorization
A polynomial can be written as a product of two or
more polynomials of degree less than or equal to that of it.
Each polynomial involved in the product will be a factor of it. The
process involved in breaking a polynomial into the product of its
factors is known as the factorization of polynomials.
Ex:- 1. 𝑥 2 + 8𝑥 + 12 = 0
𝑥 2 + 6𝑥 + 2𝑥 + 12 = 0
𝑥 𝑥+6 +2 𝑥+6 =0
𝑥+2 𝑥+6 =0
𝑥 + 2 = 0 𝑜𝑟 𝑥 + 6 = 0
𝑥 = −2 𝑜𝑟 𝑥 = −6
Factorization(cont..)
2.
3𝑥 2 − 5𝑥 − 2 = 0
3𝑥 2 − 6𝑥 + 𝑥 − 2 = 0
3𝑥 𝑥 − 2 + 1 𝑥 − 2 = 0
3𝑥 + 1 𝑥 − 2 = 0
3𝑥 + 1 = 0 𝑜𝑟 𝑥 − 2 = 0
1
𝑥 = − 𝑜𝑟 𝑥 = 2
3
2. Bisection Method
• What is the bisection method and what is it based on?

One of the first numerical methods developed to find the root of a


nonlinear equation 𝑓 𝑥 = 0 was the bisection method (also called
binary-search method).

The method is based on the following theorem.


Theorem
An equation 𝑓 𝑥 = 0, where 𝑓 𝑥 is a real continuous function, has at
least one root between 𝑥𝑙 and 𝑥𝑢
if 𝑓 𝑥𝑙 . 𝑓 𝑥𝑢 < 0.
Theorem(cont..)
Note that if 𝑓 𝑥𝑙 . 𝑓 𝑥𝑢 > 0, there may or may not be any root
between 𝑥𝑙 and 𝑥𝑢 .
Bisection method
Since the method is based on finding the root between two points, the
method falls under the category of bracketing methods. Since the root
is bracketed between two points, 𝑥𝑙 and 𝑥𝑢 one can find the midpoint,
𝑥𝑚 between 𝑥𝑙 and 𝑥𝑢 . This gives us two new intervals
1. 𝑥𝑙 and 𝑥𝑚 , and
2. 𝑥𝑚 and 𝑥𝑢 .
Bisection method(cont..)
Is the root now between 𝑥𝑙 and 𝑥𝑚 or 𝑥𝑚 and 𝑥𝑢 ?
Well, one can find the sign of 𝑓 𝑥𝑙 . 𝑓 𝑥𝑚 , and if 𝑓 𝑥𝑙 . 𝑓 𝑥𝑚 < 0
then the new root is between 𝑥𝑙 and 𝑥𝑚 , otherwise, it is between 𝑥𝑚
and 𝑥𝑢 . So, you can see that you are literally halving the interval. As
one repeats this process, the width of the interval [𝑥𝑙 , 𝑥𝑢 ] becomes
smaller and smaller, and you can come closer in to the root of the
equation 𝑓 𝑥 = 0 . The algorithm for the bisection method is given as
follows.
Algorithm for the bisection method
The steps to apply the bisection method to find the root of the
equation 𝑓 𝑥 = 0 are
1. Choose 𝑎 and 𝑏 as two guesses for the root such that 𝑓 𝑎 . 𝑓 𝑏 <
0, or in other words, 𝑓 𝑥 changes sign between 𝑎 and 𝑏.

2. Estimate the root, 𝑚 , of the equation 𝑓 𝑥 = 0 as the mid-point


𝑎+𝑏
between 𝑎 and 𝑏 as 𝑚 =
2
Algorithm for the bisection method
3. Now check the following

a) If 𝑓 𝑎 . 𝑓 𝑚 < 0 , then the root lies between 𝑎 and 𝑚; then 𝑎 = 𝑎


and 𝑏 = 𝑚
b) If 𝑓 𝑎 . 𝑓 𝑚 > 0 , then the root lies between 𝑚 and 𝑏; then 𝑎 =
𝑚 and 𝑏 = 𝑏
c) If 𝑓 𝑎 . 𝑓 𝑚 = 0 ; then the root is 𝑚. Stop the algorithm if this is
true.
Algorithm for the bisection method
4. Find the new estimate of the root
𝑎+𝑏
𝑚=
2
Do the step 3.
5. Stopping rule
Find the width of the interval
∈𝑎 = 𝑏 − 𝑎
𝑎+𝑏
If ∈𝑎 < ∈(Error tolerance) stop the process. Root is the 𝑚 = .
2
O/W go to step 3.
Example 01
Find the root of the equation 𝑥 3 − 0.165𝑥 2 + 3.993 × 10−4 = 0
starting from 𝑎 = 0, 𝑏 = 0.11 & ∈= 0.0002
Solution
Check if the function changes between 𝑎 𝑎𝑛𝑑 𝑏
𝑓 𝑎 = 𝑓 0 = 03 − 0.165 × 02 +3.993 × 10−4 = 3.993 × 10−4 (+)
𝑓 𝑏 = 𝑓 0.11 = 0.113 − 0.165 × 0.112 +3.993 × 10−4 =
− 2.662 × 10−4 (-)
𝑓 𝑎 .𝑓 𝑏 = + − = − < 0
So, there is at least one root between 𝑎 𝑎𝑛𝑑 𝑏 that is between 0 and
0.11.
Iteration 01
𝑎+𝑏 0+0.11
The estimate of the root is 𝑚 = = = 0.055
2 2
𝑓 𝑚 = 𝑓 0.055 = 0.0553 − 0.165 × 0.0552 +3.993 × 10−4 =
6.655 × 10−5 (+)
𝑓 𝑎 = 0 . 𝑓 𝑚 = 0.055 = + + = + > 0
Hence the root is bracketed between 𝑚 𝑎𝑛𝑑 𝑏, that is between 0.055
and 0.11. So, the lower and upper limit of the new bracket is
𝑎 = 0.055 𝑎𝑛𝑑 𝑏 = 0.11
Check ∈𝑎 = 𝑏 − 𝑎 = 0.11 − 0.055 = 0.055 > 0.0002
Go to next iteration
Iteration 02
𝑎+𝑏 0.055+0.11
The estimate of the root is 𝑚 = = = 0.0825
2 2
𝑓 𝑚 = 𝑓 0.0825 = 0.08253 − 0.165 × 0.08252 +3.993 × 10−4
−4
= −1.622156 × 10 (−)

𝑓 𝑎 = 0.055 . 𝑓 𝑚 = 0.0825 = + − = − < 0


Hence the root is bracketed between 𝑎 𝑎𝑛𝑑 𝑚, that is between 0.055 and
0.0825. So, the lower and upper limit of the new bracket is
𝑎 = 0.055 𝑎𝑛𝑑 𝑏 = 0.0825.
Check ∈𝑎 = 𝑏 − 𝑎 = 0.0825 − 0.055 = 0.0275 > 0.0002
Go to next iteration
Iteration 03
𝑎+𝑏 0.055+0.0825
The estimate of the root is 𝑚 = = = 0.06875
2 2
𝑓 𝑚 = 𝑓 0.06875
= 0.068753 − 0.165 × 0.068752 +3.993 × 10−4
= −5.56316 × 10−5 (−)
𝑓 𝑎 = 0.055 . 𝑓 𝑚 = 0.06875 = + − = − < 0
Hence the root is bracketed between 𝑎 𝑎𝑛𝑑 𝑚, that is between 0.055
and 0.06875. So, the lower and upper limit of the new bracket is
𝑎 = 0.055𝑎𝑛𝑑 𝑏 = 0.06875.
Check ∈𝑎 = 𝑏 − 𝑎 = 0.06875 − 0.055 = 0.01 > 0.0002
Iteration 04
𝑎+𝑏 0.055+0.06875
The estimate of the root is 𝑚 = = = 0.061875
2 2
𝑓 𝑚 = 𝑓 0.061875
= 0.0618753 − 0.165 × 0.0618752 +3.993 × 10−4
= 4.484 × 10−6 (+)
𝑓 𝑎 = 0.055 . 𝑓 𝑚 = 0.061875 = + + = + > 0
Hence the root is bracketed between 𝑚 𝑎𝑛𝑑 𝑏, that is between
0.06875 and 0.061875. So, the lower and upper limit of the new
bracket is
𝑎 = 0.06875 𝑎𝑛𝑑 𝑏 = 0.061875.
Check ∈𝑎 = 𝑏 − 𝑎 = 0.061875 − 0.06875 = 0.0068 > 0.0002
Six more iterations were conducted and these iterations are shown in
this table.

Iteratio
a b m f(m) f(a).f(m) b-a
n#
1 0 0.11 0.055 + +
2 0.055 0.11 0.0825 - - 0.055
3 0.055 0.0825 0.06875 - - 0.0275
4 0.055 0.06875 0.061875 + + 0.01375
5 0.061875 0.06875 0.0653125 - - 0.006875
6 0.061875 0.0653125 0.06359375 - - 0.0034375
7 0.061875 0.06359375 0.06273438 - - 0.00171875
8 0.061875 0.06273438 0.06230469 + + 0.000859375
9 0.062304688 0.06273438 0.06251953 - - 0.000429687
10 0.062304688 0.06251953 0.06241211 - - 0.000214844
11 0.062304688 0.06241211 0.0623584 0.000107422<0.0002
Example 02
Find the root of the function f 𝑥 = 𝑥 2 − 5 = 0 starting from 𝑎 = 0,
𝑏 = 4 & ∈= 0.002
Solution
Check if the function changes between 𝑎 𝑎𝑛𝑑 𝑏

f 𝑎 = 𝑓 0 = 02 − 5 = −5 < 0
f 𝑏 = f 4 = 42 − 5 = 11 > 0
𝑓 𝑎 .𝑓 𝑏 = − + = − < 0
So, there is at least one root between 𝑎 𝑎𝑛𝑑 𝑏 that is between 0 and 4.
Iteration 01
𝑎+𝑏 0+4
The estimate of the root is 𝑚 = = =2
2 2
𝑓 𝑚 = 𝑓 2 = 22 − 5 = −1 < 0 (-)
𝑓 𝑎 = 0 .𝑓 𝑚 = 2 = − − = + > 0
Hence the root is bracketed between 𝑚 𝑎𝑛𝑑 𝑏, that is between 2 and
4. So, the lower and upper limit of the new bracket is
𝑎 = 2 𝑎𝑛𝑑 𝑏 = 4
Check ∈𝑎 = 𝑏 − 𝑎 = 4 − 2 = 2 > 0.002
Go to next iteration
Iteration 02
𝑎+𝑏 2+4
The estimate of the root is 𝑚 = = =3
2 2
𝑓 𝑚 = 𝑓 3 = 32 − 5 = 4 > 0 (+)
𝑓 𝑎 = 2 .𝑓 𝑚 = 3 = − + = − < 0
Hence the root is bracketed between 𝑎 𝑎𝑛𝑑 𝑚, that is between 2 and
3. So, the lower and upper limit of the new bracket is
𝑎 = 2 𝑎𝑛𝑑 𝑏 = 3
Check ∈𝑎 = 𝑏 − 𝑎 = 3 − 2 = 1 > 0.002
Go to next iteration
Iteration 03
𝑎+𝑏 2+3
The estimate of the root is 𝑚 = = = 2.5
2 2
𝑓 𝑚 = 𝑓 2.5 = 2.52 − 5 = 1.25 > 0 (+)
𝑓 𝑎 = 2 . 𝑓 𝑚 = 2.5 = − + = − < 0
Hence the root is bracketed between 𝑎 𝑎𝑛𝑑 𝑚, that is between 2 and
2.5. So, the lower and upper limit of the new bracket is
𝑎 = 2 𝑎𝑛𝑑 𝑏 = 2.5
Check ∈𝑎 = 𝑏 − 𝑎 = 2.5 − 2 = 0.5 > 0.002
Go to next iteration
It # a b m f(m) f(a).f(m) b-a
1 0 4 2 - + 4
2 2 4 3 + - 2
3 2 3 2.5 + - 1
4 2 2.5 2.25 + - 0.5
5 2 2.25 2.125 - + 0.25
6 2.125 2.25 2.1875 - + 0.125
7 2.1875 2.25 2.21875 - + 0.0625
8 2.21875 2.25 2.234375 - + 0.03125
9 2.234375 2.25 2.2421875 + - 0.015625
10 2.234375 2.2421875 2.23828125 + - 0.0078125
11 2.234375 2.23828125 2.23632813 + - 0.00390625
12 2.234375 2.236328125 2.23535156 - + 0.001953125
Thank You !!

You might also like