Lesson

Using the Slope: Newton–Raphson and the Secant Method

Finding the volatility implied by a real option price in a handful of steps: Newton-Raphson, the secant method, quadratic convergence, and when the slope misleads.

Last updated:


Warm-up: what do you already know?

1. What is the equation of the tangent line to ff at the point x0x_0⁠?

Solution

The tangent is the line through (x0,f(x0))(x_0,f(x_0)) with slope f′(x0)f'(x_0)⁠, so y=f(x0)+f′(x0)(x−x0)y=f(x_0)+f'(x_0)(x-x_0)⁠.

2. Bisection cuts the error by a factor of 2 at each step. How many steps does it take to gain one decimal digit, that is, to cut the error by a factor of 10?

Solution

After nn steps the error is smaller by a factor of 2n2^n⁠, and 2n≥102^n\ge10 when n≥log⁡210≈3.3n\ge\log_2 10\approx3.3⁠.
Four steps cut the error by 16 and three only by 8, so bisection gains one decimal digit every 3.3 steps on average.

A problem where the slope comes free

An option’s price depends on a number σ\sigma⁠, the volatility, which measures how much the underlying price is expected to jiggle.
A known formula turns σ\sigma into a price C(σ)C(\sigma)⁠. The market gives us the price, and we want the σ\sigma behind it.
A trading system has to compute it for thousands of options every time prices move, so every step saved in one computation is saved thousands of times.
Take a call option on the S&P 500 index (SPX) with strike 7650 that expires on 15 April 2027, 181 days ahead, so T=181365T=\tfrac{181}{365} years.
On Friday 16 October 2026 it was quoted at 422.8 (bid) and 428.4 (ask); we use the middle, 425.6.
Solve C(σ)=425.6C(\sigma)=425.6⁠. In the form we have been using,

f(σ)=C(σ)−425.6=0,C(σ)=D[F Φ(d1)−K Φ(d2)],f(\sigma)=C(\sigma)-425.6=0,\qquad C(\sigma)=D\left[F\,\Phi(d_1)-K\,\Phi(d_2)\right], d1=ln⁡(F/K)+12σ2TσT,d2=d1−σT,d_1=\frac{\ln(F/K)+\tfrac12\sigma^2 T}{\sigma\sqrt T},\qquad d_2=d_1-\sigma\sqrt T,

where K=7650K=7650 is the strike price, F=7805.06F=7805.06 is the price for delivery on the expiry date as the market sets it, D=0.97507D=0.97507 is the discount factor (what one unit of currency arriving on the expiry date is worth today), and Φ\Phi is the cumulative distribution function of the standard normal distribution, a library function.
New to options? The short note right below explains the finance.
For the numerical task, C(σ)C(\sigma) is a function we can evaluate, with a slope we can write down.

The finance in 20 seconds

An option is the right to buy at the strike price KK on the expiry date.
The higher the expected jiggle σ\sigma⁠, the more the right is worth, so CC grows with σ\sigma⁠.
The σ\sigma that reproduces today’s market price is the implied volatility:
the market’s own estimate of future movement. FF and DD are read from the market itself, from the prices of calls and puts at the same strikes, so no interest rate or dividend has to be assumed.
Quotes are from Interactive Brokers (delayed, frozen), from 16 October 2026.

We cannot solve for σ\sigma by hand, but bisection, from Bisection and Regula Falsi, works.
From the bracket [0.05,1][0.05,1] it needs 43 steps for a tolerance of 10−1010^{-10}⁠, and each step prices the option once.
Can we do much better? Here something helps: the slope of CC with respect to σ\sigma⁠, called vega, has a closed formula, D F φ(d1)TD\,F\,\varphi(d_1)\sqrt T⁠, where φ\varphi is the normal density.
The slope is free.

Work it out: suppose ff were a straight line through the point (x0,f(x0))(x_0,f(x_0)) with slope f′(x0)f'(x_0)⁠.
Where would it cross zero? How good would that point be for a curve that is nearly straight?

Solution

By the tangent equation from the warm-up, the line equals zero at x=x0−f(x0)f′(x0)x=x_0-\dfrac{f(x_0)}{f'(x_0)}⁠.
For a nearly straight curve this point is very close to the true root, and it is cheap:
one value and one slope.

Newton–Raphson: follow the tangent

Replace the curve by its tangent at the current point and jump to where the tangent crosses zero.
This is the Newton–Raphson method:

xn+1=xn−f(xn)f′(xn)x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}

