<s>[INST] Added angle formula to solve this indefinite integral $\int\frac{2\cos x-\sin x}{3\sin x+5\cos x }\,dx$ Starting from this very nice question Integrate $\int\frac{2\cos x-\sin x}{3\sin x+5\cos x }\,dx$ and the relative answers, I would to understand because this integral $$\int\frac{2\cos x-\sin x}{3\sin x+5\cos x }\,dx \tag 1$$
must be split thus:
$$\int \frac{2\cos{x}-\sin{x}}{3\sin{x}+5\cos{x}} \; dx=\color{red}{\int A\left(\frac{3\sin{x}+5\cos{x}}{3\sin{x}+5\cos{x}}\right) +B \left(\frac{ 3\cos{x}-5\sin{x}}{3\sin{x}+5\cos{x}}\right)\; dx}$$
or it can be splitted in a different way.
Using the added angle formula (for numerator and denominator of the $(1)$) $$a\sin x+b\cos x=\lambda \sin (x+\phi)$$ if $\lambda=\sqrt{a^2+b^2}$ and $\tan \phi=b/a \ $ or $$a\sin x+b\cos x=\lambda \cos (x+\varphi)$$ with $\tan \varphi=-a/b \ $ is it possible to obtain the same result?
 [/INST] Assuming you have
$$
\int\frac{a\cos x+b\sin x}{c\cos x+d\sin x}\,dx
$$
(with $ad-bc\ne0$, to avoid trivial cases) you can indeed write the denominator as $k\cos(x+\varphi)$ and do the substitution $y=x+\varphi$, so the numerator becomes
$$
a\cos\varphi\cos y-a\sin\varphi\sin y+b\cos\varphi\sin y-b\sin\varphi\cos y
$$
so the integral becomes
$$
\frac{1}{k}\int\Bigl((a\cos\varphi-b\sin\varphi)-(a\sin\varphi-b\cos\varphi)\frac{\sin y}{\cos y}\Bigr)\,dy
$$
which is elementary.
On the other hand, determining $\varphi$ is usually not possible explicitly and, at the end of the day, this is essentially the same as the metod outlined in the question.
</s>