Integrating the trigonometric function So the problem goes as follows:-
$$\int{{\cos^2x+\sin2x}\over{(2\cos x-\sin x)^2}}~dx$$
My attempt is as follows:-
\begin{align*}\int{{\cos^2x+\sin2x}\over{(2\cos x-\sin x)^2}}~dx&=\int{{\cos^2x+2\sin x\cos x}\over{(2\cos x-\sin x)^2}}~dx\\
&=
\int{{(\cos x)(\cos x+2\sin x)}\over{(2\cos x-\sin x)^2}}~dx
\end{align*}
Now i could see that $\cos x+2\sin x $ is $-1$ times derivative of the denominator:-
$$\cos x+2\sin x=(-1){{d(2\cos x-\sin x)}\over{dx}}$$
And to handle the $\cos x$ term in the numerator i tried the following:-
$$2\cos x=t+\sin x \implies \cos x={{t+\sin x}\over{2}}$$
But the $\sin x$ term in the numerator is annoying.   

Integrate by parts
With $v=\dfrac{\cos x+2\sin x}{(2\cos x-\sin x)^2}=\dfrac{d(2\cos x-\sin x)^{-1}}{dx}$
the required integration $$=\cos x\int v\ dx-\int\left(\dfrac{d(\cos x)}{dx}\cdot \int v\ dx\right)$$
Finally for $\int\dfrac{a\cos x+b\sin x}{c\sin x+d\sin x)}dx,$
write $a\cos x+b\sin x=p(c\sin x+d\cos x)+q\cdot\dfrac{d(c\sin x+d\cos x)}{dx}$
Can you identify $a,b,c,d$ here and find $p,q$