Open the explorer, with Newton selected and the implied-volatility example (the start σ0\sigma_0 is 0.3):
drag the start x0x_0⁠, step, and watch the tangent lines walk toward the root.
The explorer also offers, as a second example, the yield of the bond from the bisection practice.

The explorer needs JavaScript. The tables below show the steps of the methods on the same problem.

Where the formula comes from, step by step, in a short video of mine (in Hebrew):

What Newton adds to bisection and regula falsi: it uses the slope, a first-order picture of the function, and no bracket.
The reward is speed. Starting from σ0=0.3\sigma_0=0.3 the true value is 0.162953752296910.16295375229691 (16.295%), and the errors are:

StepEstimateff at the estimateError
00.3286.71.4×10−11.4\times10^{-1}
10.163177186075950.4652.2×10−42.2\times10^{-4}
20.162953756463528.7×10−68.7\times10^{-6}4.2×10−94.2\times10^{-9}
30.162953752296913.0×10−153.0\times10^{-15}1.5×10−181.5\times10^{-18}

The answer to the question that opened the section: the implied volatility of the option is about 16.295%, and three Newton steps are enough to reach it, where bisection needs 43.

We measure how accurate an estimate is by its number of correct digits:
for an absolute error EE it is −log⁡10E-\log_{10}E⁠, so an error of 10−410^{-4} has 4 correct digits after the decimal point (the root here is 0.163, so the number of significant digits is a little smaller, about 0.8 less).
Write en=xn−x∗e_n=x_n-x^* for the error at step nn⁠, the difference between the estimate and the root x∗x^*⁠.
In the table, the error at step 0 has 0.9 correct digits and the error at step 1 has 3.7.

Work it out: (1) Write a formula that expresses en+1e_{n+1} in terms of ene_n and explains the correct digits in the table.
(2) Write such a formula for bisection too, which cuts the error by a factor of 2 at each step.

Candidate formulations
  1. “The new error is exactly the square of the previous one”, en+1=en2e_{n+1}=e_n^2⁠. Wrong already at the first step: (1.4×10−1)2≈2×10−2(1.4\times10^{-1})^2\approx2\times10^{-2}⁠, while the error in the table is 2.2×10−42.2\times10^{-4}⁠.
  2. “The new error is half the previous one”, en+1=12ene_{n+1}=\tfrac12e_n⁠. That is bisection, and it does not fit the table.
  3. “The new error is roughly the square of the previous one, times a constant”, ∣en+1∣≈C∣en∣2\lvert e_{n+1}\rvert\approx C\lvert e_n\rvert^{2}⁠. Compute ∣en+1∣/en2\lvert e_{n+1}\rvert/e_n^2 from the rows of the table and check whether it comes out constant (at the first step the start is still far from the root).
Solution
  1. ∣en+1∣≈C∣en∣2\lvert e_{n+1}\rvert\approx C\lvert e_n\rvert^{2} with a constant CC⁠. In the table the ratio ∣en+1∣/en2\lvert e_{n+1}\rvert/e_n^2 is about 0.080.08 at steps 2 and 3 (at step 1 it is 0.010.01⁠, because the start is still far from the root). The square alone, (2.2×10−4)2≈4.8×10−8(2.2\times10^{-4})^2\approx4.8\times10^{-8}⁠, gives 7.3 digits, and the actual error 4.2×10−94.2\times10^{-9} gives 8.4: one more digit thanks to C≈0.08C\approx0.08⁠, since −log⁡100.08≈1.1-\log_{10}0.08\approx1.1⁠.
  2. ∣en+1∣≈12∣en∣\lvert e_{n+1}\rvert\approx\tfrac12\lvert e_n\rvert⁠: the same form, with power 1 instead of 2.
The formal definition

A method has order of convergence qq when its errors en=xn−x∗e_n=x_n-x^* satisfy

lim⁡n→∞∣en+1∣∣en∣q=C≠0,\lim_{n\to\infty}\frac{\lvert e_{n+1}\rvert}{\lvert e_n\rvert^{q}}=C\neq0,

