0

I know that the domain of the function $(\sqrt{x})^2$ is $x = [0,\infty)$. But my question is why not $x = \mathbb{R}$. If I put $x = -1$ I get $(\sqrt{-1})^2$ which further simplifies to $(\iota)^2$ which equals $-1$ and output is a real number and as long as I get a real output for a real input then that real input should be considered in the domain of the function. Then why are we not including negative numbers.

NOTE - I’m talking of real valued functions

PythonSage
  • 1,074
  • 3
    The issue is whether, when you define a function by a formula, it is required that all intermediate calculations result in real numbers, or whether only the final result needs to be a real number. This comes down to how formulas are to be interpreted, which is a matter of author convention (often not explicitly stated, however). – Dave L. Renfro Apr 15 '20 at 17:15
  • Because you need to know complex numbers. Not all operations can be done in $\mathbb R$ – Andrei Apr 15 '20 at 17:15
  • As an aside, the complex number representing the imaginary unit is usually written as $i$, not as $\iota$, and if you are using $x$ as a particular element in the domain, then the domain itself shouldn't also be written as $x$ but rather something else such as $X$. It is confusing to see $x=R$ and $x=-1$ in consecutive sentences like that... – JMoravitz Apr 15 '20 at 17:18
  • 2
    Now... to be fair, questions like "what is the domain of this function" are usually badly written. What they mean to ask is "what is the maximal subset of the real numbers which can act as a domain for this function with codomain the real numbers" or similar. It is rather heavily implied here that each of the symbols appearing are meant to be interpreted as their "real number specific" versions, wherein plugging in $-1$ would give you $(\sqrt{-1})^2=(\text{undefined})^2$ which is undefined. Only the "complex number specific version" of $\sqrt{~}$ would give $\sqrt{-1}=i$. – JMoravitz Apr 15 '20 at 17:24
  • You say you are "talking of real valued functions", which should rule out the imaginary $\sqrt{-1}$ immediately as a step in the process – Henry Apr 15 '20 at 17:28
  • Well..... theoretically speaking $i \ne \sqrt {-1}$. There are two $z$ where $z^2 = -1$; that is $z = i$ or $z=-i$ and neither are positive. so the concept of "the" square root of $-1$ is not universally agreed upon. – fleablood Apr 16 '20 at 01:32

2 Answers2

2

Imagine I tell you: “Run to the end of the street, then run back here”. If you do nothing and you just stand there, then you aren’t following the instructions, even though the end result is the same as if you had followed the instructions. Keep this in mind as I do a quick side-step:


(Side step:) Two functions are considered to be “the same” if they have the exact same domain, the exact same codomain, and they take the same value at each and every point in the domain. To specify a function $f$, I need to specify three things: the domain, the codomain, and the rule by which we assign an element of the codomain to each element of the domain. In calculus and pre-calculus, the codomain is almost invariably all real numbers. But the domain matters. The function $f\colon [0,\infty)\to\mathbb{R}$ given by $f(x)=x^2$, and the function $g\colon\mathbb{R}\to\mathbb{R}$ given by $g(x)=x^2$ are different functions, because they have different domains.

But specifying the domain each and every time we want to consider a function is annoying. So we have a convention (an agreement): if we described a function with a formula, and we do not explicitly give a domain, we mean the “natural domain”, which is, essentially, “all real numbers for which the formula makes sense.” So the domain of $f(x)=\sqrt{x+1}$ is $[-1,\infty)$, because those are exactly the real numbers for which the formula makes sense.


The “instructions” for the function $f(x)=(\sqrt{x})^2$ are “first take the square root of the input, then square the result.” Even though that seems like it is the same as just “spitting out” the input $x$, that does not follow the instructions: the function that says “the result is the same as the input” is different. Under the convention mentioned above, the domain of $f(x)=(\sqrt{x})^2$ is “all real numbers for which the formula makes sense”, and that’s the nonnegative real numbers only. Whereas the function $g(x) = x$ has domain all real numbers (because that formula makes sense for all numbers). That means that this $f$ and this $g$ are different functions, because they have different domains.


See also this previous answer, and this one.

Arturo Magidin
  • 398,050
  • So do you mean to say that while the function processes the real input then at any intermediate step anything obtained outside the circle of real numbers will be undefined and so $\sqrt {-1}$ will be also considered undefined which otherwise is defined outside the circle of real numbers and can I conclude that for real valued functions anything obtained(not only output but also at any intermediate step) outside the circle of real numbers will be considered undefined which otherwise may be defined. – dRIFT sPEED Apr 16 '20 at 09:03
  • @pRSmHJN1: I don’t know what you mean by “the circle of real numbers”; that is not a terminology I am familiar with. I mean to say exactly what I said; I did not hide my meaning anywhere. The square root function, as a function with real values, is defined only for nonnegative numbers. “$\sqrt{-1}$” is not a sensible expression in that context. Functions defined by their formulas are defined by their formulas. It makes absolutely no sense to talk about an output that does not come from following all the instructions in the function, so you cannot talk about “only output” without steps. – Arturo Magidin Apr 16 '20 at 16:58
  • I'm sorry for using such terminology what I mean to say is that can I conclude from your answer that not only the output but also at each and every intermediate step of processing the input any thing obtained outside the set of real numbers is not defined even though it may be defined otherwise. – dRIFT sPEED Apr 16 '20 at 21:45
  • Yes pRS, every intermediate step must be a real number. – Sarvesh Ravichandran Iyer Apr 27 '20 at 14:31
1

If $f(x)=(\sqrt{x})^2$, then $f=g \circ h$, where $g(x)=x^2$ and $h(x)=\sqrt{x}$.

It is clear that $\operatorname{dom}(f) = \operatorname{dom}(h) = [0,+\infty)$, since $\operatorname{dom}(g)= \mathbb R$.

In general, $\operatorname{dom}(g \circ h) = \operatorname{dom}(h) \cap h^{-1}(\operatorname{dom}(g))$. In words, $g \circ h$ is defined at $x$ iff $h$ is defined at $x$ and $g$ is defined at $h(x)$.

lhf
  • 216,483