0% found this document useful (0 votes)
15 views

final-proj-word

cenumes solving for roots of non linear equations

Uploaded by

2022308053
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

final-proj-word

cenumes solving for roots of non linear equations

Uploaded by

2022308053
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 30

FINAL

PROJECT
IN
CENUMES313
1st Semester 2024-2025

YEAR & SECTION: 3D


GROUP NO.: 3
SET: C TOPIC: ROOTS OF NON-LINEAR EQUATION

Leader: MANGALINDAN, Alliah D.


Members: ATENCIO, Keith S.
BALUYAN, Giselle S.
GALANG, Edglaiza Shairah J.
MANALO, Angel Jasmine L.
SANCHEZ, Pauline Jade D. % Criteria Acquired
TUNGOL, Abigail M. 25 Introduction/Discussion
YABUT, Jenny S. 25 Creativity
YANDAN, Akeisha Meigh M. 25 Accuracy
25 Completeness
100 Total

Page 1 of 30
METHOD: INTERNAL HALVING

INTRODUCTION:

Closed Domain (Bracketing) Methods

Methods start with two values of x which bracket the root in the interval [a,b]. If f(a) and f(b) have opposite signs,
and if the function is continuous, then at least one root must be in the interval.

Most common closed domain methods:

1. Interval Halving (Bisection)

2. False Position (Regula Falsi)

Bracketing methods are robust (they are guaranteed to obtain a solution since the root is trapped in the closed
interval)

Interval Halving (Bisection)

The bisection method can be used to solve the equation f(x)=0 for a real variable x, given that f is a continuous
function defined on the interval [a,b]and f(a)and f(b)have opposite signs.

The process involves dividing the interval into two equal parts by calculating the midpoint, denoted as

( a+b )
c= , and evaluating the function f(c)at that position. If c is not the root, there exist two potential outcomes.
2
 f(a) and f(c)exhibit different signs and enclose a root within their range.
 f(c) and f(b) display different signs and enclose a root within their range.

A sub-interval is selected as the new interval for the subsequent step, and this repetition continues until the
interval reaches a suitable level of smallness.

If the signs of f(a) and f(c) differ, then c replaces b. When the signs of f(b) and f(c) differ, c replaces a. If f(c)
equals zero, c is considered the solution, and the process concludes.

Bisection Method Algorithm

To find the solution for a continuous function, follow these steps:

Consider a continuous function f(x),

Step 1: Find two points, a and b, where a is smaller than b, and the product of f(a)and f(b) is negative.

Step 2: Calculate the midpoint, c, between a and b.

Step 3: If f(c) equals 00, then t is the root of the function. If not, proceed to the next step.

Step 4: Divide the interval [a,b];

If the product of f(c) and f(a)is negative, there exists a root between c and a.

If the product of f(c) and f(b) is negative, there exists a root between c and b.

Step 5: Repeat the above three steps until f(c) equals 00.

Page 2 of 30
EXAMPLE PROBLEM #1:

Solve for the root/s of the equation x 5−2 x 4 +3 x 3−x 2+ 4 x−6=0 using Internal Halving (Bisection) process. Set the left
end of the bracket a = 1 and the right end bracket as b = 4. Use tolerance value for |f(c)| < = 0.00001.

Solution:

Initially, if the interval for locating the root is not provided, you establish your own interval by allocating a value of a and b.

5 4 3 2
Next, setup the function as f ( x )=x −2 x +3 x −x +4 x−6

Then, create a table with the following column headers

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1
2
3

It is preferable to solve it in tabular form for this method. This is simple to program in a spreadsheet. Thus, begin by
completing the table's first row, which stands for the initial iteration. You begin by writing the given a and b values.

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1 1 4

Then, apply the “halving” process by finding the value of c using the formula c = (a + b)/2.

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1 1 2.5 4

Lastly, for the first iteration, get the product of f(a) and f(c).

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1 1 2.5 4 -1 64.15625 -64.15625

Verify the tolerance level before moving on to the next iteration. If |f(c)| already falls below the level of tolerance 0. 00001,
the iteration must be stopped. In the current iteration, f(c) = 1 > 0. 000001, thus the iterative procedure needs to continue.

You have to determine a new value for a and b for the second iteration. This will depend on how much the ratio of f(a) to
f(c). The value of a is the same as in the previous iteration if the product is negative. While the value of c is substituted
with b. The value of b is equal to the previous value if the product is positive while a is replaced the value of c.

For this particular example, the product f(a)f(c) is −64.15625 which is negative, of course. So, the value of a retains while
b is replaced by the value of c.

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1 1 2.5 4 -1 64.15625 -64.15625
2 1 2.5

Next, implement the “halving” technique by determining the value of c with the equation c = (a + b)/2.

Page 3 of 30
Iteration a c b f(a) f(c) f(a) f(c)f(a)
1 1 2.5 4 -1 64.15625 -64.15625
2 1 1.75 2.5

Then, you can complete the following three columns labeled f(a), f(b), and f(c). Utilize the function f(x). Enter the values of
a, b, and c above.

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1 1 2.5 4 -1 64.15625 698 -64.15625
2 1 1.75 2.5 -1 11.670898 64.15625

Lastly, for the first iteration, get the product of f(a) and f(c).

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1 1 2.5 4 -1 64.15625 698 -64.15625

