# How do you approximate sqrt3?

Jul 12, 2015

Use a variant of Newton Raphson to construct a sequence of rational approximations and stop when you have enough significant digits.

#### Explanation:

In the case of finding an approximation for $\sqrt{n}$, the Newton Raphson method boils down to choosing a reasonable first approximation ${a}_{0}$, then iterating using the formula:

${a}_{i + 1} = \frac{{a}_{i}^{2} + n}{2 {a}_{i}}$

If you apply this using decimals then you quickly run into choices as to where to truncate your decimals, etc.

If you apply it using fractions, then you frequently find yourself multiplying up the numerator and denominator to simplify the fractions.

Alternatively, notice that if ${a}_{i} = {p}_{i} / {q}_{i}$ where ${p}_{i}$ and ${q}_{i}$ are integers, then:

${a}_{i + 1} = \frac{{\left({p}_{i} / {q}_{i}\right)}^{2} + n}{2 {p}_{i} / {q}_{i}}$

$= \frac{{p}_{i}^{2} + n {q}_{i}^{2}}{2 {p}_{i} {q}_{i}}$

So use:

${p}_{i + 1} = {p}_{i}^{2} + n {q}_{i}^{2}$

${q}_{i + 1} = 2 {p}_{i} {q}_{i}$

It can happen (in early iterations) that ${p}_{i + 1}$ and ${q}_{i + 1}$ end up with a common factor, in which case it's best to divide both by the common factor.

For $\sqrt{3}$, let $n = 3$, ${p}_{0} = 2$, ${q}_{0} = 1$.

Then:

$\left({p}_{0} , {q}_{0}\right) = \left(2 , 1\right)$
$\left({p}_{1} , {q}_{1}\right) = \left(7 , 4\right)$
$\left({p}_{2} , {q}_{2}\right) = \left(97 , 56\right)$
$\left({p}_{3} , {q}_{3}\right) = \left(18817 , 10864\right)$

Then ${p}_{3} / {q}_{3} = \frac{18817}{10864} \cong 1.7320508$