Integration of $ \int \frac{2\sin x + \cos x}{\sin x + 2\cos x} dx $ How can I integrate this by changing variable?
$$ \int  \frac{2\sin x + \cos x}{\sin x + 2\cos x} dx $$
Thanks.

Let $u(x)=\log(\sin x + 2\cos x)$, then $(\sin x + 2\cos x)'=\cos x-2\sin x$ hence $$u'(x)=\frac{\cos x-2\sin x}{\sin x + 2\cos x}.$$ More generally, for every $(a,b)$, $$(au(x)+bx)'=\frac{(a+2b)\cos x+(b-2a)\sin x}{\sin x + 2\cos x}$$ Solving for $(a+2b,b-2a)=(1,2)$ yields $(a,b)=(-\frac35,\frac45)$ hence $$ \int  \frac{2\sin x + \cos x}{\sin x + 2\cos x}\,\mathrm dx=-\frac35u(x)+\frac45x+C=-\frac35\log(\sin x + 2\cos x)+\frac45x+C. $$