Before moving on to the next iteration, first verify the tolerance level. If |f(c)| is already lower than the tolerance level 0.
00001, you should halt the iteration. For this particular iteration, |f(c)| equals |64.15625| = 64.15625, which is greater than
0. 000001, so we must continue the iterative process. The product f(a)f(c) equals -64.15625, which is indeed positive.
Therefore, the value of b remains unchanged while a is substituted with the value of c.

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1 1 2.5 4 -1 64.15625 698 -64.15625
2 1 1.75 2.5 -1 11.670898 64.15625 -11.670898
3 1 1.375 1.75 -1 3.1741638 11.670898 -3.1741638

The process continues and the summary of the solution is as follows.

Iteration a c b f(a) f(c) f(b) f(a)*f(c)


1 1 2.5 4 -1 64.15625 698 -64.15625
2 1 1.75 2.5 -1 11.67089 64.15625 -11.67089
3 1 1.375 1.75 -1 3.17416 11.67089 -3.17416
4 1 1.1875 1.375 -1 0.74783 3.17416 -0.74783
5 1 1.09375 1.1875 -1 -0.19290 0.74783 0.19290
6 1.09375 1.14062 1.1875 -0.19290 0.25878 0.74783 -0.04992
7 1.09375 1.11718 1.140625 -0.19290 0.02853 0.25878 -0.00550
8 1.09375 1.10546 1.11718 -0.19290 -0.08325 0.02853 0.01606
9 1.10546 1.11132 1.11718 -0.08325 -0.02763 0.02853 0.00230
10 1.11132 1.11425 1.11718 -0.02763 0.00038 0.02853 -0.00001
11 1.11132 1.11279 1.11425 -0.02763 -0.01364 0.00038 0.00037
12 1.11279 1.11352 1.11425 -0.01364 -0.00663 0.00038 0.000090542
13 1.11352 1.11389 1.11425 -0.00663 -0.00312 0.00038 0.000020763
14 1.11389 1.11407 1.11425 -0.00312 -0.00137 0.00038 0.000004300
15 1.11407 1.11416 1.11425 -0.00137 -0.00049 0.00038 0.000000683
16 1.11416 1.11421 1.11425 -0.00049 -0.00005 0.00038 0.000000029
17 1.11421 1.11423 1.11425 -0.00005 0.00016 0.00038 -0.00000000

Page 4 of 30
18 1.11421 1.11422 1.11423 -0.00005 0.00005 0.00016 -0.00000000
19 1.11421 1.11421 1.11422 -0.00005 -0.000003 0.00005 0.000000000

After completing the 19th iteration, the value of |f(c)| = |−0. 00000 ... | = 0. 00000 ... is less than 0. 000001. Therefore, it is
appropriate to halt the iteration. The root of the function is represented by the most recent value of c, which is x =
1.11421.

EXAMPLE PROBLEM #2:

Page 5 of 30
Solve for the root/s of the equation x 5−5 x 4 + 4 x3 +2 x 2+ x=0 using Internal Halving (Bisection) process. Set the left end
of the bracket a = 0 and the right end bracket as b = 3. Use tolerance value for |f(c)| < = 0.00001.

Solution:

Initially, if the interval for locating the root is not provided, you establish your own interval by allocating a value of a and b.

5 4 3 2
Next, setup the function as f ( x )=x −5 x + 4 x +2 x + x=0

Then, create a table with the following column headers

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1
2
3

It is preferable to solve it in tabular form for this method. This is simple to program in a spreadsheet. Thus, begin by
completing the table's first row, which stands for the initial iteration. You begin by writing the given a and b values.

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1 0 3

Then, apply the “halving” process by finding the value of c using the formula c = (a + b)/2.

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1 0 1.5 3

Lastly, for the first iteration, get the product of f(a) and f(c).

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1 0 1.5 3 0 1.78125 0

Verify the tolerance level before moving on to the next iteration. If |f(c)| already falls below the level of tolerance 0. 00001,
the iteration must be stopped. In the current iteration, f(c) = 1 > 0. 000001, thus the iterative procedure needs to continue.

You have to determine a new value for a and b for the second iteration. This will depend on how much the ratio of f(a) to
f(c). The value of a is the same as in the previous iteration if the product is negative. While the value of c is substituted
with b. The value of b is equal to the previous value if the product is positive while a is replaced the value of c.

For this particular example, the product f(a)f(c) is 0. So, the value of b retains while a is replaced by the value of c.

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1 0 1.5 3 0 1.78125 0
2 1.5 3

Next, implement the “halving” technique by determining the value of c with the equation c = (a + b)/2.

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1 0 1.5 3 0 1.78125 0
2 1.5 2.25 3
Then, you can complete the following three columns labeled f(a), f(b), and f(c). Utilize the function f(x). Enter the values of
a, b, and c above.

Page 6 of 30
Iteration a c b f(a) f(c) f(b) f(c)f(a)
1 0 1.5 3 0 1.78125 -33 0
2 1.5 2.25 3 1.78125 -12.54199 -33

Lastly, for the first iteration, get the product of f(a) and f(c).

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1 0 1.5 3 0 1.78125 -33 0

Before moving on to the next iteration, first verify the tolerance level. If |f(c)| is already lower than the tolerance level 0.
00001, you should halt the iteration. For this particular iteration, |f(c)| equals |−33| = 33, which is greater than 0. 000001,
so we must continue the iterative process. The product f(a)f(c) equals 0, which is indeed positive. Therefore, the value of
b remains unchanged while a is substituted with the value of c.

Iteration a c b f(a) f(c) f(b) f(c)f(a)


