What is $\tan \alpha$, if $(a+2)\sin\alpha +(2a - 1)\cos\alpha =2a + 1$? I tried the following:
$$\begin{aligned}a\sin\alpha +2\sin\alpha + 2a\cos\alpha - \cos\alpha &= 2a+1\\
a(\sin\alpha +2\cos\alpha)+(2\sin\alpha-\cos\alpha)&=2a+1\end{aligned}$$
Therefore,
$$\sin\alpha +2 \cos\alpha=2$$
$$2\sin\alpha - \cos\alpha=1$$
From these two equations, we get
$$\sin\alpha=\frac{4}{5},\cos\alpha=\frac{3}{5}$$
Therefore,
$$\tan\alpha = \frac{\sin\alpha} {\cos\alpha} = \frac{4} {3}$$
Is this a correct method to solve the question? Since $a$ is a constant, it does not seem necessary to me that its coefficients on the two sides of the equation be equal. Should I find $\sin\alpha$ and $\cos\alpha$ using some other method? Are there specific cases where this method of equating the coefficients will break?

The problem is that $a$ is a constant, not a variable. Therefore equating by parts does not work here: if we separate $2a - 1$ into $2(a-1) + 1$, $2(a-2) + 3$ and so on, we end up with a different set of solutions each time. If you try substituting $\sin \alpha$ and $\cos \alpha$ back into the original question, the LHS does not equal $2a-1$, so clearly something must have gone wrong.
Instead, notice that as this is an identity, so it must hold for all $a$. Substituting $a = -2, \frac{1}{2}$ to cancel one of the terms, we get:
$$-5 \cos a = -5 \Rightarrow \cos a = 1$$
$$\frac{5}{2} \sin a = 0 \Rightarrow \sin a = 0$$
