FACTOID # 60: Japan's water has a very high dissolved oxygen concentration - but not enough to prevent drowning in the bath.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > Secant method

In numerical analysis, the secant method is a root-finding algorithm that uses a succession of roots of secant lines to better approximate a root of a function f. Numerical analysis is the study of algorithms for the problems of continuous mathematics (as distinguished from discrete mathematics) using basic arithmetical operations like addition. ... A root-finding algorithm is a numerical method or algorithm for finding a value x such that f(x) = 0, for a given function f. ... In mathematics, a root (or a zero) of a function f is an element x in the domain of f such that f(x) = 0. ... Secant is a term in mathematics. ... In mathematics, a root (or a zero) of a function f is an element x in the domain of f such that f(x) = 0. ...

Contents


The method

The secant method is defined by the recurrence relation Recurrent redirects here; for the meaning of recurrent in contemporary hit radio, see Recurrent rotation. ...

x_{n+1} = x_n - frac{x_n-x_{n-1}}{f(x_n)-f(x_{n-1})} f(x_n).

As can be seen from the recurrence relation, the secant method requires two initial values, x0 and x1, which should ideally be chosen to lie close to the root.


Derivation of the method

Illustration of the secant method. The red curve shows the function f and the blue line is the secant
Illustration of the secant method. The red curve shows the function f and the blue line is the secant

Given a and b, we construct the line through the points (a, f(a)) and (b, f(b)), as demonstrated in the picture on the right. Note that this line is a secant or chord of the graph of the function f. In point-slope form, it can be defined as Image File history File links Illustration of the secant method. ... Secant is a term in mathematics. ... Look up Slope in Wiktionary, the free dictionary In mathematics, the slope or the gradient of a straight line (within a Cartesian coordinate system) is a measure for the steepness of the line relative to the horizontal axis. ...

y - f(b) = frac{f(b)-f(a)}{b-a} (x-b).

We now choose c to be the root of this line, so c is chosen such that

f(b) + frac{f(b)-f(a)}{b-a} (c-b) = 0.

Solving this equation gives the recurrence relation for the secant method. The new value c is equal to xn+1, and b and a are xn and xn−1, respectively.


Convergence

The iterates xn of the secant method converge to a root of f, if the initial values x0 and x1 are sufficiently close to the root. The order of convergence is φ, where In numerical analysis (a branch of mathematics), the speed at which a convergent sequence approaches its limit is called the rate of convergence. ...

varphi = frac{1+sqrt{5}}{2} approx 1.618

is the golden ratio. In particular, the convergence is superlinear.


Of course, this result only hold under some technical conditions, namely: f is twice continuously differentiable and the root in question is a simple root.


Comparison with other root-finding methods

The secant method does not require that the root remain bracketed like the bisection method does. The false position method, which is based on the secant method, avoids this problem by checking the brackets at each step. A few steps of the bisection method applied over the starting range [a1;b1]. The red dot is the root of the function. ... In numerical analysis, the false position method or regula falsi method is a root-finding algorithm that combines features from the bisection method and the secant method. ...


The recurrent formula of the secant method can be derived from the formula for Newton's method In numerical analysis, Newtons method (or the Newton-Raphson method) is an efficient algorithm for finding approximations to the zeros (or roots) of a real-valued function. ...

x_{n+1} = x_n - frac{f(x_n)}{f'(x_n)}

by using the finite difference approximation In mathematics, a finite difference is like a differential quotient, except that it uses finite quantities instead of infinitesimal ones. ...

f'(x_n) approx frac{f(x_n)-f(x_{n-1})}{x_n-x_{n-1}}.

If we compare Newton's method with the secant method, we see that Newton's method converges faster (order 2 against φ ≈ 1.6). However, Newton's method requires the evaluation of both f and its derivative at every step, while the secant method only requires the evaluation of f. Therefore, the secant method may well be faster in practice. For instance, if we assume that evaluating f takes as much time as evaluating its derivative and we neglect all other costs, we can do two steps of the secant method (decreasing the error by a factor φ² ≈ 2.6) for the same cost as one step of Newton's method (decreasing the error by a factor 2), so the secant method is faster.


Example code

The following C code was written for clarity instead of efficiency. It was designed to solve the same problem as solved by the Newton's method and false position method code: to find the positive number x where cos(x) = x3. This problem is transformed into a root-finding problem of the form f(x) = cos(x) − x3 = 0. The C Programming Language, Brian Kernighan and Dennis Ritchie, the original edition that served for many years as an informal specification of the language The C programming language is a standardized imperative computer programming language developed in the early 1970s by Dennis Ritchie for use on the Unix operating system. ... In numerical analysis, Newtons method (or the Newton-Raphson method) is an efficient algorithm for finding approximations to the zeros (or roots) of a real-valued function. ... In numerical analysis, the false position method or regula falsi method is a root-finding algorithm that combines features from the bisection method and the secant method. ...


In the code below, the secant method continues until one of two conditions occur:

  1. | xn + 1xn | < e
  2. n > m

for some given m and e.

 #include <stdio.h> #include <math.h> double f(double x) { return cos(x) - x*x*x; } double SecantMethod(double xn_1, double xn, double e, int m) { int n; double d; for (n = 1; n <= m; n++) { d = (xn - xn_1) / (f(xn) - f(xn_1)) * f(xn); if (fabs(d) < e) return xn; xn_1 = xn; xn = xn - d; } return xn; } int main(void) { printf("%0.15fn", SecantMethod(0, 1, 5E-11, 100)); return 0; } 

After running this code, the final answer is approximately 0.865474033101614. The initial, intermediate, and final approximations are listed below:

x_0 = 0 ,!
x_1 = 1 ,!
x_2 = 0.685073357326045 ,!
x_3 = 0.841355125665652 ,!
x_4 = 0.870353470875526 ,!
x_5 = 0.865358300319342 ,!
x_6 = 0.865473486654304 ,!
x_7 = 0.865474033163012 ,!
x_8 = 0.865474033101614 ,!

The following graph shows the function f in red and the last secant line in blue. In the graph, the x-intercept of the secant line seems to be a good approximation of the root of f.

Image:Secantmethod_jaredwf.png

Image File history File links Example of a resulting secant line from the secant method that I created using gnuplot. ...

External link

  • Secant method of zero (root) finding on Mathcad Application Server

  Results from FactBites:
 
Secant method - Wikipedia, the free encyclopedia (480 words)
In numerical analysis, the secant method is a root-finding algorithm that uses a succession of roots of secant lines to better approximate a root of a function f.
The secant method does not require that the root remain bracketed like the bisection method does.
The false position method, which is based on the secant method, avoids this problem by checking the brackets at each step.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.