1 0 1.5 3 0 1.78125 -33 0
2 1.5 2.25 3 1.78125 -12.54199 -33 -22.34042
3 1.5 1.875 2.25 1.78125 -3.35037 -12.54199 -5.96785
Iteration a c b f(a) f(c) f(b) f(a)*f(c)
1 0 1.5 3 0 1.78125 -33 0
2 1.5 2.25 3 1.78125 -12.54199 -33 -22.34042
3 1.5 1.875 2.25 1.78125 -3.35037 -12.54199 -5.96785
4 1.5 1.6875 1.875 1.78125 -0.25705 -3.35037 -0.45787
5 1.5 1.59375 1.6875 1.78125 0.89013 -0.25705 1.58555
6 1.59375 1.64062 1.6875 0.89013 0.34927 -0.25705 0.31089
7 1.64062 1.66406 1.6875 0.34927 0.05436 -0.25705 0.01898
8 1.66406 1.67578 1.6875 0.05436 -0.09927 -0.25705 -0.00539
9 1.66406 1.66992 1.67578 0.05436 -0.02194 -0.09927 -0.00119
10 1.66406 1.66699 1.66992 0.05436 0.01633 -0.02194 0.00088
11 1.66699 1.66845 1.66992 0.01633 -0.00276 -0.02194 -0.00004
12 1.66699 1.66772 1.66845 0.01633 0.00679 -0.00276 0.00011
13 1.66772 1.66809 1.66845 0.00679 0.00201 -0.00276 0.00001
14 1.66809 1.66827 1.66845 0.00201 -0.00037 -0.00276 -0.0000007
15 1.66809 1.66818 1.66827 0.00201 0.00081 -0.00037 0.000001
16 1.66818 1.66822 1.66827 0.00081 0.00022 -0.00037 0.0000001
17 1.66822 1.66825 1.66827 0.00022 -0.00007 -0.00037 -0.00000001
18 1.66822 1.66823 1.66825 0.00022 0.00007 -0.00007 0.00000001
19 1.66823 1.66824 1.66825 0.00007 -0.000003 -0.00007 -0.0000000002

The process continues and the summary of the solution is as follows

After completing the 19th iteration, the value of |f(c)| = |−0. 00000 ... | = 0. 00000 ... is less than 0. 000001. Therefore, it is
appropriate to halt the iteration. The root of the function is represented by the most recent value of c, which is x =
1.66823.

METHOD: FALSE-POSITION (REGULA FALSI)

INTRODUCTION:
Page 7 of 30
The interval-halving method, also known as the bisection method, works by finding a root within the interval (a, b)
and approximating it as the midpoint of the interval. On the other hand, the false position method, also known as regula
falsi, assumes that the nonlinear function f(x) can be approximated by a linear function g(x) within the interval (a, b). The
root of the linear function g(x), denoted as x = c, is then used as the next approximation for the root of the nonlinear
function f(x), denoted as x = α.

The method known as linear interpolation is also referred to as the false position method, derived from its Latin
name "regula falsi." In this method, the root of the linear function g(x), denoted as x = c, is not the root of the nonlinear
function f(x). This distinction leads to the false position designation. We end up with two intervals, namely (a, c) and (c, b).
Similar to the interval-halving (bisection) method, we retain the interval that contains the root of the nonlinear function f(x),
ensuring that the root remains bracketed. The equation for the linear function g(x) is as follows:

f ( c )−f ( b )
=g' ( x )
c−b

where f(c) = 0, and the slope of the linear function given by

f ( b )−f ( a )
g' ( x ) =
b−a

Solving this for which f(c) = 0, you get

f ( b)
c=b− '
g (x)

Note that f(a) and a could have been used in the above equation instead of f(b) and b. The equation for c above is
applied repetitively until either one or both of the following two convergence criteria are satisfied: |b − a| < ε1 and/or |f(c)| ≤
ε2.

EXAMPLE PROBLEM #1:


Page 8 of 30
Solve for the root/s of the equation x 5−5 x 4 +3 x 3−2 x2 + 4 x−1=0 using False Position (Regula Falsi) process.
Set the left end of the bracket a = 0 and the right end bracket as b = 2. Use tolerance value for |f(c)| < = 0.00001.

Solution:

Step 1:

5 4 3 2
The equation should be written in the form f ( x )=x −5 x + 3 x −2 x + 4 x−1

Step 2:

Evaluate the value of f(b) since b and f(b) will be fixed all throughout the simulation.

5
b=2 f ( 2 )=(2) −5 ¿

Step 3:

Construct a table that includes the specified column headers and enter the value of the left endpoint, a.

Interval a f(a) g'(x) c f(c)


1 0

Step 4:

Evaluate f(a).

Interval a f(a) g'(x) c f(c)


1 0 1

Step 5:

Using the first formula for Regula Falsi, evaluate g’(x)

f ( b )−f ( a ) −23−1
g' ( x ) = = =−12
b−a 2−0

Interval a f(a) g'(x) c f(c)


1 0 1 -12

Step 6:

Given that b and f(b) remain constant during the simulation, the formula to find c can be revised

f ( b) −23
c=b− =2−
'
g (x) −12

Interval a f(a) g'(x) c f(c)


1 0 1 -12 0.8333

Step 7:

Then, evaluate the value of f(c).

Page 9 of 30
Interval a f(a) g'(x) c f(c)
1 0 1 -12 0.08333 1.32094

Step 8:

Determine whether the value of f(c) is below the tolerance threshold. Given that it still exceeds the tolerance level, after
which the repetition must continue.
The values of c and f(c), respectively, are the new values of a and f(a) for the second iteration from the earlier version.

Interval a f(a) g'(x) c f(c)


1 0 1 -12 0.08333 1.32094
2 0.08333 1.32094

Step 9:

Evaluate the value of the new g’(x). And solve for the new c and f(c).

Interval a f(a) g'(x) c f(c)


1 0 1 -12 0.08333 1.32094
2 0.08333 1.32094 -12.68919 0.18743 1.69329

Moving forward with the procedure,

Interval a f(a) g'(x) c f(c)


1 0 1 -12 0.08333 1.32094
2 0.08333 1.32094 -12.68919 0.18743 1.69329
3 0.18743 1.69329 -13.62338 0.31173 2.09916
4 0.31173 2.09916 -14.86676 0.45292 2.48880
5 0.45292 2.48880 -16.47547 0.60399 2.76233
6 0.60399 2.76233 -18.45420 0.75367 2.79288
7 0.75367 2.79288 -20.69508 0.88862 2.51665
8… 0.88862 2.51665 -22.95953 0.99824 2.01054
30 1.21817 0.00003 -29.41813 1.21817 0.00002
31 1.21817 0.00002 -29.41815 1.21817 0.00001

Given that f(c) is below the tolerance threshold, the function's root is x = 1.21817. According to the analytical approach,
this is roughly equivalent to the true solution x = 1.

EXAMPLE PROBLEM #2:


Page 10 of 30
Solve for the root/s of the equation x 5−4 x 4 +3 x 2−2 x 2−x +2=0 using False Position (Regula Falsi) process. Set the
left end of the bracket a = 1 and the right end bracket as b = 2. Use tolerance value for |f(c)| < = 0.00001.

Solution:

Step 1:

The equation should be written in the form f ( x )=x 5−4 x 4 +3 x 2−2 x 2−x+ 2

Step 2:

Evaluate the value of f(b) since b and f(b) will be fixed all throughout the simulation.

5
b=2 f ( 2 )=(2) −4 ¿

Step 3:

Construct a table that includes the specified column headers and enter the value of the left endpoint, a.

Interval a f(a) g'(x) c f(c)


1 11

Step 4:

Evaluate f(a).

Interval a f(a) g'(x) c f(c)


1 1 -1

Step 5:

Using the first formula for Regula Falsi, evaluate g’(x)

f ( b )−f ( a ) −16−(−1)
g' ( x ) = = =−15
b−a 2−1

Interval a f(a) g'(x) c f(c)


1 1 -1 -15

Step 6:

Given that b and f(b) remain constant during the simulation, the formula to find c can be revised

f ( b) −16
c=b− =2−
'
g (x) −15

Interval a f(a) g'(x) c f(c)


1 1 -1 -15 0.93333

Step 7:

Evaluate the value of f(c).

Page 11 of 30
Interval a f(a) g'(x) c f(c)
1 1 -1 -15 0.93333 -0.56354

Step 8:

Determine whether the value of f(c) is below the tolerance threshold. Given that it still exceeds the tolerance level, after
which the repetition must continue.
The values of c and f(c), respectively, are the new values of a and f(a) for the second iteration from the earlier version.

Interval a f(a) g'(x) c f(c)


1 1 -1 -15 0.93333 -0.56354
2 0.93333 -0.56354

Step 9:

Evaluate the value of the new g’(x). And solve for the new c and f(c).

Interval a f(a) g'(x) c f(c)


1 1 -1 -15 0.93333 -0.56354
2 0.93333 -0.56354 -14.47168 0.89439 -0.33517

Moving forward with the procedure,

Interval a f(a) g'(x) c f(c)


1 1 -1 -15 0.93333 -0.56354
2 0.93333 -0.56354 -14.47168 0.89439 -0.33517
3 0.89439 -0.33517 -14.16853 0.87074 -0.20540
4 0.87074 -0.20540 -13.98664 0.85605 -0.12809
5 0.85605 -0.12809 -13.87467 0.84682 -0.08074
6 0.84682 -0.08074 -13.80466 0.84097 -0.05122
7 0.84097 -0.05122 -13.76046 0.83725 -0.03263
8 0.83725 -0.03263 -13.73239 0.83487 -0.02085
9… 0.83487 -0.02085 -13.71450 0.83335 -0.01334
25 0.83064 -0.00002 -13.68272 0.83064 -0.00001
26 0.83064 -0.00001 -13.68271 0.83064 -0.00001

By the twenty-sixth iteration, the value of f(c) is already less than the required tolerance level, so the iteration can now be
stopped. The value of x = 0.83064

METHOD: THE FIXED-POINT ITERATION METHOD


Page 12 of 30
INTRODUCTION

Fixed-point iteration method is an open-root numerical method used to identify the fixed point of a given
equation in which the values of x n in sequence converges to the root of the equation. In identifying the fixed point, we first
need to express our equation, f(x) = 0 as x = g(x). The fixed point will always be at the same input that makes f(x) = 0.

The fixed-point iteration method computes the solution to the given equation by repeatedly applying the comcept
of a fixed point. A fixed-point is a point in the domain of effect of a function g,
where g(x) = x. The fixed-point iteration method algebraically converts the provided function to the form g(x) = x

How the Fixed-Point Iteration Method Works

Suppose we have an equation f(x) = 0, for which we have to find the solution. The equation can be expressed as
x = g(x). After rearranging, we need to choose g(x) such that the maximum interval for |g’(x)| < 1 at our initial guess x 0,
ensuring that the sequence will converge. There may be multiple possibilities for g(x) from the given equation, and in such
cases, select the one with the minimum value of g’(x).

Illustration source: SciELO Columbia

