The general idea is that you pick two points close to the actual solution (these are generally denoted x1 and x2 or, equivalently, xi and xi – 1. Then, draw a secant line between those two points. The approximation for the root will be where the secant line crosses the x-axis:
The point where the secant line crosses the x-axis is used as a new second point in an iterative process for finding the root.
Formulas for the Secant Method
The root is where f(x) = 0, so you:
- Plug your values for xi and xi-1 into the formula,
- Set y = 0,
- Solve for x,
- Use that value for x in the next iteration.
The iteration formula is (Gomes, 2009):
For example, let’s say you wanted to find the root for f(x) = x4 – 5.
- Make a guess for your initial points: (1, 2).
- Find the function values at those points:
- f(1) = 14 – 5 = -4
- f(2) = 24 – 5 = 11
- Plug your values into the formula:
- Plug your value from Step 3 into the function to find its value at that point (x3:
- f(19/15) = (19/15)4 – 5 ≈ 1.267
- Use (x2, x3) in the next iteration, repeating the steps above (from 2 onward).
You probably won’t have to work the formulas by hand, because many applications have built in functions (you will have to make an initial guess, which you can usually obtain by graphing the function). For example, in R (Asar, 2020):
secant(fun, x0, x1, eps, maxit = 20, silent = FALSE)
- fun = the function you’re trying to find the root for,
- x0 = first value (initial guess)
- x1 = second value (initial guess)
- eps = tolerance for the algorithm’s convergence
- maxit = maximum number of iterations
- silent = logical statement which decides if the iterations should be printed (or not)
If you do have to work the process by hand, the following video walks you through an example:
Secant Method Advantages and Disadvantages
It tends to give better results than the regula-falsi (false position) method (Jain, 2003). It also usually converges faster than the bisection method.
One disadvantage of the secant method is that, unlike the regula-falsi method, it doesn’t always converge (Jain, 2003). In addition, the method will fail if, at any stage, f(xn) = f(xn – 1).
Asar, O. (2020). Secant: A Function To Find Roots Of Univariate Functions. Retrieved August 8, 2020 from: https://www.rdocumentation.org/packages/OOmisc/versions/1.2/topics/secant
Gomes, A. (2009). Implicit Curves and Surfaces: Mathematics, Data Structures and Algorithms. Springer London.
Jain, M. Numerical Methods For Scientific And Engineering Computation. New Age International (P) Limited.
Young, T. (2020). Lecture 6: Secant Methods. Retrieved August 8, 2020 from: http://www.ohiouniversityfaculty.com/youngt/IntNumMeth/lecture6.pdf
Stephanie Glen. "Secant Method: Definition, Example" From CalculusHowTo.com: Calculus for the rest of us! https://www.calculushowto.com/secant-method-definition-example/
Need help with a homework or test question? With Chegg Study, you can get step-by-step solutions to your questions from an expert in the field. Your first 30 minutes with a Chegg tutor is free!