Welcome to our community

Be a part of something great, join today!

Marie's Question from Facebook about Square Roots

Sudharaka

Well-known member
MHB Math Helper
Feb 5, 2012
1,621
Marie on Facebook writes:

I was wondering how to find square root for numbers like 128. Can you do it step by step please? :)
 

SuperSonic4

Well-known member
MHB Math Helper
Mar 1, 2012
249
Marie on Facebook writes:

I was wondering how to find square root for numbers like 128. Can you do it step by step please? :)
I would use Prime Factorisation to find the prime roots and then take advantage of the rule $\sqrt{ab} = \sqrt{a}\sqrt{b}$. The numbers are positive so this is allowed. To that end if decimal approximations are needed, it's best to learn some of the simple prime roots like $\sqrt{2},\ \sqrt{3}\ \sqrt{5}$

Using 128 as an example (this one is relatively simple as an integer power of 2)

$128 \div 2 = 64$ -- so 2 is one prime factor
$64 \div 2 = 32$

and so on until
$4 \div 2 = 2$

Thus we can say that $128 = 2^7$ and so $\sqrt{128} = \sqrt{2^7}$

Using the rule above I then say that $\sqrt{2^7} = \sqrt{2^6}\sqrt{2} = 2^3\sqrt{2} = 8\sqrt{2}$

I would leave it as $8\sqrt{2}$ for an exact answer
 

MarkFL

Administrator
Staff member
Feb 24, 2012
13,775
If you now wish to compute rational approximations for $\sqrt{2}$ by hand, here are two recursive algorithms (the second converges more rapidly):

i) $\displaystyle x_{n+1}=\frac{x_n+2}{x_n+1}$

ii) $\displaystyle x_{n+1}=\frac{x_n}{2}+\frac{1}{x_n}$

You simply need to "seed" both recursions with some initial guess.

We know $\displaystyle 1<\sqrt{2}<2$ so $\displaystyle \frac{3}{2}$ will work just fine.
 

soroban

Well-known member
Feb 2, 2012
409

Here's another recursive approximation for a square root.

Suppose we want [tex]\sqrt{N}.[/tex]

Let [tex]a_1[/tex] be the first approximation to [tex]\sqrt{N}.[/tex]

Then: [tex]a_2 \:=\:\frac{N+a_1^2}{2a_1}[/tex] is an even better approximation.

Repeat the process with [tex]a_2[/tex] . . . and so on.


This procedure converges very quickly
. . depending on [tex]a_1.[/tex]

Find [tex]\sqrt{3}[/tex], using [tex]a_1 = 1.7[/tex]

[tex]a_2 \:=\:\frac{3 + 1.7^2}{2(1.7)} \:=\:1.732352941 \:\approx\:1.732353[/tex]

[tex]a_3 \:=\:\frac{3 + 1.732353^3}{2(1.732353)} \:=\:1.732050834[/tex]

ChecK: .[tex]1.732050834^2 \:=\:3.000000091\;\;\checkmark[/tex]


~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~


Here is the reasoning behind this procedure.

We want [tex]\sqrt{N}.[/tex]

We approximate the square root, [tex]a_1.[/tex]

Suppose our approximation is correct.
Then [tex]a_1[/tex] and [tex]\tfrac{N}{a_1}[/tex] would be equal, right?

Chances are, they are not equal.
One is larger than the square root, one is smaller.

What is a better approximation of the square root?
. . . the average of the two numbers!

Hence: .[tex]a_2 \:=\:\frac{a_1 + \frac{N}{a_1}}{2} \:=\:\frac{\frac{a_1^2 + N}{a_1}}{2}[/tex]

Therefore: [tex]a_2 \:=\:\frac{N +a_1^2}{2a_1}[/tex]
 

Bacterius

Well-known member
MHB Math Helper
Jan 26, 2012
644
Soroban's method is called the Newton-Raphson method, by the way (if someone wants to search for more information on it). It tends to work most of the time, and converges remarkably quickly (twice as many correct digits per iteration, in general) but can also fail sometimes. This is related to chaos theory and notably used in fractal rendering, but can be mitigated by appropriately choosing the initial guess. It should be noted it cannot fail for polynomials of order less than 3.

Its general form is:

$$a_{n + 1} = a_n - \frac{f(a_n)}{f'(a_n)}$$

To converge to a root of $f(x)$. Which root it converges to is dependent on the initial guess $a_1$.
 

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
8,780
Mark's method ii, soroban's averaging method, and Newton-Raphson are all identical.

Generally, Newton-Raphson finds a root of $f(x)=0$.
The algorithm is:
$x_{k+1} = x_k - \dfrac{f(x_k)}{f'(x_k)}$​

With $f(x)=x^2-N$ this becomes:
$x_{k+1} = x_k - \dfrac{x_k^2-N}{2x_k}$

$x_{k+1} = \dfrac{x_k}{2} + \dfrac{N}{2x_k} \quad$ or $\quad x_{k+1} = \dfrac{N + x_k^2}{2x_k}$​

The initial guess should be above the root for fastest results.
If the initial guess is below the root, the first iteration will jump to the other side of the root and it will worsen the approximation.

The second form is the one soroban presented.

If we pick N=2 as Mark did, the first form becomes:
$x_{k+1} = \dfrac{x_k}{2} + \dfrac{1}{x_k}$​
 

MarkFL

Administrator
Staff member
Feb 24, 2012
13,775
Yes, the second method I gave is just a slight rewriting of the so-called Babylonian method, which Newton's root finding technique also gives.

The first method is discussed here in post #7.