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?

  • 8
    $\begingroup$ 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! $\endgroup$
    – Vahid
    Feb 15, 2014 at 18:31
  • $\begingroup$ 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. $\endgroup$
    – anon
    Feb 15, 2014 at 18:37
  • 1
    $\begingroup$ To understand this, you first have to understand the rule $(-1)(-1)=+1$. This might be a starting point. $\endgroup$
    – Jack M
    Feb 15, 2014 at 23:16
  • 1
    $\begingroup$ Also, you should specify what you mean by "the algorithm to get the square root of a number". $\endgroup$ Feb 16, 2014 at 2:04
  • $\begingroup$ There are many algorithms for computing square roots. A thing is not the same as the algorithm (if any) used to compute it. $\endgroup$
    – anomaly
    Jan 28, 2016 at 3:05

9 Answers 9


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).

  • $\begingroup$ Fantastic answer, but I have to ask: why stop at saying "positive" instead of "non-negative square root"? $\endgroup$
    – SimonT
    Apr 22, 2014 at 3:06

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".


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.

  • 1
    $\begingroup$ * non-negative; 0 times itself is 0, which is not a positive number. A bit nitpicky but relevant for this topic. $\endgroup$
    – SimonT
    Apr 22, 2014 at 3:05

Taking the square root of a negative number isn't impossible, it's just not in the set of numbers that you started with (the set of positive and negative numbers, along with $0$).

Take any negative number and call it $a$. We're going to try and find $a$'s square root.

Assume that $a$ has some number that is a square root. Call that number $b$. Then $b\times b = a$.

Now I ask you this: is $b$ positive or negative?

If $b$ were positive, then $b\times b$ would be positive. (A positive times a positive is positive). But $a$ is negative! So we know $b$ can't be positive.

If $b$ is negative, then $-b$ is positive. Note that $b = -1\times -b$. Now:

$$b\times b= (-1\times -b) \times (-1\times b)=(-1\times -1)\times(-b\times -b)=-b\times-b$$

But $-b\times-b$ is a positive times a positive so it must be positive! And we know that $a$ is negative!

Using this argument we have seen that the square root of a negative number cannot be positive or negative. (We also know it can't be $0$, since $0\times0=0$ which isn't negative either)

Later your will learn that defining a special object $i:=\sqrt{-1}$, will let you take the square root of a negative number.

  • $\begingroup$ Of course nobody "defines a special object $i:=\sqrt{-1}$". $\endgroup$
    – Did
    Mar 11, 2014 at 6:58
  • $\begingroup$ Well, you define a number which is the solution to x^2=-1 $\endgroup$ Mar 11, 2014 at 14:42
  • 1
    $\begingroup$ Well, I hope you don't. (By the way, I doubt that anybody wants to define a number as "the" solution and to discover right away that if there are solutions, there are at least two.) $\endgroup$
    – Did
    Mar 11, 2014 at 15:38
  • 1
    $\begingroup$ If there are 2 solutions to $x^2+1=0$, then which one is $i$? If you say that the first one is $i$ and the second one is $-i$, how can you convince me that it's not the other way around? $\endgroup$
    – John Joy
    May 30, 2014 at 16:52

The square root of a number $y$ is defined to be the value $x$ such that $x^{2}=y$. However, for any real number $x$, $x^{2}\geq 0$. When we say that the square root of a negative number "doesn't exist", we mean that there is no real number solution. However, if we consider complex numbers, we then get a solution to $\sqrt{-1}=i$. $i$ is actually defined to be the solution to this expression, and we can do many more things once we have access to complex numbers (real numbers with an $i$ component).

  • 2
    $\begingroup$ This is somewhat wrong: $\sqrt{-1}$ does not make sense because there are two complex solutions to $x^2 = -1$: $i$ and $-i$. $\endgroup$
    – Alexey
    Feb 15, 2014 at 19:22
  • $\begingroup$ Complex $i$ is not normally defined as one of the two square roots of $-1$ because such definition would be somewhat circular :). $\endgroup$
    – Alexey
    Feb 15, 2014 at 19:24

So firstly, the algorithm to compute square roots I'm guessing you're looking for is the one originating from the Newton (Newton-Raphson) Method. There's other methods but I'll post this one.

