# Why does the domain and range of $\sqrt x$ contain only positive real numbers?

Consider the function $f(x)=\sqrt x$.

Pretty much every resource I can find gives its domain as $\{x\in \mathbb{R} \mid x \ge 0\}$ and its range as $\{y\in \mathbb{R} \mid y \ge 0\}$

I don't see why the domain needs to be restricted to positive numbers. Isn't the square root of a negative number defined? That is, the square root of a negative number is a complex number of the form $a + bi$.

So why isn't the domain of $f(x)=\sqrt x$ instead $\{x\in \mathbb{R}\}$ and its range $\{y\in \mathbb{C} \mid y \ge 0\}$?

What am I missing?

• You can't write $y\geq 0$ when $y\in\mathbb{C},$ because there is no order on $\mathbb{C}.$ – Balloon Nov 26 '15 at 17:41
• This is relevant: en.wikipedia.org/wiki/Principal_branch – Irregular User Nov 26 '15 at 17:41
• If $y$ is an element of the complex number system, it makes no sense to state the requirement $y>0$ Complex numbers are not positive nor negative. They cannot be ordered in that way – imranfat Nov 26 '15 at 17:41
• The range in this case "is" $\{ y\in\mathbb{C}\;\colon\; \text{Re}(y)\geq 0\text{ and Im}(y)\geq 0\}$ – Szmagpie Nov 26 '15 at 17:45
• "Isn't the square root of a negative number defined?". No, in $\mathbb R$ it isn't. – Yves Daoust Nov 26 '15 at 18:40

The square root of a negative number is defined when discussing complex numbers, but when only real numbers are discussed (as is usual with most of calculus) there is no advantage to using the complex numbers as square roots.

Not an answer, but something heavy I want to get of my chest here: Some of you make statements as "The square root of a negative number is complex" That is from a mathematical standpoint a very poor way of "introducing" complex numbers. It falls in the same category as stating $i=\sqrt{-1}$ whereas $i^2=-1$ is a far better concept. A Squareroot of negative numbers are pretty meaningless in the real word as well as in the complex world, however, an equation like $x^2=-9$ has exactly two (complex) solutions by rewriting $-9=9i^2$ and then take square roots (which is NOT the same thing as saying +/-$\sqrt{-9}$) If we truly want to consider the complex number set as a field (which complex analysts want), we need to step away from this "squareroot of a negative number is complex" notion. More on this here: https://en.wikipedia.org/wiki/Complex_number

Because in these resources $f$ is defined as $$f:A\to B$$ where $A,B\subset \mathbb R$.

Of course square root function $g(z)=\sqrt z$ is defined for every complex argument, moreover - it is multivalued. It means that for example $g(-4)$ may be equal to $2i$ or $-2i$.

The same situation may be noticed on the real line; $x^2=4$ have two roots: $2$ and $-2$, but the function $f$ is single-valued. That's because it is only a branch of square root function, its principal value.

This set does not have a meaning: $\{y\in \mathbb{C} ~|~ y \ge 0\}$.
Complex numbers cannot be so simply compared with $\ge$
(unless they are real numbers i.e. unless their imaginary part is zero).

These texts you're reading, they assume the reader does not know yet, or does not want to know yet about complex numbers. Now, if the reader only knows real numbers, then the number x must be non-negative as square root is not defined on negative real numbers.

Also, if you look at the square root of x when x is a complex number, you will notice that one number has more than one complex square roots. This means that square root is not really a function, at least not a function $\mathbb{C} \to \mathbb{C}$

The real-valued function defined by $f(x)=\sqrt x$ has domain $\{x\in\Bbb R:x\ge0\}$. The complex-valued function defined by $g(x)=\sqrt x$ has domain $\Bbb C$. These are different functions (since they have different domains).

It is a question of which range is acceptable for your specific application. If you only want real numbers as results you have to set the domain to the non-negative real numbers. If you are ok with complex numbers you can also set the domain to $\mathbb{C}$.

Let me make this clear to you. See the basic rule of a 2-D function like $y=\sqrt{x}$. In mathematics, a function is a relation between a set of inputs and a set of permissible outputs with the property that each input is related to exactly one output. A function can always be plotted on a graph. How can you plot the graph of a complex number in real number graph? That isn't possible. Complex numbers do not exist at all. Everything is real. In mathematics we use complex numbers in order to make problems easier. That doesn't mean they start existing. That's why in order to obtain a real number graph the domain is set of positive numbers(including 0).

This is the definition of the real square root function, from $\mathbb R$ to $\mathbb R$.

You can also define a complex square root function, from $\mathbb C$ to $\mathbb C$.

A mixed function, from $\mathbb R$ to $\mathbb C$ is of little interest.