How to show this formula to get a square root of a number in "just few seconds" is true?

To understand why this is a good approximation note that $(\sqrt{x})' = \frac{1}{2\sqrt{x}}$.

So the formula is of the form $f(x) = f(y) + f'(y)(x-y)$. See Taylor's theorem for more details.


For a purely algebraic and non-calculus derivation, use the fact that

$$x - y \; = \; (\sqrt{x} + \sqrt{y})(\sqrt{x} - \sqrt{y}),$$

then replace $\;\sqrt{x} + \sqrt{y}\;$ with $\;\sqrt{y} + \sqrt{y} = 2\sqrt{y}\;$ (since we are assuming $\sqrt{x}$ is approximately equal to $\sqrt{y})$ to obtain the approximation

$$x - y \; \approx \; 2\sqrt{y} \left( \sqrt{x} - \sqrt{y} \right).$$

Now solve for $\sqrt{x}$ by dividing both sides by $2\sqrt{y}$ and adding $\sqrt{y}$ to both sides.


As presented there that would be "Newton's method." But it is older than Newton. It really is "the Babylonian" method.

The Babylonian method:

If you are looking for $\sqrt n$, take a guess and pulg it into:

$x_{k+1} = \frac 12 (x + \frac n{x_k})$

If you guess is close is close to $\sqrt{n}, \frac n{x_k}$ will will also nearly equal $\sqrt n$, but with the error on the other side of your target. Taking the mid-point is nearly on target.

This formula is algebraically equivalent to the one in your post.

Or:

If you know that $a$ is close to $\sqrt n$, and you want to give $a$ a small nudge ($x$).

$n = (a + x)^2 = a^2 + 2ax + x^2$

Since $x$ is small $x^2$ is very small, and we drop it.

$x = \frac {n-a^2}{2a}$

and finally Newton's method:

If you want to find the zero of any function. Then find a point on the curve $(x,f(x))$, draw a line tangent to the curve, through that point until it intersects the x-axis. That point $x_{n+1}$

$x_{k+1} = x_n - \frac {f(x_k)}{f'(x_k)}$

and in this case: $f(x) = x^2 - 2$

A note of caution, Newton's method runs into problems if $f'(x_k)$ is near zero.

One more derivation:

if $n = a^2 + x$ then we do a binomial expansion on $(a^2+x)^{\frac12}$

$(a^2+x)^{\frac12} = a + \frac12 a^{-1} x - \frac 18 a^{-3} x^2... $

Using just the first two terms, we once again have an equivalent formula.