<s>[INST] Computing $\int \frac{4\tan(x)+5}{\sin^2(x)+2\cos^2(x)+3\sin(x)\cos(x)} $ $$\int \frac{4\tan(x)+5}{\sin^2(x)+2\cos^2(x)+3\sin(x)\cos(x)} $$
This question was asked today in my maths exam, 
It was one of those two questions which I couldn't answer, How do you go about answering it ?
 [/INST] $$\begin{align}\int \frac{4\tan(x)+5}{\sin^2(x)+2\cos^2(x)+3\sin(x)\cos(x)} dx
&=
\int \frac{4\tan(x)+5}{\cos^2(x)(\tan (x)+1) (\tan (x)+2)}dx\\
&=
\int \frac{4u+5}{(u+1) (u+2)}du
\end{align}$$
The last part is by using $u=\tan x$, $du = \frac{dx}{\cos^2 x}$.
I hope you know to continue from here.
Note:
$$
\sin^2(x)+2\cos^2(x)+3\sin(x)\cos(x) =\cos^2(x)( \tan^2(x)+2+3\tan(x))
$$
denote $\tan x = u$ to get
$\tan^2(x)+2+3\tan(x) = u^2+2+3u = (u+1)(u+2)$
</s>