## Online Encylopedia and Dictionary Research Site

Online Encyclopedia Search    Online Encyclopedia Browse

# Square root

In mathematics, the principal square root of a non-negative real number $x\,\!$ is denoted $\sqrt x$ and represents the non-negative real number whose square (the result of multiplying the number by itself) is $x\,\!$.

For example, $\sqrt 9 = 3$ since $3^2 = 3 \times 3 = 9$.

This example suggests how square roots can arise when solving quadratic equations such as $x^2=9\,\!$ or, more generally, $ax^2+bx+c=0\,\!$.

Extending the square root concept to negative real numbers gives rise to imaginary and complex numbers.

Square roots of integers are often irrational numbers, i.e., numbers not expressible as one integer over another. (It is a misconception that mathematicians define irrational number to be one whose decimal expansion is infinite and non-repeating. That is equivalent, but nothing is sacred about base-10 numerals as opposed to other bases.) For example, $\sqrt 2$ cannot be written exactly as m/n, where n and m are integers (and so cannot be written in finite or repeating decimal form, although that is a fact of less interest to mathematicians.) Nonetheless, it is exactly the length of the diagonal of a square with side length 1.

The discovery that $\sqrt 2$ is irrational is attributed to Hippasus, a disciple of Pythagoras. After the number was revealed to be irrational, the Pythagoreans killed Hippasus, not wishing to believe this fundamental number could be infinitely long and nonrepeating. Other Greek philosophers celebrated the discovery with a sacrifice of 100 oxen (a hecatomb).

The square root symbol (√) was first used during the 16th century. It has been suggested that it originated as an altered form of lowercase r, representing the Latin radix (meaning "root").

 Contents

## Properties

• The principal square root function $\sqrt{x}$ is a function which maps the non-negative real domain R+∪{0} into the non-negative real codomain R+∪{0}.
• The principal square root function $\sqrt{x}$ always returns a single unique value.
• There are only two solutions to the equation $x = \sqrt{x}$ The solution set is { 0,1 }
• To obtain both roots of a positive number, take the value given by the principal square root function as the first root (root1) and obtain the second root (root2) by subtracting the first root from zero (ie root2 = 0 - root1).
• The following important properties of the square root functions are valid for all positive real numbers x and y:
$\sqrt{xy} = \sqrt x \sqrt y$
$\sqrt{\frac{x}{y}} = \frac{\sqrt{x}}{\sqrt{y}}$
$\sqrt{x^2} = \left|x\right|$ for every real number x (see absolute value)
$\sqrt x = x^{1/2}$
• Suppose that x and a are reals, and that x2 = a, and we want to find x. A common mistake is to "take the square root" and deduce that $x = \sqrt a$. This is incorrect, because the principal square root of x2 is not x, but the absolute value $\left| x \right|$, one of our above rules. Thus, all we can conclude is that $\left| x \right| = \sqrt a$, or equivalently $x = \pm\sqrt a$.
$\sqrt x - \sqrt y = \frac{x-y}{\sqrt x + \sqrt y}$
It is valid for all non-negative numbers x and y which are not both zero.
• The function $f(x) = \sqrt x$ has the following graph, made up of half a parabola lying on its side:

• The function is continuous for all non-negative x, and differentiable for all positive x (it is not differentiable for x = 0 since the slope of the tangent there is ). Its derivative is given by
$f'(x) = \frac{1}{2\sqrt x}$
$\sqrt{x+1}=1 + \sum_{n=1}^\infty { (-1)^{n+1} (2n-2)! \over n! (n-1)! 2^{2n-1} }x^n$
$= 1 + \frac{1}{2}x - \frac{1}{8}x^2 + \frac{1}{16} x^3 - \frac{5}{128} x^4 + \dots$
for $\left| x \right| < 1$.

## Common errors involving equations with the principal square root function

1. Not recognising $x^{1/2}\,\!$ as the principal square root of $x\,\!$ in a squaring step followed by principal square root step.
$-1 = -1^1 = -1^{2/2} = (-1^2)^{1/2} = 1^{1/2} = 1\,\!$

In details we have:
$-1=-1^1\,\!$
$-1^1=-1^{2/2}\,\!$
$-1^{2/2}=\sqrt{-1^2}\qquad\mathbf{Error!}\,\!$
This is because $-1^{2/2}=-1\,\!$ and $\sqrt{-1^2}=\sqrt{1}\,\!$ so
$-1\ne\sqrt{1}$
The error comes in taking the principle square root of a square of -1.

2. Not taking into account false root(s) when squaring equations with the principal square root function

$x - 1 = \sqrt{x}\,\!$
$x^2 - 2x + 1 = x\,\!$ squaring both sides which introduces the false root x=0.38197
$x^2 - 3x + 1 = 0\,\!$ move x from the right hand side to the left hand side
Using the quadratic equation formula, we get the solutions
$x=2.618\,\!$ or $x=0.38197\,\!$

But when we substitute back $x=0.38197\,\!$
$0.38197 - 1 = \sqrt{0.38197}\,\!$
$-0.61803 = 0.61803\,\!$ Error!

## Computing square roots

### Calculators

Pocket calculators typically implement good routines to compute the exponential function and the natural logarithm, and then compute the square root of x using the identity

$\sqrt{x} = e^{\frac{1}{2}\ln x}$

The same identity is exploited when computing square roots with logarithm tables or slide rules.

### Babylonian method

A commonly used algorithm for approximating $\sqrt x$ is known as the "Babylonian method" and is based on Newton's method. It proceeds as follows:

1. start with an arbitrary positive start value r (the closer to the root the better)
2. replace r by the average of r and $x \over r$
3. go to 2

This is a quadratically convergent algorithm, which means that the number of correct digits of r roughly doubles with each step.

This could be represented as Failed to parse (syntax error): x_{n+1} = 0.5 (r + \frac x_n r)

 where $\lim_{n \to \infty} x_n = \sqrt r$


This algorithm works equally well in the p-adic numbers, but cannot be used to identify real square roots with p-adic square roots; it is easy, for example, to construct a sequence of rational numbers by this method which converges to + 3 in the reals, but to - 3 in the 2-adics.

### An exact "long-division like" algorithm

This method, while much slower than the Babylonian method, has the advantage that it is exact: if the given number has a square root whose decimal representation terminates, then the algorithm terminates and produces the correct square root after finitely many steps. It can thus be used to check whether a given integer is a square number.

Write the number in decimal and divide it into pairs of digits starting from the decimal point. The numbers are laid out similar to the long division algorithm and the final square root will appear above the original number.

For each iteration:

1. Bring down the most significant pair of digits not yet used and append them to any remainder. This is the current value referred to in steps 2 and 3.
2. If r denotes the part of the result found so far, determine the greatest digit x that does not make y = x(20r + x) exceed the current value. Place the new digit x on the quotient line.
3. Subtract y from the current value to form a new remainder.
4. If the remainder is zero and there are no more digits to bring down the algorithm has terminated. Otherwise continue with step 1.

Example: What is the square root of 152.2756?

            1  2. 3  4
|  01 52.27 56                        1
x         01                   1*1=1         1
00 52                              22
2x        00 44                22*2=44        2
08 27                           243
24x          07 29             243*3=729       3
98 56                        2464
246x            98 56          2464*4=9856      4
00 00          Algorithm terminates: answer is 12.34


Although demonstrated here for base 10 numbers, the procedure works for any base, including base 2. In the description above, 20 means double the number base used, in the case of binary this would really be 100. The algorithm is in fact much easier to perform in base 2, as in every step only the two digits 0 and 1 have to be tested. See Shifting nth-root algorithm.

### Square roots using Newton iteration

