Find the range of $ x-\sqrt{4-x^2}$ $Y=x-\sqrt{4-x^2}$. How to find these types of functions' range?
I just know that the answer is $R=\{y\in\mathbb{R}\mid-2\sqrt{2}\leq y\leq 2\}$,  but I have no idea how to find it step by step.
 A: Hint
Let
$x=2\cos{t}$,then
$$x-\sqrt{4-x^2}=2\cos{t}\pm 2\sin{t}$$
case 1
if $t\in[0,\pi]$,then
$$x-\sqrt{4-x^2}=2\cos{t}-2\sin{t}=2\sqrt{2}\cos{\left(t+\dfrac{\pi}{4}\right)}\in [-2\sqrt{2},2] $$
if case 2,$t\in[\pi,2\pi]\Longrightarrow \dfrac{5}{4}\pi\le t+\dfrac{\pi}{4}\le\dfrac{9\pi}{4}$
then
$$x-\sqrt{4-x^2}=2\cos{t}+2\sin{t}=2\sqrt{2}\sin{\left(t+\dfrac{\pi}{4}\right)}\in [-2\sqrt{2},2]$$
A: We have $y=x-\sqrt{4-x^2}$. Function domain
\begin{equation*}
4-x^2\ge 0,~~|x|\le 2
\end{equation*}
Now find the value of function at the ends of the segment
\begin{equation*}
y(-2)=-2, ~~y(2)=2
\end{equation*}
Find the extrema
\begin{equation*}
y^{\prime} = 1-\frac{-2x}{2\sqrt{4-x^2}}=0
\end{equation*}
\begin{equation*}
\frac{-x}{\sqrt{4-x^2}}=1
\end{equation*}
Because $\sqrt{...}>0$ and $1>0$, so $x$ must be negative. Now solve the last equation, we get:
\begin{equation*}
\frac{x^2}{4-x^2}=1~\to~x^2=4-x^2~\to~x=\pm\sqrt{2}~\to~x=-\sqrt{2}
\end{equation*}
We get that the minimal value of function is
\begin{equation*}
y(-\sqrt{2})=-2\sqrt{2}
\end{equation*}
Remember that $x=-\sqrt{2}$ is the only one extrema and $y(-2)<y(-\sqrt{2})$, we see that $y$ decrease at $x\in[-2;-\sqrt{2}]$ and increase at $x\in[-\sqrt{2};2]$. After comparison of values of function at the ends of the segment we get, that the maximal value of function is $y(2)=2$, so
\begin{equation*}
-2\sqrt{2}\leq y\leq 2
\end{equation*}
