Finding other trigonometric ratios from one I was given this answer:

So I was told that
$$\tan(x) = 2$$
Then, they said from this statement they could know that:
$$\cos(x) = \frac{1}{\sqrt{5}}$$
$$\sin(x) = \frac{2}{\sqrt{5}}$$
Now, I understand that if I do
$$\tan^{-1}(2) = 63.4$$
And then after that I can get the ratio of cosine and sine. However, I don't know how they got the precise fraction. Does anyone know how?
 A: You have $\tan (x)=\frac{\sin (x)}{\cos (x)}=c$ that implies $\sin (x) = c \cdot \cos (x)$. In your case $c=2$. Using the fondamental law of goniometry:
$$\sin ^2(x)+\cos ^2(x)=1,$$
you have just to solve a system
$$\begin{cases}
\sin (x) = c \cdot \cos (x) \\
\sin ^2(x)+\cos ^2(x)=1
\end{cases}
$$
In your case you have substituing the first equation to the second: 
$$5 \cos ^2 (x)=1$$
and so, if we consider the $\cos (x)$ be positive:
$$\cos (x) = \frac{1}{\sqrt{5}}$$
Such that $\sin (x) = 2 \cos (x)$ we obtain:
$$\sin (x) = 2 \cos (x) = \frac{2}{\sqrt{5}}$$
It's not an unique solution (if we don't have any angle constraints), because we could consider $\cos (x) = - \frac{1}{\sqrt{5}}$ and $\sin (x) =  -\frac{2}{\sqrt{5}}$ too
A: Recall that $\tan(\alpha)=\displaystyle\frac{\text{opposite}}{\text{adjacent}}=\dfrac{2}{1}$ 

By the Pythagorean theorem, the hypotenuse is $\sqrt{2^2+1^2}=\sqrt{5}$. Thus $$\sin(\alpha)=\dfrac{\text{opposite}}{\text{hypotenuse}}=\dfrac{2}{\sqrt{5}}$$ and $$\cos(\alpha)=\dfrac{\text{adjacent}}{\text{hypotenuse}}=\dfrac{1}{\sqrt{5}}$$
A: $\tan x=2\implies \sin x=2\cos x$...
Now $\cos^2x+\sin^2x=1\implies \cos^2x+4\cos^2x=1\implies \cos^2x=\frac15\implies \cos x=\pm\frac{\sqrt5}5 $. 
Now $\sin x=\pm\sqrt{1-\cos^2x}=\pm\sqrt{1-\frac15}=\pm\frac{2\sqrt5}5$...
If we are in the first quadrant, take the positive values...