Effectively given a "good" (read further) initial estimate $x_0$ of the root of a differentiable function $f:D\rightarrow\mathbb{C}$, $D\subseteq\mathbb{C}$ and $f'$ it's derivative, then the sequence of numbers $\{x_n\}_n$ for $n \in \mathbb{N}=\{1,2,3\ldots\}$, defined by: \begin{equation} x_{n+1}:=x_n-\frac{f(x_n)}{f'(x_n)} \end{equation} converges to a root of the function $f$ as $n\rightarrow \infty$.

In the case of square roots of $k \in \mathbb{N}$ we can take the polynomial $x^2-k$ and then the formula becomes: \begin{align} x_{n+1}:=\frac{1}{2}(x_n+\frac{k}{x_n}) \end{align}

and the convention is to take $x_0:=1$. Successive iterations get closer and closer to $\sqrt{k}$, the positive square root.

eg. square root of two on wikipedia.
the formula in this case is:

\begin{align} x_{n+1}:=\frac{1}{2}(x_n+\frac{2}{x_n}) \end{align}

Now when you're asking why does it not allow/accept negative numbers i.e. as in to calculate the square root of -1, -2 etc, well it's because this formula was derived to solve for roots of $x^2-k$. Use the formula instead with the polynomial $x^2+k$ where $k \in \mathbb{N}$ and the below formula calculates $\sqrt{-k}$ with a "decent" initial guess:

\begin{align} x_{n+1}:=\frac{1}{2}(x_n-\frac{k}{x_n}) \end{align}

Now the problem (or so it seems) with Newton's Method is it's stability. If you wanted to calculate the positive $\sqrt{-1}$ with the above formula and your $x_0$ was a real number then for every iteration you would get a real number and one can show that a sequence of real numbers can't converge to an "imaginary" or "complex" number like $\textit{i}=\sqrt{-1}$. There's also examples (which I'd link but I'm restricted to only two links) of functions for which Newton's Method cycles and for which it diverges for given initial conditions, which have real roots.

Anyway if you wanted you could look up Newton's fractal it has some info for sequences converging to complex roots. Apparently it depends on the region of the complex plane you choose your initial guess from, whether it will/won't converge to a root/the root you're looking for.



If x*x=x^2, all numbers multiplied by themselves equal positive numbers. A number multiplied by itself cannot be negative, so the square root of a negative number is not possible (imaginary, I believe)

  • 1
    $\begingroup$ This was posted on a two year old Question. Are you convinced this short treatment has added something to the Answers previously given? If so, it would be helpful to Readers to emphasize or highlight exactly what is being introduced for the first time. $\endgroup$
    – hardmath
    Oct 27, 2016 at 5:01

It is possible! Sir, Madam, Student, It is very difficult to break 16th century scholastic dogma, e.g. imaginary number, used in taking square root of negative number. If we are consistent, we should accept to take square roots only from positive numbers. The result of multiplication of same numbers is always a positive number. If we take square root of a negative number, we should place the negative sign before radical sign/radix -√, e.g. imaginary number √-1 = -√1. You do not need sci-fi to be convinced because its roots are -1 = -1 x 1 = 1 x -1 or - (1 x 1) = -(-1 x -1). Simple and logical.

Finally, the square root calculations of the negative and the positive numbers are the same and their outcomes are differentiated only by plus-minus sign.

Full answer with tables and graphs www.globid.eu

  • $\begingroup$ The square root of a negative number is possible! Square definition:"In mathematics, a square is the result of multiplying a number by itself. The verb "to square" is used to denote this operation. Squaring is the same as raising to the power 2, and is denoted by a superscript 2".(Wikipedia.org) The definition eliminates in advance the real numbers with different signs although they form squares as well and when multiplied return square area. To avoid that the definition shall be broadened to use real number absolute value in squaring and square roots calculation. $\endgroup$
    – Georgi
    Mar 8, 2020 at 16:36
  • $\begingroup$ Brief presentation of NEGATIVE RADICAND youtube.com/watch?v=tFCrGPKq_fw $\endgroup$
    – Georgi
    Mar 10, 2020 at 4:58

It is impossible to find the square root of negative one, or the square root of any negative number, because no number times itself can equal a negative number. For instance, if I try to find the square root of negative one, I start by attempting to multiply -1*-1, but that would give a solution of one, since a negative times a negative equals a positive. The next step is to multiply 1*-1 or -1*1, but while those equations do come up with an answer of one, 1 and -1 are not the same number; they just have the same absolute value, but if you try to multiply the absolute values, you will get positive one because positive*positive=positive. Same goes for -2,-3,-4,-5,-6, and every negative number. However, the square root of negative numbers is used in scientific and advanced mathematical calculations as represented by the letter i, which basically means "imaginary number" because it does not exist, however, how scientists could use i in calculations pertaining to the real world is puzzling, because i does not exist.

  • $\begingroup$ "$i$ does not exist" can you prove it? And what about $\pi$, does it exists? $\endgroup$
    – Surb
    Dec 16, 2017 at 15:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .