0% found this document useful (0 votes)
8 views10 pages

May Myint Thwe

This paper presents a comparative study of root-finding methods using Microsoft Excel, focusing on Newton-Raphson, Secant, and Bisection methods. It demonstrates how Excel can facilitate the analysis of these methods' convergence rates and iteration counts when solving nonlinear equations. The findings indicate that the Newton-Raphson method converges the fastest, followed by the Secant method, while the Bisection method has the slowest convergence rate.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views10 pages

May Myint Thwe

This paper presents a comparative study of root-finding methods using Microsoft Excel, focusing on Newton-Raphson, Secant, and Bisection methods. It demonstrates how Excel can facilitate the analysis of these methods' convergence rates and iteration counts when solving nonlinear equations. The findings indicate that the Newton-Raphson method converges the fastest, followed by the Secant method, while the Bisection method has the slowest convergence rate.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

360 Yadanabon University Research Journal 2022, Vol.12, No.

Comparative Study of Root Finding Methods with Microsoft Excel


May Myint Thwe

Abstract
Microsoft Excel is a very simple system to use and it is a widely used spreadsheet
application. A spreadsheet can be used to resolve problems that are iterative, recursive, or
tabular in conceptual format in the problem-solving procedure. It can also be used to
make complex analysis on data without having to study programming. This paper
describes a method to execute spreadsheet computations for root finding methods. The
common root-finding methods are Newton-Raphson, Secant and Bisection methods, etc.,
and root finding problem is a problem of finding a root of the equation f(x)=0, where f(x)
is a function of x. Additionally, this work shows how Microsoft Excel can be used to make a
comparative study between Newton-Raphson method, Secant method and Bisection
method with the least number of iterations when applied to resolve a single variable
nonlinear equation.
Key words: Microsoft Excel, Numerical methods, Convergence, Roots, Algorithm.

1. Introduction
Microsoft Excel is the influential software to use and it is the most commonly used
spreadsheet. Its usage seems to be at the increase by the accessibility of the program in almost
all personal computers. Moreover, Microsoft Excel can be used effectively by all branches of
science and engineering. The program has been used in solving several mathematical problems
in many different ways.[8] One of the most related computational problems is the root finding
problem which arises in a wide variety of practical applications in Physics, Chemistry,
Engineering, etc.[4] By the nature of the program, numerical methods for root finding problems
can be made much easier to be implemented.[8] Root finding problem is a problem of finding a
root of the equation f(x)=0 and different methods such as Newton-Raphson, Secant, Bisection
methods etc., converge to the root at different rates.[4] This paper aims at comparing the
performance in relation to the rate of convergence of three root finding methods: Newton-
Raphson method, Secant method, and the Bisection method. Moreover, this study is to compare
the number of iterations needed by a given numerical method to reach a solution and the rate of
convergence of the methods.
In this work, manual computational algorithms for each of the methods are used to find
the root of a function in order to reach the aim of this study. Furthermore, this paper illustrates
how excel can be used to make comparative study of three well-known root finding methods for


Professor, Dr, Head of the Department of Computer Studies, Yadanabon University
Yadanabon University Research Journal 2022, Vol.12, No.2 361

solving non-linear equations.[1] Therefore, this system is at comparing the rate of performance
with the least number of iterations of Newton-Raphson, Secant and Bisection as methods of root-
finding with MS excel.

2. Numerical Methods of Root Finding Problems


Numerical methods play a significant role to engineers in many applications. In
mathematical analysis, these methods are the study of set of procedure that uses numerical
approximation to solve engineering problems.[3]
2.1. Newton-Raphson Method
Newton-Raphson method can be derived by using the concept of finding the slope of a
function and using the Taylor series. In all of numerical analysis, Newton-Raphson method for
solving nonlinear equations is one of the most powerful procedures. It converges when the initial
approximation is sufficiently close to the root.[1] Derivation of Newton-Raphson method begins
with a tangent to a curve that cuts the x-axis as illustrated in Figure 1. The derivative f'(x) of the
nonlinear function f(x) must be evaluated.[7] Newton-Raphson method starts with an initial guess
that is close to the root. If the guess is close to the root, Newton-Raphson method is efficient. The
advantages of Newton-Raphson method are that it converges fast, if it converges, and it
consumes less time and less iterations to find the root.[6]

Figure 1. Newton-Raphson Method


In the above Figure 1, the slope of (xk, f(xk)) is given by
f(xk )−0
f ′ (xk ) = x (1)
k −xk+1
xk+1 in equation (1) represents Newton-Raphson equation.
f(x )
xk+1 = xk − f′ (xk ) (2)
k
From Taylor's series of the function f(x) about a value x=x0,
(x − x0 )2 (x − x0 )3 (x − x0 )4
f(x) = f(x0 ) + f ′ (x0 )(x − x0 ) + f ′′ (x0 ) + f ′′′ (x0 ) + f IV (x0 ) +⋯
2! 3! 4!
The first approximation of the root of the given equation f(x)=0,
362 Yadanabon University Research Journal 2022, Vol.12, No.2

f(x) = 0 ≈ f(x0 ) + f ′ (x0 )(x − x0 )


it denotes that f(x0 ) + f ′ (x0 )(x − x0 ) = 0
for x=x1, f(x0 ) + x1 f ′ (x0 ) − x0 f ′ (x0 ) = 0
x1 f ′ (x0 ) = f ′ (x0 )x0 − f(x0 )
The above equation is divided by f ′ (x0 ), then,
f(x0 )
x1 = x0 −
f ′ (x0 )
It is the first approximation. The second and third approximation to the root will be as follows.
f(x1 )
x2 = x1 − ′
f (x1 )
f(x2 )
x3 = x2 − ′
f (x2 )
In general, this iterative procedure can be written as the following;
f(xk )
xk+1 = xk − ′
f (xk )
It is the Newton iterative method for non-linear equation. "k" denotes the number of
iteration.
2.2. Algorithm for Newton Raphson Method
x0 : initial guess
epsilon : error/tolerance
N: number of steps/calculations
For k=1 to N
f(x )
xk+1 = xk − f′ (xk ) , f ′ (xk ) ≠ 0
k
If |xk+1 − xk | ≤ epsilon, break.
2.3. The Secant Method
A different method to Newton's method is the secant method. The secant method is
illustrated in Figure 2. A secant is the straight line which passes through two points on the curve.
So, two initial approximations are required to initiate the secant method. It is required when the
derivative function, f'(x), is unavailable or time consuming to evaluate.[7] To approximate the
derivative by knowing the values of the function at point and the previous approximation is the
only way to avoid such problems.[1] In this method, the procedure is applied repetitively to
convergence.[7] The slope of the secant passes through two points, xk-1 and xk. Therefore, f(xk-1)
and f(xk), the derivative of f(xk) which is f'(xk) can be approximated as:[1]
f(xk ) − f(xk−1 )
f ′ (xk ) ≈
xk − xk−1
The general Newton-Raphson equation will be [1]
f(xk )(xk − xk−1 )
xk+1 ≈ xk −
f(xk ) − f(xk−1 )
The Secant method can be seen as:[1]
f(xk )(xk −xk−1 )
xk+1 = xk −
f(xk )−f(xk−1 )
Yadanabon University Research Journal 2022, Vol.12, No.2 363

The Secant formula for solving non-linear equations can be expressed as; [6]
(xk −xk−1 )
xk+1 = xk − f(xk )
f(xk )−f(xk−1 )

Figure 2. Secant Method