Basic Newton iteration finds a single root of a function f(x) given a sufficently precise approximation to the root. The nature of which root will be given based on an approximation is dependent on the Newton fractal which we will not discuss here any further. The basic iteration is given by:

$x_{n+1} = x_n - {f(x_n) \over f^\prime(x_n)}$.

There are two widely used functions f(x) used to find the square root of a number, say, "z". One finds the square root of "z" while the other finds the reciprocal of the square root of "z". The former gives sufficiently precise approximations to the square root of "z" with each iteration. The latter requires that one divide $z / \sqrt z$ to obtain the square root of "z".

We have the two functions given as follows:

f(x) = x2 - z

and

g(x) = x - 2 - z.

Note that for "f", we have f(z1 / 2) = 0. For "g", we have g(1 / z1 / 2) = 0. If one multiplied the roots of "g" by "z", the result will be $\sqrt z$.

We first find the derivative of these two functions. We have:

$f^\prime(x) = 2 x$
$g^\prime(x) = -2 x^{-3}$.

The iteration for "f" is derived here:

$x_{n+1} = x_n - {f(x_n) \over f^\prime(x_n)}$
$= x_n - {(x_n^2 - z) \over 2 x_n}$
$= x_n - (1/2) (x_n - {z \over x_n})$
$= (1/2) (x_n + {z \over x_n})$.

The iteration for "f" involves a division which is more time consuming than a multiplication in computer integer arithmetic. The iteration for "g" involves no division and is therefore recommended for large integers "z".

We present the iteration for "g" as follows:

$x_{n+1} = x_n - {g(x_n) \over g^\prime(x_n)}$
$= x_n - {x_n^{-2} - z \over -2 x_n^{-3}}$
$= x_n - (-1/2) {x_n^3} (x^{-2} - z)$
$= x_n + (1/2) (x_n - z x_n^3)$
$= (1/2) (3 x_n - z x_n^3)$
$= (1/2) x_n (3 - z x_n^2)$.

This iteration using "g" involves only a squaring and a two multiplications, as apposed to a division in the case of "f". In practical implementations of large integer square roots, the iteration involving "g" is faster for large integers "z" since division is at best O(M(n)), a constant times the time function of multiplication. The constant term is almost always 3 or more, meaning that a single division can almost never be faster than 3 multiplications.

### Pell's equation

Pell's equation yields a method for finding rational approximations of square roots of integers.

### Finding square roots using mental arithmetic

Based on Pell's equation there is a method to calculate square roots simply by subtracting odd numbers.

Ex: For $\sqrt{27}$ we start with the following sequence:

1. 27 - 1 = 26
2. 26 - 3 = 23
3. 23 - 5 = 18
4. 18 - 7 = 11
5. 11 - 9 = 2

Five steps have been taken and thus the integer part of the square root of 27 is 5.

$2\times 100 = 200$ and $5\times 20 + 1 = 101$

1. 200 - 101 = 99

Next number is 1.

$99\times 100 = 9900$ and $51\times 20 + 1 = 1021$

1. 9900 - 1021 = 8879
2. 8879 - 1023 = 7856
3. 7856 - 1025 = 6831
4. 6831 - 1027 = 5804
5. 5804 - 1029 = 4775
6. 4775 - 1031 = 3744
7. 3744 - 1033 = 2711
8. 2711 - 1035 = 1676
9. 1676 - 1037 = 639

Next number is 9.

The result gives us 5.19 as an approximation of the square root of 27

### Continued fraction methods

Quadratic irrationals, that is numbers involving square roots in the form (a + √b)/c, have periodic continued fractions. This makes them easy to calculate recursively given the period. For example, to calculate √2, we make use of the fact that √2 − 1 = [0; 2, 2, 2, 2, 2, ...], and use the recurrence relation

an + 1 = 1/(2 + an) with a0 = 0

to obtain √2 − 1 to some specific precision specified through n levels of recurrence, and add 1 to the result to obtain √2.

## Square roots of complex numbers

To every non-zero complex number z there exist precisely two numbers w such that w2 = z. The usual definition of √z is as follows: if z = r exp(iφ) is represented in polar coordinates with -π < φ ≤ π, then we set √z = √r exp(iφ/2). Thus defined, the square root function is holomorphic everywhere except on the non-positive real numbers (where it isn't even continuous). The above Taylor series for √(1+x) remains valid for complex numbers x with |x| < 1.

When the number is in rectangular form the following formula can be used:

$\sqrt{x+iy} = \sqrt{\frac{\left|x+iy\right| + x}{2}} \pm i \sqrt{\frac{\left|x+iy\right| - x}{2}}$

where the sign of the imaginary part of the root is the same as the sign of the imaginary part of the original number.

Note that because of the discontinuous nature of the square root function in the complex plane, the law √(zw) = √(z)√(w) is in general not true. Wrongly assuming this law underlies several faulty "proofs", for instance the following one showing that -1 = 1:

$-1 = i \times i = \sqrt{-1} \times \sqrt{-1} = \sqrt{-1 \times -1} = \sqrt{1} = 1$

The third equality cannot be justified. (See invalid proof.)

However the law can only be wrong up to a factor -1, √(zw) = ±√(z)√(w), is true for either ± as + or as - (but not both at the same time). Note that √(c2) = ±c, therefore √(a2b2) = ±ab and therefore √(zw) = ±√(z)√(w), using a = √(z) and b = √(w).

## Square roots of matrices and operators

If A is a positive definite matrix or operator, then there exists precisely one positive definite matrix or operator B with B2 = A; we then define √A = B.

More generally, to every normal matrix or operator A there exist normal operators B such that B2 = A. In general, there are several such operators B for every A and the square root function cannot be defined for normal operators in a satisfactory manner. Positive definite operators are akin to positive real numbers, and normal operators are akin to complex numbers.

## Square roots of the first 20 positive integers

√ 1 = 1
√ 2 ≈1.4142135623 7309504880 1688724209 6980785696 7187537694 8073176679 7379907324 78462
√ 3 ≈1.7320508075 6887729352 7446341505 8723669428 0525381038 0628055806 9794519330 16909
√ 4 = 2
√ 5 ≈2.2360679774 9978969640 9173668731 2762354406 1835961152 5724270897 2454105209 25638
√ 6 ≈2.4494897427 8317809819 7284074705 8913919659 4748065667 0128432692 5672509603 77457
√ 7 ≈2.6457513110 6459059050 1615753639 2604257102 5918308245 0180368334 4592010688 23230
√ 8 ≈2.8284271247 4619009760 3377448419 3961571393 4375075389 6146353359 4759814649 56924
√ 9 = 3
√10 ≈3.1622776601 6837933199 8893544432 7185337195 5513932521 6826857504 8527925944 38639
√11 ≈3.3166247903 5539984911 4932736670 6866839270 8854558935 3597058682 1461164846 42609
√12 ≈3.4641016151 3775458705 4892683011 7447338856 1050762076 1256111613 9589038660 33818
√13 ≈3.6055512754 6398929311 9221267470 4959462512 9657384524 6212710453 0562271669 48293
√14 ≈3.7416573867 7394138558 3748732316 5493017560 1980777872 6946303745 4673200351 56307
√15 ≈3.8729833462 0741688517 9265399782 3996108329 2170529159 0826587573 7661134830 91937
√16 = 4
√17 ≈4.1231056256 1766054982 1409855974 0770251471 9922537362 0434398633 5730949543 46338
√18 ≈4.2426406871 1928514640 5066172629 0942357090 1562613084 4219530039 2139721974 35386
√19 ≈4.3588989435 4067355223 6981983859 6156591370 0392523244 4936890344 1381595573 28203
√20 ≈4.4721359549 9957939281 8347337462 5524708812 3671922305 1448541794 4908210418 51276

Last updated: 02-08-2005 10:01:27
Last updated: 02-27-2005 12:22:38