Alexander Bass
This note is one of many taken during 2026

On Newton’s Method

Newton’s method allows finding the ‘root’ of a function (where it is zero), given conditions expressed in the wikipedia article no doubt.

More than this however, it can be used to find the inverse of a function. The common example is 2\sqrt{2}. If you know xx where x22=0x^2-2=0, then you know 2\sqrt{2}.

The rough gist of the algorithm is as follows.

  1. Take a function like f(x)=x22f(x) = x^2-2
  2. Make an arbitrary guess on the value of xx where f(x)=0f(x)=0, g0g_0
  3. Evaluate f(x)f(x) at g0g_0 and find the line tangent to f(x)f(x) at g0g_0
  4. Find the x-intercept of the tangent line. This x-intercept value is g1g_1
  5. Repeat steps 2…5 (incrementing nn throughout) until a satisfactory precision is obtained.

Algebraically, we start with the function and its derivative:

f(x)=x22f(x)=2x \begin{aligned} f(x)&=x^2-2 & f'(x)&=2x \end{aligned}

And make a guess g0g_0 and create the tangent line at that guess location on f(x)f(x)

y=f(g0)x+b y = f'(g_0)x + b

find bb by evaluating at g0g_0:

f(g0)g0+b=f(g0) f'(g_0)g_0 + b = f(g_0) b=f(g0)f(g0)g0 b = f(g_0) - f'(g_0)g_0

Which finishes the line equation as:

y=f(g0)x+f(g0)f(g0)g0 y = f'(g_0)x + f(g_0) - f'(g_0)g_0

Next, find the x-coordinate by evaluating at y=0y=0

0=f(g0)x+f(g0)f(g0)g0f(g0)g0f(g0)=f(g0)xg0f(g0)f(g0)=x \begin{aligned} 0 &= f'(g_0)x + f(g_0) - f'(g_0)g_0\\ f'(g_0)g_0-f(g_0) &= f'(g_0)x\\ g_0 - \frac{f(g_0)}{f'(g_0)} &= x \end{aligned}

As stated above, this xx value is actually g1g_1, or generally

gn+1=gnf(gn)f(gn) g_{n+1} = g_n - \frac{f(g_n)}{f'(g_n)}

Going back the case of 2\sqrt{2}, we substitute in the function

gn+1=gngn222gn g_{n+1} = g_n - \frac{{g_n}^2-2}{2g_n}

With gn=5g_n=5 we see the first four approximations as:

g0=5g1=2.7g21.7204g31.4415g41.4145 \begin{array}{ccc} g_0 &= &5\\ g_1 &= &2.7\\ g_2 &\approx &1.7204\\ g_3 &\approx &1.4415\\ g_4 &\approx &1.4145\\ \end{array}

Generally…

This process is easily generalized to finding inverses instead of roots — just as in the 2\sqrt{2} example.

f(x)f(x) was previously defined as x22x^2-2, but more generically is described as f(x)=x2f(x)=x^2. Then, inside the recursive equation, the 2-2 is placed outside the function

gn+1=gnf(gn)2f(gn) g_{n+1} = g_n - \frac{f(g_n) - 2}{f'(g_n)}

The above gn+1g_{n+1} approximates f1(2)f^{-1}(2). the 22 is replaced with some constant cc to find f1(c)f^{-1}(c):

The generic case for c\sqrt{c} then is:

gn+1=gngn2c2gn g_{n+1} = g_{n} - \frac{{g_n}^2 -c}{2g_n}

Or

gn+1=gngn2c2gnlimngn=c \begin{aligned} g_{n+1} &= g_n - \frac{{g_n}^2-c}{2g_n}\\ \lim_{n \to \infty} {g_{n}} &= \sqrt{c} \end{aligned}

One way to loosely verify this is to: consider that when nn approaches \infty, the differences between gng_n and gn+1g_{n+1} will grow increasingly smaller (assuming the limit does indeed converge) and indeed will be come so close that we can consider them to be equal. So, we set gn+1=gn=xg_{n+1} = g_n = x and solve:

x=xx2c2xx2c2x=0x2=cx=c \begin{aligned} x &= x - \frac{x^2-c}{2x}\\ \frac{x^2-c}{2x} &= 0 \\ x^2 &= c\\ x &= \sqrt{c} \end{aligned}

Other inverses

This method can be extended to other functions. Some examples:

ln(x)gn+1=gn1+xegnlog2(x)gn+1=gn1+x2gnln(2)xgn+1=gngn+x \begin{array}{rcl} \ln(x) & \Rightarrow & g_{n+1} = g_n - 1 + \frac{x}{e^{g_n}} \\ \log_2(x) & \Rightarrow & g_{n+1} = g_n - 1 + \frac{x}{2^{g_n}\ln(2)} \\ x & \Rightarrow & g_{n+1} = g_n - g_n + x \end{array}

Approximate Functions

By expanding the recursion a few steps, we can create an obnoxious approximation for ln(x)\ln(x):

ln(x)xe1x+xexe1xx+2+xexe1xxexe1xx+2x+3+x4 \ln(x) \approx x e^{1 - x} + x e^{- x e^{1 - x} - x + 2} + x e^{- x e^{1 - x} - x e^{- x e^{1 - x} - x + 2} - x + 3} + x - 4

And one for x\sqrt{x}:

x0.0625x4+1.75x3+4.375x2+1.75x+0.06250.5x3+3.5x2+3.5x+0.5 \sqrt{x}\approx\frac{0.0625 x^{4} + 1.75 x^{3} + 4.375 x^{2} + 1.75 x + 0.0625}{0.5 x^{3} + 3.5 x^{2} + 3.5 x + 0.5}

In a way, this approximation for x\sqrt{x} is quite reasonably constructed. It has plenty of detail around the origin, but as it goes further the higher-order polynomial components divide out and all that is left is the slope asymptote.

These examples were generated with the Python library SymPy. (I got exhausted of writing it by hand around third recursion)

View Code
from sympy import symbols, simplify, print_latex

x = symbols("x")

expr = 1
for i in range(0, 3):
    expr = 0.5 * expr + x / (2 * expr)

print_latex(simplify(expr))
This note is one of many taken during 2026