Skip to content
Tutorials Center
My learning

Topics

Lesson 12 of 37 ยท Root Finding

Secant and False-Position Methods

Find roots without derivatives: the secant method and the regula falsi (false position) method, with Python code, convergence rates and the Illinois improvement.

Newton's method is fast but demands the derivative f'. Often the derivative is unavailable, expensive or messy to code. The secant method removes that requirement by replacing the tangent line with a line through the two most recent points. Its cousin, regula falsi (false position), uses a secant line too but keeps a bracketing interval like bisection.

Both methods give a useful middle ground: faster than bisection, and needing only function values. This lesson builds both, measures their convergence, and shows the trick that fixes false position's main weakness.

The secant method

Given two guesses x_(k-1) and x_k, draw the line through (x_(k-1), f(x_(k-1))) and (x_k, f(x_k)) and take its x-intercept as the next guess:

x_(k+1) = x_k - f(x_k) (x_k - x_(k-1)) / (f(x_k) - f(x_(k-1)))

This is Newton's formula with the derivative replaced by the slope of the secant line, (f(x_k) - f(x_(k-1))) / (x_k - x_(k-1)). Each step needs just one new function evaluation, because the previous value is reused.

Python The secant method

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

It uses a handful more steps than Newton but no derivative. Compared with Newton's quadratic convergence (order 2), the secant method has order (1 + โˆš5)/2 โ‰ˆ 1.618, the golden ratio. That is superlinear: slower than Newton per step, but each step is cheaper (one function call versus a function and a derivative), so per unit of work the secant method often wins.

Python Estimate the secant method's order

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The estimates are noisy at first but hover around 1.6, as predicted.

The false-position method (regula falsi)

The secant method does not keep a bracket, so, like Newton, it can fly off. Regula falsi fixes that: it still uses the secant line through (a, f(a)) and (b, f(b)), but then keeps whichever of the two sub-intervals has the sign change, exactly as bisection does.

The new point is c = (a f(b) - b f(a)) / (f(b) - f(a)). It is guaranteed to lie between a and b, so the bracket is never lost.

Python Regula falsi

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Regula falsi is guaranteed to converge for continuous functions, like bisection, and is usually much faster. But it has a well-known weakness.

The stalling problem and the Illinois fix

If the function is strongly convex or concave on the bracket, one endpoint can stay fixed forever while the other creeps towards the root. The interval then never shrinks to zero width, and convergence degrades to merely linear (sometimes painfully slow).

Python Regula falsi stalls; Illinois repairs it

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The Illinois modification notices when the same endpoint is retained twice in a row and halves its stored function value. That tilts the next secant line and releases the stuck end, restoring superlinear convergence (order about 1.44) with no extra function calls. It is a tiny change with a big payoff.

Choosing among the root finders

Method Needs Guaranteed? Order Cost per step
Bisection bracket yes 1 1 f
Regula falsi bracket yes 1 (stalls) 1 f
Illinois bracket yes about 1.44 1 f
Secant two guesses no 1.618 1 f
Newton f', one guess no 2 f and f'
flowchart TD
    A["Need a root"] --> B{"Can you bracket it?"}
    B -->|"yes"| C{"Want a guarantee<br/>and speed?"}
    C -->|"yes"| D["Brent / Illinois"]
    C -->|"simplest"| E["Bisection"]
    B -->|"no"| F{"Derivative<br/>available?"}
    F -->|"yes"| G["Newton"]
    F -->|"no"| H["Secant"]

A practical decision guide for single-variable root finding.

The professional answer, Brent's method, combines bisection, secant and inverse quadratic interpolation to get guaranteed convergence with near-secant speed. You will use it from SciPy in the next lesson.

A degenerate case for the secant method is f(x_k) = f(x_(k-1)): the secant line is horizontal and the division fails. Always check for it, and keep the two guesses distinct.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What does the secant method replace in Newton's formula?

    The slope (f(x_k) - f(x_(k-1))) / (x_k - x_(k-1)) approximates f'(x_k).
  2. 2. What is the order of convergence of the secant method?

    It is superlinear: faster than linear, a bit slower than Newton per step.
  3. 3. How does regula falsi differ from the secant method?

    False position retains the sub-interval where the sign changes, like bisection.
  4. 4. What does the Illinois modification do?

    By halving f at the stuck endpoint, the next secant line moves closer to the root.
  5. 5. Why can the secant method be cheaper than Newton overall even though it takes more steps?

    Cost is per function evaluation: the secant method reuses the previous value and needs no derivative.

Summary

  • The secant method approximates the derivative by the slope through two points; order about 1.618; no bracket, can diverge.
  • Regula falsi uses the secant line but keeps a bracket, so it always converges; plain version may stall with one fixed endpoint.
  • The Illinois trick (halve f at a repeated endpoint) repairs stalling.
  • Pick bracketing methods for safety, Newton when f' is cheap, secant when it is not.
  • Brent's method, the standard library choice, mixes all of these ideas.

Next: Fixed-Point Iteration and Root Finding with SciPy