2.4. Algorithm for Secant Method
x0 , x1 : initial guesses
epsilon : error/tolerance
N: number of steps/calculations
For k=1 to N
f(xk )(xk −xk−1 )
xk+1 = xk − , (f(xk ) − f(xk−1 )) ≠ 0
f(xk )−f(xk−1 )
If |xk+1 − xk | ≤ epsilon, break.
2.5. Bisection Method
Bisection method is one of the simplest methods for finding a root of a nonlinear
equation.[7] The concept of this method is based on continuity. The root of a function, f(x) = 0, lies
in [x1, x2]. There is at least one root between x1 and x2, if f(x) is real and continuous and
f(x1). f(x2)< 0. Since two initial guesses for the root are required, this method is classified under
bracketing methods.[1] In bisection method, two estimates of the root, x = x1 and x = x2, which
bracket the root, must first be obtained, as illustrated in Figure 3. Set xm = (x1 + x2)/2. So, there
are two intervals (x1, xm) and (xm, x2). If f(x1)f(xm) < 0, the root is in the interval (x1, xm). Thus, set
x2 = xm and continue. If f(x1)f(xm) > 0, the root is in the interval (xm, x2). Thus, set x1 = xm and
continue. If f(x1)f(xm) = 0, it is the root and terminate the iteration.[7]
364 Yadanabon University Research Journal 2022, Vol.12, No.2

Figure 3. Bisection Method


2.6. Algorithm for Bisection Method
Step 1: Take the initial guesses x1 and x2 such that f(x1)f(x2) < 0 where y1=f(x1), y2=f(x2).
Step 2: Calculate the midpoint xm = (x1+x2)/2, and then ym=f(xm).
Step 3: If y1*ym < 0, then x1 = x1; x2 = xm .
If y1*ym > 0, then x1 = xm; x2 = x2 .
If y1*ym = 0 then the root of the function = xm .
Step 4: Find xm=(x1+x2)/2.
2.7. Tolerance criteria
To measure tolerance limits, measuring when a given iterate is "close enough" to the true
root is important in its own right. It powers significantly the number of times a given method
must be executed. There are a quantity of altered ways to measure how close an iterate xk is to a
root r for a given function f(x). To measure how close f(xk) is to the true root f(r).[5] Note f(r) = 0,
|f(xk)-f(r)| = |f(xk)| ≤ TOL, a given predefined tolerance.
This typical way can be used to measure absolute error.[5] Similarly, another form of
absolute error is,
|xk – xk-1| ≤ TOL

3. Results and Discussion


This study is comparing the rate of performance, rate of convergence of root findings of
Newton-Raphson, Secant and Bisection methods. It also shows an approach of calculation using
nonlinear equation and this is used for the iteration process with Microsoft Excel. To compare the
results of the three methods under investigation, the rates of convergence of the methods are in
the following. The solution of f(x) = 3x + sin x - ex using Newton Raphson method, Secant method
and Bisection method is computed in the form f(x) = 0 with a tolerance value of 10-5. Newton-
Raphson method starts with an initial guess that is close to the root. It requires the evaluation of
both the function f(x) and its derivative at every iterations. This implies that f'(x)= 3 + cos x - ex.[2]
Yadanabon University Research Journal 2022, Vol.12, No.2 365

So, Newton iteration takes about two functions evaluation per iteration. For Secant method, it
only requires the evaluation of f(x). For Bisection method, there is a continuous function f(x)=0
on a closed interval [x1, x2], i.e., f(x1)f(x2) < 0 , then, the function f(x)=0 has at least a root or zero
in the interval [x1, x2].

Table 1. Root of f(x) = 3x + sin x - ex Using Newton-Raphson Method with MS Excel.

Table 1 shows the iteration data obtained for Newton-Raphson method with the aid of
Microsoft Excel. It was observed in Table 1 that using the Newton-Raphson method, the function,
f(x)= 3x + sin x-ex = 0 converges to 0.360422 after the 3rd iteration with error 0.000000.
Table 2. Root of f(x) = 3x + sin x - ex Using Secant Method with MS Excel.
366 Yadanabon University Research Journal 2022, Vol.12, No.2

Table 2 shows the iteration data obtained for Secant method with the aid of MS Excel. It
was observed in Table 2 that using the Secant method, f(x)= 3x + sin x-ex = 0 converges to
0.360422 after the 5th iteration with error 0.000000.

Table 3. Root of f(x) = 3x + sin x - ex Using Bisection Method with MS Excel.

Table 3 shows the iteration data obtained for Bisection method with the aid of MS Excel. It was
observed in Table 3 that using the Bisection method, the function, f(x)= 3x+sin x-ex = 0 converges
to 0.360422 after the 21st iteration with error 0.000000.
Yadanabon University Research Journal 2022, Vol.12, No.2 367

Table 4. Comparing the results of the three methods under investigation.

As shown in Table 4, comparing the Newton-Raphson method and the Secant method,
Newton's method converges faster than Secant method. It can also be seen that the Bisection
method always converges on the root, but the rate of convergence is very slow. Again, comparing
the Secant method and the Bisection method, Secant method converges faster than Bisection
method.
0.600000

0.500000

0.400000

0.300000

0.200000
Newton-Raphson

Secant
0.100000
Bisection

0.000000
0 5 10 15 20
Figure 4. Comparison of the results of the three numerical methods
Figure 4 is shown comparing the results of the three methods under investigation. The
368 Yadanabon University Research Journal 2022, Vol.12, No.2

rates of convergence of the methods can be seen in the order: Bisection method > Secant
method > Newton-Raphson method in term of convergence. Therefore, the Newton-Raphson
method is the fastest method for converging on a single root of a function and it is the most
widely used method.

4. Conclusion
This paper intends to compare the performance in relation to the rate of convergence of
three numerical methods namely, the Bisection method, Newton Raphson method, and Secant
method. Furthermore, the basic objective of this system is to get the faster calculation time and
better performance of the MS Excel application for root finding methods. Manual calculation is
time consuming and prone to error, though it is important in understanding the procedure. The
advantage of using MS Excel is that it consumes less time to find the root and the familiar GUI of
Excel and the easy-to-use interface of Excel can provide the calculations as a very powerful and
useful tool. From the results obtained in the computations with the help of Microsoft excel,
Newton-Raphson method converges faster to the solution of the function compared to the other
methods. Moreover, this can be seen in the number of iterations taken by each of the methods to
converge to the solution. Therefore, it is clear that Newton-Raphson method is the best of the
three methods employed in solving nonlinear equations and this method converges faster to the
exact solution than other methods at each step of the iterations.

Acknowledgments
First of all, I wish to express my sincere thanks to Dr Tint Moe Thuzar (Rector), Dr U Khin Myo
(Pro-Rector), Dr Myint Myint Oo (Pro-Rector), and Dr Khin Maw Maw Soe (Pro-Rector), Yadanabon
University, for their kind permissions for the submission of this research paper. Finally, I would like to
express my sincere gratitude to Dr Pho Kaung, Rector(Retired), University of Yangon, for his enthusiastic
guidance and various suggestions.

References
1. Azure I., Aloliga G., Doabil L., ISSN: 2575-503X, Ghana, (2019), Comparative Study of Numerical Methods
for Solving Non-linear Equations Using Manual Computation.
2. Curtis F. Gerald, Patrick O. Wheatley, California Polytechnic State University, (2004), Applied Numerical
Analysis.
3. Djamila H., Faculty of Engineering, Universiti Malaysia Sabah, ICoAIMS, (2017), Excel spreadsheet in
teaching numerical methods.
4. Ehiwario, J.C., Aghamie, S.O., Department of Mathematics, College of Education, Agbor, Delta State.,
ISSN (e): 2250-3021, ISSN (p): 2278-8719 Vol. 04, Issue 04, (2014), Comparative Study of Bisection,
Newton-Raphson and Secant Methods of Root- Finding Problems.
Yadanabon University Research Journal 2022, Vol.12, No.2 369

5. Fuhrer C., Sopasakis A., FMN050, (2014), Newton-Raphson Method, Regula Falsi Method, Secant
Method, Fixed Point Method.
6. Jinadu, Adeleke O., Federal University of Agriculture, Abeokuta, (2014), Comparison of Newton, Secant
and Fixed-Point Iteration Methods in the Solution of Non-linear Equations.
7. Joe D. Hoffman, Department of Mechanical Engineering, Purdue University, West Lafayette, Indiana,
(2001), Numerical Methods for Engineer and Scientists.
M. El-Gebeily, B. Yushau, ISSN 1551-3440, Vol. 4, no.1, (2007), Numerical ethods with MS Excel.

You might also like