15

What is the algorithm to get the square root of a number?
Why does it not accept / allow for negative numbers?

I've always been told that the square root of minus one does not exist by my maths teacher, but I don't really get why?

amWhy
  • 209,954
  • 8
    if you say $a\times a=a^{2}$ and also $-a\times -a=a^{2}$ so you can not get any negative result by multiplying a number by itself! – Vahid Feb 15 '14 at 18:31
  • Square roots of negative real numbers do not exist in the real numbers. They do exist in the complex numbers, using the imaginary unit $i$. The terms "real" and "imaginary" are historical vestiges from a time when mathematicians were skeptical about the legitimacy and meaning of complex numbers. Today complex numbers are completely accepted, we have far more general abstract algebraic machinery than them nowadays, and they are applicable to the real world. Teachers may tacitly understand "numbers" to mean "real numbers" to keep their lessons focused on that level of math for students. – anon Feb 15 '14 at 18:37
  • 1
    To understand this, you first have to understand the rule $(-1)(-1)=+1$. This might be a starting point. – Jack M Feb 15 '14 at 23:16
  • 1
    Also, you should specify what you mean by "the algorithm to get the square root of a number". – Henry Swanson Feb 16 '14 at 02:04
  • There are many algorithms for computing square roots. A thing is not the same as the algorithm (if any) used to compute it. – anomaly Jan 28 '16 at 03:05

9 Answers9

16

JChau asked in a separate question if it's ever possible for the square root of a number to be negative, and another user moved for that to be closed as a duplicate of this one. It has since been deleted, but here is my answer to that other question, which is also pertinent here.


We say $x$ is a "square root" of $y$ if $x^2=y$. Thus, both $+7$ and $-7$ are square roots of $49$.

However for positive reals $x$, by definition the square root function applied to $x$ yields the positive square root. Often one will abbreviate "the square root function applied to $x$" or equivalently "the positive square root of $x$" as simply "the square root of $x$," if no confusion should arise. Therefore we have $\sqrt{49}=+7$, despite $-7$ also being a square root.

The square root function, like all bona fide functions, is single-valued rather than multi-valued, so if we were tasked with creating our own square root function from scratch we would have to make a choice between the two square roots of every positive number as the value the function takes; if we want to further impose continuity (and, subsequently, smoothness for $x>0$), we would end up having to set $\sqrt{x}$ to either always be the positive square root or always the negative square root. At this point it's an understandable choice to make it always the positive one.

The same kind of "having to make a choice" situation arises if one wants to define a square root function for complex numbers. We can no long impose the same kind of continuity conditions and get a straight answer - instead we have to form a sort of "barricade" in which the value of the square root jumps dramatically when we cross over this barricade. This is known as a branch cut.

The standard branch in $\Bbb C$ is where we consider the negative real axis as part of the quadrant above it but not part of the quadrant below it. In this setting, complex numbers when written in polar coordinates will have a phase (angle) in the interval $(-\pi,\pi]$ (note if you cross over the negative real axis, the phase will jump from one side of this interval to the other).

The standard branch normally comes up in the discussion of the logarithm, but it is connected to taking powers with complex numbers because $z^w:=\exp(w\ln z)$ for complex $w,z\in\Bbb C$ ($z\ne0$). The logarithm will be defined by $\ln (re^{i\theta})=(\ln r)+i\theta$, so the imaginary part of a logarithm will depend on which branch we have chosen. The default choice, usually unspoken, is the standard branch.

Using the standard branch, we have $\sqrt{re^{i\theta}}=\exp(\frac{1}{2}(\ln r+i\theta))=e^{\frac{1}{2}\ln r}e^{i\theta/2}=\sqrt{r}e^{i\theta/2}$. Thus the phase of $\sqrt{z}$ will be in $(-\pi/2,\pi/2]$ for all $z\in\Bbb Z\setminus0$. This precludes $\sqrt{z}$ from ever being a negative real number, or even to the left of the imaginary axis. However, other nonstandard choices of branch cuts can lead to $z^{1/2}$ taking values on the negative real axis.

Another word for $\ln$ and $\sqrt{}$ with the standard branch is the principal value.

