# Find range of the function $\left(1-\sqrt{x}\right)^2$

I came across the problem of finding range of the function, $$f(x) = \left(1-\sqrt{x}\right)^2$$

I proceed as follow: $$y = \left(1-\sqrt{x}\right)^2$$ $$As, \left(1-\sqrt{x}\right)^2 \ge 0$$ $$So, y \ge 0$$ Hence, range of the given function is $$\left[0,\infty\right).$$

I know the answer is correct, but I am not sure about the process. Is this the correct way to do this ? If not, How to solve this problem ? I couldn't solve this by other methods.

• An alternative to Kavi Rama Murthy's approach would be if you know or can prove that $(1 - \sqrt{x})^2$ is a continuous function that goes to $\infty$ as $x$ goes to $\infty.$ Apr 1, 2021 at 8:48

You proved that the range is contained in $$[0,\infty)$$ not that it is equal to $$[0,\infty)$$. You have to take any $$y$$ in this interval and show that $$y$$ is actually in the range. For this you have to solve the equation $$(1-\sqrt x)^{2}=y$$. Can you do that?

• I couldn't solve that equation to find range. Apr 1, 2021 at 8:48
• In case you wish to disagree, see the comment following the query that I just left Apr 1, 2021 at 8:49
• $x=(1+\sqrt y)^{2}$ is a solution. @RohitJoshi Apr 1, 2021 at 8:50
• @RohitJoshi Yes, but for this question it is enough to find one value of $x$ such that $f(x)=y$. Apr 1, 2021 at 8:58
• @RohitJoshi Once you find $x$ such that $f(x)=y$ (for any $y\in [0,\infty)$) you are done. By definition of range that would prove that the range of $f$ is $[0,\infty)$ Apr 1, 2021 at 9:09

$$\sqrt x=1\pm \sqrt y\ge 0\implies \pm \sqrt y\ge -1$$

Noting that $$y\ge 0$$, we have two cases:

Case 1: $$\sqrt y\ge -1$$
This is true for all $$y\in [0,\infty)$$
Case 2: $$-\sqrt y\ge -1\implies \sqrt y\le 1\implies 0\le y\le 1\implies y\in [0,1]$$
Therefore the range is $$[0,1]\cup [0,\infty)=[0,\infty)$$

Alternative approach to completing the problem.

To show:
$$f(x) = (1 - \sqrt{x})^2$$ is surjective on $$[0,\infty)$$ as $$x$$ goes from $$1$$ to $$\infty$$.

$$\sqrt{x}$$ is known to be a continuous strictly increasing function. Therefore, so is $$f(x)$$.

Further since $$\sqrt{x} \to \infty$$ as $$x\to \infty, f(x)$$ is unbounded, as $$x \to \infty.$$

Suppose there exists $$r \in \Bbb{R^+}$$ such that $$r$$ is not in the range of $$f$$. Since $$f$$ is unbounded, choose $$s$$ such that $$f(s) > r.$$

Consider the closed interval $$[1,s]$$. By the intermediate value theorem, $$f$$, being continuous, takes on every value between $$f(1)$$ and $$f(s)$$. Therefore, since $$0 < r < f(s)$$, there must be some value $$t$$ in $$[1,s]$$ such that $$f(t) = r.$$

This yields a contradiction. Therefore, it can not be the case that there exists any $$r \in \Bbb{R^+}$$ that is outside the range of $$f$$.

• Beautiful Proof. Sadly couldn't accept mutiple answers. But thank you ! Apr 1, 2021 at 9:15

In fact, you proved nothing because you directly stated the answer

$$(1-\sqrt x)^2\ge0.$$

This is a true statement, but you did not verify if all non-negative values can be reached. A more complete discussion is

$$x\ge0\implies1-\sqrt x\in[-\infty,1)=(0,1]\cup(-\infty,0]\implies(1-\sqrt x)^2\ge0$$ and the inequalities are tight.

• Any justification for this downvote ?
– user65203
Apr 1, 2021 at 8:52
• Do you disagree with the comment that I left, following the query? No idea who downvoted you.\ Apr 1, 2021 at 8:52
• @user2661923: no, this is not enough.
– user65203
Apr 1, 2021 at 8:54
• Interesting, I thought that the Intermediate value theorem would kick in. Apr 1, 2021 at 8:57
• @YvesDaoust But range of $1-\sqrt x$ is $1$ to $-\infty$. Apr 1, 2021 at 8:59