Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

 Open In Colab

Secant method

Let’s reconsider the method of False Position but now we always disregard bracket updating and simply take cc as our new guess. Our algorithm is now:

Take 2 initial guesses: xix^i

Calculate the next guess:

xi+1=xi−f(xi)xi−xi−1f(xi)−f(xi−1)x^{i+1} = {x^i} - f(x^{i}) \frac{x^i-x^{i-1}}{f(x^i)-f(x^{i-1})}

Check if tolerance is met

(Which tolerance?)

The Newton-Raphson method

The Secant method maintains superlinear convergence... but we can do better with a little more information...

Take another look at the fraction in the Secant method update equation:

xi+1=xi−f(xi)xi−xi−1f(xi)−f(xi−1)x^{i+1} = {x^i} - f(x^{i}) \frac{x^i-x^{i-1}}{f(x^i)-f(x^{i-1})}

This is an (inverse) approximation of ∂f∂x\frac{\partial f}{\partial x}, the derivative of ff! Typically, we are able to find this quantity, and the algorithm becomes:

xi+1=xi−f(xi)f′(xi)x^{i+1} = {x^i} - \frac{f(x^{i})}{f'(x^i)}

or, solving for the increment Δx=xi+1−xi\Delta x = x^{i+1}-x^i and dropping the indicies,

Δx=−f(x)f′(x)f′(x)Δx=−f(x)\begin{align} \Delta x &= - \frac{f(x)}{f'(x)} \\ f'(x) \Delta x &= - f(x) \end{align}

Interactive Comparison

The Newton-Raphson method has quadratic convergence (k=2k=2) near the root which is a great result! It does so, however at the cost of calculating the Jacobian and solving a linear system.

Non-converging example