Once we identified if a certain equation is able to be solved using fixed-point method, then the iterative method is
applied by successive approximations given by the formula:

x n=g(x n−1 )
that is, x₁ = g(x₀), x₂ = g(x₁) and so on.

After performing the iterations to get a good value of g(x) to which the convergence criteria are satisfied, it must
be checked by the stopping condition:

| x i+1−x i| ≤ ε1 or f(x i+1 ) ≤ ε2

The point where the approximate value converges after successive iterations is to be considered as the root of the
given equation.

Page 13 of 30
EXAMPLE PROBLEM #1.

Solve for the root/s of the equation x 5 −3 x 4 +2x3 −4 x 2 +6 x−2=0, using the Fixed-Point Iteration Method, starting with
the point x=0 . Use a tolerance value for | x i+1−x i | ≤ ε1 = 0.00001.

Solution:

Step 1:

Manipulate the functions such that a variable x is on the left side while the rest are on the other side of the equation.

1 5 1 4 −1 3 2 2 1
6 x = x 5 + 3 x 4 −2 x 3 + 4 x 2 + 2 → x = −¿ x + x x + x +
6 2 3 3 3
This equation could be written as;

1 5 1 4 −1 3 2 2 1
x i+1 = −¿ x i + xi xi + xi +
6 2 3 3 3
Step 2:

To simplify the calculations, create the table below to present the steps.

Start with Iteration 1 as x i = 0

Iteration xi
1 0

Calculate the next approximation as f(0):

1 5 1 4 −1 3 2 2 1
f(0) = −¿ (0) + (0) (0) + (0) + = 0.33333
6 2 3 3 3
After, you must always check the tolerance after every iteration.

To check for the tolerance, the difference between two consecutive iterations.

| x i+1−x i| = | 0.33333 −¿ 0.00001 | = 0.33333 > 0.00001

The difference ∣ 0.33333 −¿ 0.00001 ∣ = 0.33333 is clearly larger than the tolerance of 0.00001, so the iteration is not yet
complete. We need to keep applying the fixed-point iteration method until the difference is sufficiently small.

Continuing with the iterations.

The value of x for the second iteration is the value of x i in the previous iteration.

Iteration xi
1 0.00000
2 0.33333

Calculate the next approximation as f(0.33333):

1 1 −1 2 1
f(0.33333) = −¿ (0.33333)5 + (0.33333)4 (0.33333)3 + (0.33333)2 +
6 2 3 3 3
f(0.33333) = 0.40055
Page 14 of 30
Checking the tolerance.

| x i+1−x i | = | 0.40055 - 0.33333 | = 0.06722 > 0.00001

Continuing with the iterations,

Iteration xi
1 0.00000
2 0.33333
3 0.40055
4 0.43002
5 0.44475
6 0.45254
7 0.45678
8 0.45911
9 0.46041
10 0.46114
11 0.46155
12 0.46178
13 0.46190
14 0.46198
15 0.46202
16 0.46204
17 0.46205
18 0.462059
19 0.462063
20 0.462065
21 0.4620671
22 0.4620678
23 0.46206826
24 0.46206849
25 0.4620861
26 0.46206868
27 0.46206872
28 0.46206875
29 0.46206876
30 0.462068771
31 0.46206878
32 0.46206878

Checking the tolerance.

| x i+1−x i| = | 0.46206878 −¿ 0.46206878 | = 0.00000 < 0.00001

The value of the root is x=¿ 0.46206878

Page 15 of 30
EXAMPLE PROBLEM #2.

Solve for the root/s of the equation x 5 + 4 x 4 −2x3 −6 x 2 + x−1=0, using the Fixed-Point Iteration Method, starting with
the point x=1. Use a tolerance value for | x i+1−x i | ≤ ε1 = 0.00001.

Solution:

Step 1:

Manipulate the functions such that a variable x is on the left side while the rest are on the other side of the equation.

2 6 1 1
x 5 ¿−4 x 4 +2x3 +6 x 2 −x +1 → x = −¿ 4 + + −¿ 3 + 4
x x2 x x
This equation could be written as;

2 6 1 1
x i+1 = −¿ 4 + x + 2 −¿ 3 + 4
i xi xi xi
Step 2:

To simplify the calculations, create the table below to present the steps.

Start with Iteration 1 as x i = 1

Iteration xi
1 1

Calculate the next approximation as f(1):

2 6 1 1
f (1) = −¿ 4+ + 2 −¿ 3 + 4 =4
(1)i (1)i (1)i (1)i
After, you must always check the tolerance after every iteration.

To check for the tolerance, the difference between two consecutive iterations.

| x i+1−x i| = | 4 −¿ 1 | = 3 > 0.00001

The difference ∣ 4 −¿ 1 ∣ = 3 is clearly larger than the tolerance of 0.00001, so the iteration is not yet complete. We need
to keep applying the fixed-point iteration method until the difference is sufficiently small.

Continuing with the iterations.

The value of x for the second iteration is the value of x i in the previous iteration.

Iteration xi
1 1
2 4
Calculate the next approximation as f(4):

Page 16 of 30
2 6 1 1
f(4) = −¿ 4+ + 2 −¿ 3 +
( 4)i ( 4)i 4
( 4)i ( 4)i

f(4) = -3.13671875

Checking the tolerance.

| x i+1−x i | = | -3.13671875 - 4 | = | −¿ 7.13671875 | = 7.13671875 > 0.00001

Continuing with the iterations.

Iteration xi
1 1
2 4
3 -3.13671875
4 -3.985059131
5 -4.104290857
6 -4.11312242
7 -4.113727189
8 -4.113768366
9 -4.113771169
10 -4.113771359
11 -4.113771372
12 -4.113771373
Checking the tolerance.

| x i+1−x i| = | (-4.113771373) −¿ (-4.113771372)| = 0.00000 < 0.00001

The value of the root is x=¿ -4.113771373

Additional Notes:
 In using fixed-point iteration method, the multiple possibilities of g(x) have various chances of working, hence
needed to be checked if they fit the convergence criteria.
 If |g’(x)| < 1, then it is guaranteed that there is a unique fixed point for the given equation, and the method will
converge.

Page 17 of 30
METHOD: NEWTON-RAPHSON METHOD

INTRODUCTION

One iterative numerical approach for determining a nonlinear function's roots (or zeros) is the Newton-Raphson
Method. It is a productive technique for estimating answers to equations of the following kind:
f(x) = 0.
in which the function f(x) is continuous and distinguishable.

This approach is based on the linear approximation concept, which approximates the root of the function by using
the tangent line to a curve. In situations where obtaining a precise algebraic solution is challenging or impossible, it is a
potent and effective method of solving problems.

Newton-Raphson often converges fast and may be used for different problems with only a few iterations needed
to provide a very precise answer. However, if the derivative of the function, f'(x)=0, since the procedure includes division
by zero, it will not work. This may occur at locations when the function's tangent is horizontal.

How the Newton-Raphson Method Works

First, manipulate the function, then get the derivative of the function. With the given left or right end bracket for xi, the
Newton-Raphson method updates this value iteratively using the formula below until it converges to the actual root.

f (x )i
X i +1=X i −
f '(x )i
where:
X i is the current approximation of the root,
f (x)i is the value of the function at X i ,
f ' (x)i is the derivative of the function at X i ,
X i +1 is the next approximation for the root.

To solve for the next values of X i , repeat the process using X i +1as the new X i , and solve the next iteration X i
using the same formula.
f (x )i
X i +1=X i −
f '(x )i

Then, continue doing the process until the difference between consecutive iterations gets exceedingly narrow, or
until the absolute difference between X i +1 and X i is less than a predetermined tolerance level, signifying the accuracy of
the root.
Page 18 of 30
EXAMPLE PROBLEM #1:

Find the root of the fifth-degree polynomial: f(x) = x⁵+2x⁴−x³−3x²+x−1= 0 using the Newton’s Method. Set the left end of
the bracket Let a = −2 and right end of the bracket b = 2. Use a tolerance ϵ <= 0.00001.

Solution:

Step 1:

First, define the function and its derivative

The given polynomial is:

f (x) = x⁵ + 2x⁴ − x³ − 3x² + x −1

Now, let's compute its derivative f ′(x):

f ′(x) = 5x⁴ + 8x³ −3x² −6x +1

Step 2:

We are given the interval a= − 2 and b = 2. Typically, we would start with a midpoint or an educated guess. Let's choose b
= 2, as the initial X i .

Knowing that,

f (x )i
X i +1=X i −
f '(x )i

To simplify the calculations, you can present the steps in a table format.

Iteration 1 (Starting with X i = 2):

Iteratio
n Xi f (x)i f ' (x)i X i +1

1 2

Calculate f (2):

Page 19 of 30
f (2) = (2)⁵ + 2(2)⁴ -(2)³ -3(2)² + 2 - 1 = 45

Calculate f ′(2):

f ′(2) = 5(2)⁴ + 8(2)³ -3(2)² -6(2) + 1 = 121

Compute the next approximation:

45
X i +1=¿ 2 - = 1.62810
121

Iteratio
n Xi f (x)i f ' (x)i X i +1

1 2 45 121 1.62810

Then, the value of x for the second iteration is the value of X i +1 in the previous iteration.

Iteratio
n Xi f (x)i f ' (x)i X i +1

1 2 45 121 1.62810

2 1.62810

Calculate f (1.62810):

f (1.62810) = (1.62810)⁵ + 2(1.62810)⁴ - (1.62810)³ - 3(1.62810)² + 1.62810 - 1

f (1.62810) = 13.85229

Calculate f ′(1.62810):

f ′(1.62810) = 5(1.62810)⁴ + 8(1.62810)³ - 3(1.62810)² - 6(1.62810) + 1

f ′(1.62810) = 52.93543

Compute the next approximation:

13.85229
X i +1=¿ 1.62810 - = 1.36642
52.93543

Iteration Xi f (x)i f ' (x)i X i +1

1 2 45 121 1.62810
1.6281
2 0 13.85229 52.93543 1.36642

You must always check the tolerance after every iteration.

∣ X i +1 - X i ∣= ∣1.36642 - 1.62810∣= ∣−0.26168∣

Page 20 of 30
The difference ∣ 1.36642 − 1.62810 ∣ = 0.26168 is clearly larger than the tolerance of 0.00001, so the iteration is not yet
complete. We need to keep applying the Newton-Raphson Method until the difference is sufficiently small.

Continuing with the iterations,

Iteration Xi f (x)i f ' (x)i X i +1

1 2 45 121 1.62810
1.6281
2 0 13.85229 52.93543 1.36642
1.3664
3 2 3.94937 25.04024 1.20870
1.2087
4 0 0.90854 14.16350 1.14455
1.1445
5 5 0.11152 10.77795 1.13420
1.1342
6 0 0.00258 10.28228 1.13395
1.1339
7 5 0.00000 10.27045 1.13395

Checking the tolerance level.


∣ X i +1 - X i ∣= ∣1.13395 - 1.13395∣= 0.00000 < 0.00001. The value of x = 1.13395.

EXAMPLE PROBLEM #2:

Find the root of the fifth-degree polynomial: f(x) = x⁵−3x⁴+2x³−x²+5x−8 = 0 using the Newton’s Method. Set the left end of
the bracket Let a = −2 and right end of the bracket b = 3. Use a tolerance ϵ <= 0.00001.

Solution:

Step 1:

First, define the function and its derivative

The given polynomial is:

f (x) = x⁵−3x⁴+2x³−x²+5x−8

Now, let's compute its derivative f ′(x):

f ′(x) = 5x⁴−12x³+6x²−2x+5

Step 2:

We are given the interval a= − 2 and b = 3. Typically, we would start with a midpoint or an educated guess. Let's choose b
= 3, as the initial X i .

Knowing that,

f (x )i
X i +1=X i −
f '(x )i

To simplify the calculations, you can present the steps in a table format.

Page 21 of 30
Iteration 1 (Starting with X i = 3):

Iteratio
n Xi f (x)i f ' (x)i X i +1

1 3

Calculate f (3):

f (3) = (3)⁵−3(3)⁴+2(3)³−(3)²+5(3)−8 = 52

Calculate f ′(2):

f ′(3) = 5(3)⁴−12(3)³+6(3)²−2(3)+5 = 134

Compute the next approximation:

52
X i +1=¿ 3 - = 2.61194
134

Iteratio
n Xi f (x)i f ' (x)i X i +1

1 3 52 134 2.61194

Then, the value of x for the second iteration is the value of X i +1 in the previous iteration.

Iteratio
n Xi f (x)i f ' (x)i X i +1

1 3 52 134 2.61194

2 2.61194

Calculate f (2.61194):

f (2.61194) = (2.61194)⁵−3(2.61194)⁴+2(2.61194)³−(2.61194)²+5(2.61194)−8

f (2.61194) = 15.81459

Calculate f ′(2.61194):

f ′(2.61194) = 5(2.61194)⁴−12(2.61194)³+6(2.61194)²−2(2.61194)+5

f ′(2.61194) = 59.59261

Compute the next approximation:

15.81459
X i +1=¿ 2.61194 - = 2.34656
59.59261

Iteration Xi f (x)i f ' (x)i X i +1

Page 22 of 30
1 3 52 134 2.61194
2.6119
2 4 15.81459 59.59261 2.34656

You must always check the tolerance after every iteration.

∣ X i +1 - X i ∣= ∣2.34656 - 2.61194∣= ∣−0.26538∣

The difference ∣2.34656 - 2.61194 ∣ = 0.26538 is clearly larger than the tolerance of 0.00001, so the iteration is not yet
complete. We need to keep applying the Newton-Raphson method until the difference is sufficiently small.

Continuing with the iterations,

Iteration Xi f (x)i f ' (x)i X i +1


3.0000
1 0 52.00000 134.00000 2.61194
2.6119
2 4 15.81459 59.59261 2.34656
2.3465
3 6 4.25626 29.89263 2.20418
2.2041
4 8 0.79540 19.25691 2.16287
2.1628
5 7 0.05268 16.74612 2.15973
2.1597
6 3 0.00029 16.56463 2.15971
2.1597
7 1 0.00000 16.56364 2.15971

Checking the tolerance level.

∣ X i +1 - X i ∣= ∣2.15971 - 2.15971∣= 0.00000 < 0.00001

The value of x = 2.15971.

Page 23 of 30
METHOD: SECANT METHOD

INTRODUCTION

In Newton's method, a straight line that intersects the curve at a certain point, also referred to as the tangent line,
can be used to find the root of a function. It iteratively improves the guess for the root by taking the function's derivative. If
the derivative is difficult to compute or the function lacks a simple closed-form derivative, the Secant Method can be a
viable option.

A line connecting two points on the curve can be used to solve the function’s root in place of a tangent line. These
two points, x0 and x1, are the starting estimates required to begin the Secant Method and determine where the line
crosses the x-axis. This method is based on interpolation, which involves estimating the behavior of a function between
two points. The slope of the secant that passes through xi−1 and xi is determined by,

'
f ( x i )−f ( x i−1 )
g ( xi ) =
x i−x i−1

The secant line’s equation is provided by,

Page 24 of 30
'
f ( x i+1 )−f ( x i )
g ( xi ) =
x i+1−x i

Wherein f ( xi+1 )=0. Solving for xi+1,

f ( xi )
x i+1=x i− '
g ( xi )

Until one or both of the two convergence criteria listed below are met, this equation is applied repeatedly:

|x i+1 −xi|≤ ε 1 and/or f ( x i +1 ) ≤ ε 2

EXAMPLE PROBLEM #1:


Solve for the root/s of the polynomial function f ( x )=x 5− x 4 +2 x 3 + 4 x 2+2 x +8, using the Secant Method.
Starting from the initial approximations x 0=0 and x 1=1. The iterations proceed until the tolerance value
|x i+1 −xi|≤ ε 1=0.00001.

Solution:

First, create a table but this time, start with the 0th (zeroth) iteration.

Iteration xi f(xi) g’(xi) xi+1

Page 25 of 30
On this table, write the given value x 0=0 and x 1=1 in the x i column, respectively.

Iteration xi f(xi) g’(xi) xi+1

0 x0 = 0

1 x1= 1

Then, evaluate f ( x i ) for both values of x i,