that is, ∣en+1∣≈C∣en∣q\lvert e_{n+1}\rvert\approx C\lvert e_n\rvert^{q} near the root. q=1q=1 is linear convergence and q=2q=2 is quadratic.

  • Bisection: the error bound εn\varepsilon_n is halved at each step, so q=1q=1 and C=12C=\tfrac12 for the bound, not for the error itself. The error itself need not shrink at every step: for x2−125x^2-\tfrac1{25} on [0,1][0,1] the errors at the first midpoints are 0.30.3⁠, 0.050.05 and 0.0750.075⁠, and the ratios of the errors are 16\tfrac16 and then 32\tfrac32⁠.
  • Newton–Raphson: the convergence is at least quadratic; of order exactly 2 when f′′(x∗)≠0f''(x^*)\neq0 (at a root where f′(x∗)≠0f'(x^*)\neq0⁠).
  • Secant: q=1+52≈1.618q=\tfrac{1+\sqrt5}{2}\approx1.618 (at a root where f′(x∗)≠0f'(x^*)\neq0⁠).

In the definition CC is finite; for linear convergence (q=1q=1⁠) also C<1C<1⁠.

Continuing with the table: the correct digits are 0.9, 3.7, 8.4 and 17.8, and the ratios between consecutive steps are 4.2, 2.3 and 2.1, approaching 2 as the iterates approach the root.
This is quadratic convergence, against the steady gain of a fixed number of digits per step of linear methods.

The errors in the table are computed in high-precision arithmetic.
A computer working in double precision keeps about 16 digits, and the evaluation of ff is itself rounded, so the same run in double precision ends with an absolute error of the order of 10−1710^{-17} (a relative error of about 10−1610^{-16}⁠), not 10−1810^{-18}⁠.
Below that level the limit is the arithmetic, not the method.

Newton’s cost is the conditions it needs: the derivative f′f'⁠, and a start near the root.
We look at three ways to fail, each in its own explorer.

A nearly zero slope. When the slope is nearly zero the tangent is almost horizontal and the next point is flung far away.
In the explorer choose the example “Newton from far”: starting at σ0=0.005\sigma_0=0.005 the option barely reacts to volatility, vega is about 2×10−42\times10^{-4} and the first step jumps to σ≈1.5\sigma\approx1.5 million, a nonsensical volatility.
Drag the start and step.

The explorer needs JavaScript. The paragraph above gives the first step of this failure.

A cycle. In the example “Newton cycles”, x3−2x+2x^3-2x+2 from 0, the method jumps between 0 and 1 forever, because the tangent at 0 leads to 1 and the tangent at 1 leads back to 0.
Step through it and drag the start.

The explorer needs JavaScript. The paragraph above describes the cycle.

Divergence. In the example “Newton diverges”, arctan⁡x\arctan x from 1.6, each step lands farther from the root at 0 than the one before and the method runs away.
Step through it and drag the start.

The explorer needs JavaScript. The paragraph above describes the divergence.

A full tutorial on the Newton–Raphson method, and a short video on running the iteration with the ANS and CALC keys of a scientific calculator:

Run Newton’s iteration yourself on the emulator, with the Ans key (the last answer), for f(x)=x2−2f(x)=x^2-2⁠:

A scientific calculator also has a built-in equation solver, the SOLVE function.
According to the manufacturer’s documentation it solves with Newton’s method, from the starting value you give it, so a good start matters here too:

Where does Newton land? The conditions Newton needs are about the start.
Try it: choose a function, drag the start along the axis, predict where the tangents lead (to which root, to a cycle, or away to infinity), and watch.
After a few predictions open the map of all starts: the boundaries between its bands are where a tiny change of start changes the outcome.

The lab needs JavaScript. The explorer above shows Newton’s method from a start of your choice.

The secant method: Newton without the derivative

Sometimes there is no formula for f′f'⁠: the price comes from a simulation, a table, or a program someone else wrote.
All we have are values of ff⁠.

Work it out: Newton’s formula contains f′(xn)f'(x_n)⁠. At the points xn−1x_{n-1} and xnx_n we know only f(xn−1)f(x_{n-1}) and f(xn)f(x_n)⁠.
What can replace f′(xn)f'(x_n)⁠?

Solution

The slope of the line through the two latest points: f′(xn)≈f(xn)−f(xn−1)xn−xn−1f'(x_n)\approx\dfrac{f(x_n)-f(x_{n-1})}{x_n-x_{n-1}}⁠.
Substituting into Newton’s formula, the quotient f(xn)f′(xn)\dfrac{f(x_n)}{f'(x_n)} becomes f(xn) xn−xn−1f(xn)−f(xn−1)f(x_n)\,\dfrac{x_n-x_{n-1}}{f(x_n)-f(x_{n-1})}⁠.

So we replace the tangent by the line through the two latest points.
A line through two points of a curve is called a secant line, hence the name of the method.
This is the secant method:

xn+1=xn−f(xn) xn−xn−1f(xn)−f(xn−1)x_{n+1}=x_n-f(x_n)\,\frac{x_n-x_{n-1}}{f(x_n)-f(x_{n-1})}

What it adds to Newton: it needs only values of ff⁠. What it adds to regula falsi:
no bracket, and it always keeps the two most recent points, so no endpoint stays fixed.
Its cost: it needs two starting points, it can diverge because nothing forces the root to stay inside, and it is slightly slower than Newton, with convergence order 1+52≈1.618\tfrac{1+\sqrt5}{2}\approx1.618 (the golden ratio) instead of 2.

Try it: with the secant method on f(x)=x2−2f(x)=x^2-2 from x0=2x_0=2 and x1=1.5x_1=1.5⁠, what is x2x_2⁠?

Solution

f(2)=2f(2)=2 and f(1.5)=0.25f(1.5)=0.25⁠, so x2=1.5−0.25⋅1.5−20.25−2=107≈1.42857x_2=1.5-0.25\cdot\dfrac{1.5-2}{0.25-2}=\dfrac{10}{7}\approx1.42857⁠, where the root is 2≈1.41421\sqrt2\approx1.41421 (an error of about 0.0140.014⁠).
For comparison, Newton from 1.51.5 gives 1712≈1.41667\tfrac{17}{12}\approx1.41667⁠.

Counting steps to reach 10−1010^{-10} on the two problems of this unit, by the explorer’s rule:

MethodBond yieldImplied volatility
Bisection3943
Regula falsi165
Secant85
Newton–Raphson53

The explorer below runs all four methods on the bond from the bisection practice and on the implied volatility; select the secant method and watch it move on its two latest points.

The explorer needs JavaScript. The table above shows the number of steps of the four methods.

The explorer’s rule stops when both the step and ∣f∣|f| are below 10−1010^{-10}⁠.
(Brackets [0,0.2][0,0.2] for the bond and [0.05,1][0.05,1] for the volatility; the secant method starts from the two ends of the bracket, Newton from 0.10.1 and 0.30.3⁠.) Press Compare all methods to see the four error curves together.

Steps are not the whole cost. Newton evaluates ff and f′f' at every step, the secant method only ff⁠, so a secant step can be cheaper.
By how much depends on the problem: if f′f' costs as much as ff the saving is about half, but when f′f' reuses work already done for ff it costs little extra and the saving is small (as vega does in the option example, which reuses d1d_1⁠).
To compare methods fairly, we count evaluations of ff and of f′f' and measure the running time on our own function.
A method of order qq multiplies the number of correct digits by qq in each step; if a step needs cc evaluations, the factor per evaluation is q1/cq^{1/c}⁠.

Calculate: when f′f' costs as much as ff⁠, how many evaluations does a step of Newton need, and how many a step of the secant method?
What is the factor per evaluation of each, and which method gains digits faster per evaluation of ff⁠?

Solution

Newton has c=2c=2 and q=2q=2⁠, so its factor is 21/2≈1.4142^{1/2}\approx1.414⁠. The secant method has c=1c=1 and q=1+52q=\tfrac{1+\sqrt5}{2}⁠, so its factor is ≈1.618\approx1.618⁠, larger:
per evaluation of ff⁠, the secant method gains digits faster.

The ladder so far

MethodUsesConvergenceNeedsMain risk
Bisectionsignslinear, halves the errora bracketslow
Regula falsivalues, a chordusually fastera bracketan end gets stuck
Secantvalues, two latest pointsorder 1.62two startsmay diverge
Newton–Raphsonvalues and slopeorder 2, digits doublef′f' and a good startflat slope, cycles, divergence

In practice, scientific libraries combine them: a safe bracket for the guarantee and a fast method for the speed, as in Brent’s method (SciPy’s brentq).

Continue learning

The next step is the practice session for this lecture: a table by hand, the usual mistakes, transfer questions and a Python implementation.

Repeating a Rule looks at fixed-point iteration, the idea behind many iterative methods, and at inverse quadratic interpolation, which together with bisection forms the Brent method used in practice.
For a deeper look at the model behind the example, see John Hull’s textbook on options and derivatives; the numerical method is the same on any function you can evaluate.

My tutorial on fixed-point iteration, and on the multidimensional Newton–Raphson method: