# 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?

• $2\cos x-\sin x=-\sqrt5\sin(x-\arctan2)$ and $3\sin x+5\cos x=\sqrt{34}\sin(x+\arctan(5/3))$, and I'm not immediately convinced that this rewriting will be of much use in simplifying the integral – user170231 Jun 25 '20 at 22:20
• @user170231 In the meantime, thank you for your comment, which I have appreciated. But for the $3\sin x+5\cos x$ I will use the $a\sin x+b\cos x=\lambda \cos (x+\varphi)$. – Sebastiano Jun 25 '20 at 22:25
• @Ty. Hi, meanwhile, I can't tell if the split is as unique as the one I highlighted in red. It was just a curiosity because I'd have the derivative of the denominator at the numerator less than the sign but I wouldn't have the term in $x$ less than the coefficient. – Sebastiano Jun 25 '20 at 22:53

$$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?

• My $\infty$ thank you. I think that this way is more complicated. – Sebastiano Jun 27 '20 at 9:01
• @Sebastiano: You are welcome. This way isn't complicated. It only involves calculating $\cos (a+b)$. Given $\tan a, \tan b$, we can find $\sin, \cos$ and after finding $\sin (a+b)$, we can find $\cos (a+b)$. Why do you think that it's complicated? – Koro Jun 27 '20 at 9:05
• @Sebastiano: What I would do is imagine a rt. angled triangle (for angle $a$), then its perp. is $1$,base is $2$ and hence hypot. is $\sqrt 5$. Hence we can find $cos a$, $sin a$ etc. Similarly for angle $b$. You don't have to do $\sin(arctan (1/2)+arc tan (3/5))$ – Koro Jun 27 '20 at 9:10
• Why there are roots square $\cos \theta=\pm 1/\sqrt{1+\tan^2\theta}$, $\sin \theta=\pm \tan \theta/\sqrt{1+\tan^2\theta}$ and the choice of angle depends on the coordinates of the point. I don't really like it that much. It was just a thought of mine. – Sebastiano Jun 27 '20 at 9:14
• I have always appreciated 😊 in every community the correct answers of the users. You're right but the question is relative for students of high school. It is necessary one hour to have the final solution. – Sebastiano Jun 28 '20 at 11:24

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.

• Thank you very much....$\infty$. – Sebastiano Jun 27 '20 at 21:03

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.