# Solving equations using the Newton-Raphson method

Published in

The Newton-Raphson method is a numerical method to solve equations of the form f(x) = 0.

This method requires us to also know the first differential of the function. But the Newton-Raphson method has very good convergence, so it can often provide an accurate result very quickly.

# Example — square root of two using Newton-Raphson method

As a simple example, we will solve the equation:

This equation has a solution x = √2 (and a second solution x = -√2). We will only look for the first solution. Although we already know the answer to the problem, it is still useful to work through the numerical solution to see how it works (and to gain an approximate value for the square root of 2).

To use the technique we need to have a rough idea of where the solution is. It is useful to sketch a graph of the function:

The Newton-Raphson method starts with an initial guess at the solution. The guess doesn’t need to be particularly accurate, we can just use the value 2.

The Newton-Raphson method proceeds as follows: