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?
 A: $I=\int\frac{2\cos x-\sin x}{3\sin x+5\cos x }\,dx $ 
$2\cos x-\sin x=\sqrt5 \cos(x+a) $, where $\tan a=1/2$ and $ 3\sin x+5\cos x=\sqrt{34}\cos(x-b) $, where $\tan b=3/5$ 
$I=\int \frac{\sqrt 5 \cos(x+a) } {\sqrt{34}\cos(x-b)} \, dx$ Substitute $t=x-b$ so that 
$I=\sqrt{5/34}\int \frac{\cos(t+a+b) } {\cos t}\, dt$
The integrand is now: $\cos(a+b) - \tan t\sin(a+b) $ Can you take it from here?
A: 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.
A: Answer for @Koro: Yes with some calculus I obtain:
$$\int \left(\cos \left(a+b\right)-\tan \left(t\right)\sin \left(a+b\right)\right)dt=t\cos \left(a+b\right)+\sin \left(a+b\right)\ln \left|\cos \left(t\right)\right|+k, \quad k\in\mathbb R$$
Hence,
$$\int\frac{2\cos x-\sin x}{3\sin x+5\cos x }dx=$$
$$=\sqrt{\frac{5}{34}}\left[(x-b)\cos \left(a+b\right)+\sin \left(a+b\right)\ln \left|\cos \left(x-b\right)\right|\right]+k=$$
But $a=\arctan (1/2)$ and $b=\arctan (3/5)$. But I will have many calculus having,
$$\cos(\arctan (1/2)+\arctan (3/5))=\dotsb$$
$$\sin(\arctan (1/2)+\arctan (3/5))=\dotsb$$
$$(x-\arctan (3/5))=\dotsb, \quad \cos(x-\arctan (3/5))=\dotsb$$
I think that it takes a lot of time for this way.....to obtain the solution.
