4.8.9Numerical Methods

Secant method

1,782 words8 min readdifficulty · medium3 backlinks

WHAT is the Secant method?

WHY two starting points? Because we need two points to define a line. Newton needed one point plus a slope; we trade the slope for a second point.


HOW — derive it from first principles

We never dump the formula. Let's build it.

Step 1 — Write the secant line. We have two points on the curve: Pn1=(xn1,f(xn1)),Pn=(xn,f(xn)).P_{n-1}=(x_{n-1}, f(x_{n-1})), \qquad P_n=(x_n, f(x_n)). Why this step? These are the two most recent guesses — we use the latest information.

Step 2 — Slope of the chord. The slope mm of the line through them is m=f(xn)f(xn1)xnxn1.m = \frac{f(x_n) - f(x_{n-1})}{x_n - x_{n-1}}. Why this step? This is the rise-over-run of the secant — it approximates f(xn)f'(x_n). (Compare Newton, which uses the exact f(xn)f'(x_n).)

Step 3 — Equation of the line through PnP_n with slope mm: yf(xn)=m(xxn).y - f(x_n) = m\,(x - x_n).

Step 4 — Where does it cross the xx-axis? Set y=0y=0 and call that x=xn+1x = x_{n+1}: 0f(xn)=m(xn+1xn).0 - f(x_n) = m\,(x_{n+1} - x_n). Why this step? A root is where f=0f=0; the line's xx-intercept is our best linear guess for that root.

Step 5 — Solve for xn+1x_{n+1}: xn+1xn=f(xn)m=f(xn)(xnxn1)f(xn)f(xn1).x_{n+1} - x_n = -\frac{f(x_n)}{m} = -\frac{f(x_n)(x_n - x_{n-1})}{f(x_n)-f(x_{n-1})}. xn+1=xnf(xn)xnxn1f(xn)f(xn1)\boxed{\,x_{n+1} = x_n - f(x_n)\,\dfrac{x_n - x_{n-1}}{f(x_n) - f(x_{n-1})}\,}

Figure — Secant method

The connection to Newton's method


How fast does it converge?

  • Newton: p=2p=2 (quadratic).
  • Secant: p=1+52==1.618==p = \dfrac{1+\sqrt 5}{2}\approx ==1.618== (the golden ratio!) — superlinear but below quadratic.

WHY 1.618? The error recurrence for Secant is en+1Kenen1e_{n+1}\approx K\,e_n e_{n-1} (proved below). Assume en+1=Aenpe_{n+1}=A e_n^p. Then en=Aen1pen1=(en/A)1/pe_n = A e_{n-1}^p \Rightarrow e_{n-1}=(e_n/A)^{1/p}. Substituting: Aenp=Ken(en/A)1/p.A e_n^{p} = K\, e_n\, (e_n/A)^{1/p}. Matching powers of ene_n: p=1+1pp2p1=0p=1+52.p = 1 + \tfrac1p \Rightarrow p^2 - p - 1 = 0 \Rightarrow p=\frac{1+\sqrt5}{2}.


Worked Example 1 — f(x)=x22f(x)=x^2-2 (root 21.41421\sqrt2\approx1.41421)

Take x0=1, x1=2x_0=1,\ x_1=2.

Iteration 1: f(1)=1, f(2)=2f(1)=-1,\ f(2)=2. x2=22212(1)=223=1.3333.x_2 = 2 - 2\cdot\frac{2-1}{2-(-1)} = 2 - \frac{2}{3} = 1.3333. Why this step? Plug the two latest points into the boxed formula.

Iteration 2: f(1.3333)=0.2222f(1.3333)=-0.2222. x3=1.3333(0.2222)1.333320.22222=1.3333(0.2222)0.66672.2222=1.4.x_3 = 1.3333 - (-0.2222)\cdot\frac{1.3333-2}{-0.2222-2} = 1.3333 - (-0.2222)\cdot\frac{-0.6667}{-2.2222}=1.4.

Iteration 3: f(1.4)=0.04f(1.4)=-0.04. x4=1.4(0.04)1.41.33330.04(0.2222)1.41463.x_4 = 1.4 - (-0.04)\cdot\frac{1.4-1.3333}{-0.04-(-0.2222)} \approx 1.41463.

Errors: 0.0810.0140.000420.081 \to 0.014 \to 0.00042 — note each step the number of correct digits roughly multiplies by 1.6.


Worked Example 2 — f(x)=cosxxf(x)=\cos x - x (root 0.73909\approx 0.73909)

No nice derivative needed. Take x0=0, x1=1x_0=0,\ x_1=1. f(0)=1, f(1)=cos11=0.4597.f(0)=1,\ f(1)=\cos1-1=-0.4597. x2=1(0.4597)100.45971=1(0.4597)(0.6850)=0.6851.x_2 = 1 - (-0.4597)\cdot\frac{1-0}{-0.4597-1}=1-(-0.4597)(-0.6850)=0.6851. Why this step? Same recipe; Secant doesn't care that cosxx\cos x-x has no simple closed-form root. Continuing gives x30.7363x_3\approx 0.7363, x40.7391x_4\approx 0.7391 — converging to 0.739090.73909.


