Let $x=(1,0)$ and $y=(a,-2)$ be two vectors $ℝ^2$, where $a$ is a real number. Then compute the quantity $$ \frac{{x}\cdot{y}}{{\|x\|\|y\|}}$$ in terms of $a$.
My work so far:
$$x\cdot y=1\cdot a+0\cdot(-2)=a$$
And so
$$\|x\|=\sqrt{{1^2}+{a^2}}=1+a$$
$$\|y\|=\sqrt{{0^2}+{(-2)^2}}=2$$
Thus
$$\cos(\theta)\frac{a}{\sqrt{{2a+2}}}$$ $$\theta=\cos^{-1}\frac{a}{\sqrt{2a+2}}$$
And I'm stuck here. Where did I go wrong to compute the quantity in terms of a? Would there be any better ways of tackling this?
Your computation that $\;\mathbf x\cdot\mathbf y=a\;$ was okay, but
$||\mathbf x||=||(1,0)||=\sqrt{1^2+0^2}=1,$ and $||\mathbf y||=||(a,-2)||=\sqrt{a^2+(-2)^2}=\sqrt{a^2+4},$
so $\dfrac{\mathbf{x}\cdot\mathbf{y}}{\mathbf{||x||||y||}} = \dfrac a{\sqrt{a^2+4}}.$
Also, as pointed out in the comments, you should be aware that
$\sqrt{1^2+a^2}$ does not generally equal $1+a$. (To see that, try squaring them both.)