5 4 3 2
f ( 0 )=( 0 ) −( 0 ) + 2 ( 0 ) + 4 ( 0 ) +2 ( 0 ) + 8=8
5 4 3 2
f ( 1 ) =( 1 ) −( 1 ) +2 ( 1 ) +4 ( 1 ) +2 ( 1 ) +8=16

Iteration xi f(xi) g’(xi) xi+1

0 0 8

1 1 16

Then, using the formula for g ’ ( x i ),

'
f ( x i+1 )−f ( x i )
g ( xi ) =
x i+1−x i

' 16−8
g ( xi ) = =8
1−0

Iteration xi f(xi) g’(xi) xi+1

0 0 8

1 1 16 8

Then, for the value of x i+1 for the first iteration;

f ( xi )
x i+1=x i−
g' ( xi )

16
x i+1=1− =−1
8

Iteration xi f(xi) g’(xi) xi+1

0 0 8

1 1 16 8 -1

Page 26 of 30
And for the second iteration, use the previous value of x i+1 as new x i. Substitute it to f ( x i ) formula, then get the g ’ ( x i ) to
get new value for x i+1.

Iteration xi f(xi) g’(xi) xi+1

0 0 8

1 1 16 8 -1

2 -1 6 5 -2.2

For checking the tolerance level,

|x i+1 −xi|=|−2.2− (−1 )|=−1.2 ≥ 0.00001 .


Therefore, continue and repeat the cycle. Until you get a new value that can give you a result of |x i+1 −xi|≤ ε 1=0.00001
for tolerance level.

Iteration xi f(xi) g’(xi) xi+1

0 0 8

1 1 16 8 -1

2 -1 6 5 -2.2

3 -2.2 -73.29792 66.08160 -1.09080

4 -1.09080 5.02204 70.60921 -1.16192

5 -1.16192 3.99861 14.38929 -1.43981

6 -1.43981 -3.04219 25.33684 -1.31974

7 -1.31974 0.69308 31.10918 -1.34202

8 -1.34202 0.08934 27.09917 -1.34532

9 -1.34532 -0.00325 27.09917 -1.34520

10 -1.34520 0.00001 28.08511 -1.34520

Checking for tolerance level,

|x i+1 −xi|=|−1.34520−(−1.34520 )|=0.00000 ≥0.00001 .


Therefore, the value for the root is x=−1.34520 .

Page 27 of 30
EXAMPLE PROBLEM #2:
5 4 3 2
f ( x )=5 x −5 x −x −2 x +5 x+ 2, using the Secant Method.
Solve for the root/s of the polynomial function
Starting from the initial approximations x 0=0❑ and x 1=1. The iterations proceed until the tolerance value
|x i+1 −xi|≤ ε 1=0.0001.
Solution:

First, create a table but this time, start with the 0th (zeroth) iteration.

Iteration xi f(xi) g’(xi) xi+1

Page 28 of 30
1

On this table, write the given value x 0=0 and x 1=1 in the x i column, respectively.

Iteration xi f(xi) g’(xi) xi+1

0 x0 = 0

1 x1= 1

Then, evaluate f ( x i ) for both values of x i,


5 4 3 2
f ( 0 )=5 ( 0 ) −5 ( 0 ) − ( 0 ) −2 ( 0 ) +5 ( 0 ) +2=2
5 4 3 2
f ( 1 ) =5 (1 ) −5 ( 1 ) −( 1 ) −2 ( 1 ) +5 ( 1 ) +2=4

Iteration xi f(xi) g’(xi) xi+1

0 x0 = 0 2

1 x1= 1 4

'
Then, using the formula for g ( xi ) ,

'
f ( x i+1 )−f ( x i )
g ( xi ) =
x i+1−x i
' 4−2
g ( xi ) = =2
1−2
Iteration xi f(xi) g’(xi) xi+1

0 0 2

1 1 4 2

Then, for the value of x i+1 for the first iteration;


f ( xi )
x i+1=x i− '
g ( xi )
4
x i+1=1− =−1
2

Iteration xi f(xi) g’(xi) xi+1

0 0 2

1 1 4 2 -1

And for the second iteration, use the previous value of x i+1 as new x i. Substitute it to f ( x i ) formula, then get the g ( xi ) to
'

get new value for x i+1.

Page 29 of 30
Iteration xi f(xi) g’(xi) xi+1

0 0 2

1 1 4 2 -1

2 -1 -14 9 0.55556

For checking the tolerance level,


|x i+1 −xi|=|−1−0.55556|=−1.55556 ≥0.00001 .
Therefore, continue and repeat the cycle. Until you get a new value that can give you a result of |x i+1 −xi|≤ ε 1=0.0001
for tolerance level.

Iteration xi f(xi) g’(xi) xi+1

0 0 2

1 1 4 2 -1

2 -1 -14 9 0.55556

3 0.55556 3.77734 11.42829 0.22503

4 0.22503 3.00254 2.34413 -1.05585

5 -1.05585 -17.10686 15.69972 0.03378

6 0.03378 2.16658 17.68809 -0.08871

7 -0.08871 1.54109 5.10653 -0.39049

8 -0.39049 -0.35956 6.29796 -0.33340

9 -0.33340 0.06535 7.44263 -0.34218

10 -0.34218 0.00296 7.10545 -0.34260

11 -0.34260 -0.00002 7.16425 -0.34260

Checking for tolerance level,

|x i+1 −xi|=|−0.34260−(−0.34260 )|=0.00000 ≥ 0.0001 .


Therefore, the value for the root is x=−0.34260 .

Page 30 of 30

You might also like