Common mistakes (steel-manned)


Recall Feynman: explain it to a 12-year-old

Imagine a hill where the height is zero exactly at the spot you want to find. You stand at two spots and measure how high you are at each. Draw a straight ruler connecting those two heights. Where the ruler touches the ground (zero height) is your next guess — walk there, drop the older of your two spots, measure again, and draw a new ruler. Each ruler is straighter and closer to the magic zero-spot, so after a few tries you basically land on it. The clever part: you never need to know how steep the hill is — just two heights are enough.


Active-recall flashcards

Secant method iteration formula
xn+1=xnf(xn)xnxn1f(xn)f(xn1)x_{n+1} = x_n - f(x_n)\dfrac{x_n-x_{n-1}}{f(x_n)-f(x_{n-1})}
How many starting points does the Secant method need?
Two (x0x_0 and x1x_1).
Does the Secant method require the derivative f(x)f'(x)?
No — it approximates it with a finite difference (chord slope).
What is the order of convergence of the Secant method?
The golden ratio, p=1+521.618p=\frac{1+\sqrt5}{2}\approx 1.618 (superlinear).
Secant vs Newton: what's replaced?
f(xn)f'(x_n) is replaced by f(xn)f(xn1)xnxn1\frac{f(x_n)-f(x_{n-1})}{x_n-x_{n-1}}.
Is the Secant method a bracketing method?
No, it's an open method — no guaranteed convergence and the iterate can leave the interval.
Difference between Secant and Regula Falsi?
Secant always uses the two latest points (order 1.618, no bracketing); Regula Falsi keeps a point that brackets the root (bounded but only linear).
Why can Secant be more efficient per evaluation than Newton?
It needs only one new ff-evaluation per step (no ff'); two Secant steps (1.61822.61.618^2\approx2.6) can beat one Newton step (22).
What causes numerical blow-up in the Secant formula?
Denominator f(xn)f(xn1)0f(x_n)-f(x_{n-1})\to 0 when consecutive function values are nearly equal.
Error recurrence that gives the order
en+1Kenen1e_{n+1}\approx K\,e_n e_{n-1}, leading to p2p1=0p^2-p-1=0.

Connections

  • Newton-Raphson method — Secant is its derivative-free cousin.
  • Regula Falsi (False Position) — same line formula, keeps bracketing.
  • Bisection method — guaranteed but only linear; contrast in safety vs speed.
  • Order of convergence — defines the p=1.618p=1.618 result.
  • Fixed point iteration — broader family of iterative root-finders.
  • Finite differences — the chord slope is a finite-difference derivative.

Concept Map

needs derivative

ugly or costly

motivates

uses

through two points

x-intercept gives

slope = rise over run

approximates

replaces f prime with slope

rearranges to

order of convergence

order

Newton-Raphson method

f prime x

Derivative problem

Secant method

Secant line / chord

Two guesses x0 x1

Iteration formula

Chord slope m

Weighted average form

p approx 1.618

p = 2 quadratic

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, Secant method ka core idea bahut simple hai. Newton-Raphson mein humein har step pe derivative f(x)f'(x) chahiye hota hai, lekin kabhi-kabhi derivative nikalna mushkil ya expensive hota hai. To Secant kehta hai — "derivative ki tension hi kyun lo? Do points le lo curve pe, unke beech ek seedhi line (chord/secant) kheencho, aur dekho woh line xx-axis ko kahan kaatti hai. Wahi tumhara next guess hai." Bas isi liye humein do starting points x0x_0 aur x1x_1 chahiye — ek line banane ke liye do points lagte hain na.

Formula yaad rakhna easy hai: xn+1=xnf(xn)xnxn1f(xn)f(xn1)x_{n+1}=x_n - f(x_n)\cdot\frac{x_n-x_{n-1}}{f(x_n)-f(x_{n-1})}. Yeh actually Newton ka hi formula hai, bas f(xn)f'(x_n) ki jagah humne chord ka slope ΔfΔx\frac{\Delta f}{\Delta x} daal diya. Aur ek mast baat — yeh slope, jaise-jaise do points paas aate hain, exact derivative ban jaata hai (derivative ki definition yahi to hai).

Speed ke maamle mein Secant ka order 1.6181.618 hai (golden ratio!), jo Newton ke 22 se thoda kam hai — lekin har step mein sirf ek naya ff evaluate karna padta hai, derivative nahi. Isliye jab derivative mehenga ho, Secant practically Newton ko bhi beat kar deta hai. Ek important warning: Secant ek "open" method hai, matlab bisection ki tarah root ko bracket karke guarantee nahi deta — iterate kabhi-kabhi bahar bhi jaa sakta hai, aur agar denominator f(xn)f(xn1)f(x_n)-f(x_{n-1}) zero ke paas chala gaya to formula phat sakta hai. Isiliye code mein hamesha tolerance aur max-iteration ka guard lagao.

Go deeper — visual, from zero

Test yourself — Numerical Methods

Connections