The idea of branch cuts leads into more advanced complex analysis topics of monodromy (which pertains to "running around" a singularity, like crossing over the branch mentioned earlier) and also Riemann surfaces, which can be thought of as what we get when we refuse to cut the plane into branches and instead consider a function multi-valued and look at its graph (I am probably butchering that description though).

anon
  • 151,657
  • Fantastic answer, but I have to ask: why stop at saying "positive" instead of "non-negative square root"? – SimonT Apr 22 '14 at 03:06
8

First, we have to specify what set of numbers you are working in, because otherwise, the question is meaningless.

  • Does the reciprocal of $2$ exist? If you're working in $\mathbb{N}$, then no, it does not. But if you're working in $\mathbb{Z}$, it does.
  • Does $x$ such that $x \cdot 2 = 1$ exist? There is no element of $\mathbb{Z}$ that satisfies this, but there is one in $\mathbb{Q}$.
  • Does $\sqrt{2}$ exist? In $\mathbb{Q}$, no, but in $\mathbb{R}$, yes.

So it is very important to specify which set of numbers you are talking about!


So let's change your question to: "does there exist an $x \in \mathbb{R}$ such that $x^2 = -1$?" Since we've now specified what set of numbers we're talking about, this has an actual answer. No.

We know that the real numbers have an order $<$ with these properties:

  1. For all $a,b \in \mathbb{R}$, exactly one of these is true: $a < b$, $a = b$ or $a > b$.
  2. If $a > 0$ and $b < c$, then $ab < ac$.
  3. If $a < 0$ and $b < c$, then $ab > ac$.

Pick any $x \in \mathbb{R}$. We use property $1$ to split this into cases:

  • $x > 0$: By property $2$, we know $x \cdot x > x \cdot 0$, and so $x^2 > 0$.
  • $x = 0$: Computation shows $x^2 = 0$.
  • $x < 0$: By property $3$, we know $x \cdot x > x \cdot 0$, and so $x^2 > 0$.

In all cases, $x^2 \ge 0$. And since $-1 \not\ge 0$, we know that no square root exists in $\mathbb{R}$.


But is there a system of numbers in which there is a square root of $-1$? Yes; they are called the "complex numbers".

The complex numbers can be defined in lots of ways, but for our purposes, they are numbers of the form $a + bi$, where $a$ and $b$ are real, and $i$ is a number where $i^2 = -1$. Note that $i$ is not a real number! But because we're making a new number system, we can make up whatever we want.

By construction, $i = \sqrt{-1}$. Note that all real numbers have squares now: let $x = a + 0i$. If $a \ge 0$, we just take the square root as normal: $(\sqrt{a})^2 = a$. But if it is negative, we consider $\sqrt{-a} \cdot i$. When you square this, you get $a$.


A side note: like the real numbers, there are two square roots for each number. For example, $i^2 = -1$, but so does $(-i)^2$. With the real numbers, we can choose the positive one as our "principal" square root. But the complex numbers don't have $<$ anymore, so the expression $\sqrt{-1}$ is ambiguous. To avoid this, we usually don't use $\sqrt{x}$ when working with complex numbers, unless we know for certain that $x$ is real and non-negative. Our definition of $i$ changes to: $i$ is a number such that $i^2 = -1$.

One might ask: how do we tell which square root is $i$ and which is $-i$? Well... we don't. If you swapped $i$ and $-i$ everywhere in the world, then true statements would still be true, and false statements would still be false. So our "choice" doesn't really matter, and we just say "$i$ is one of the square roots, and $-i$ is the other". If you continue in mathematics, you will recognize $\mathbb{C}$ as a field extension, and you can formalize what is meant by "it doesn't matter which is which".

J.G.
  • 115,835
Henry Swanson
  • 12,972
6

Any number times itself is a positive number (or zero), so you can't ever get to a negative number by squaring. Since square roots undo squaring, negative numbers can't have square roots.

Neal
  • 32,659
  • 1
  • non-negative; 0 times itself is 0, which is not a positive number. A bit nitpicky but relevant for this topic.
  • – SimonT Apr 22 '14 at 03:05