<s>[INST] Indefinite integral of a rational function: $\int\frac{6x+4}{x^2+4}\,dx$ Find $\displaystyle\int\frac{6x+4}{x^2+4}\,dx$
The question asks to find integral of the expression so I divided them into two parts: 
$$
\int\frac{6x}{x^2+4}\,dx
$$
and
$$\int\frac{4}{x^2+4}.
$$
So, for the first integral, I set $u=x^2+4$ and got $\int\frac{3}{u}\,du$ which is $3\ln|x^2+4|+c$. But I don't know how to integrate the second part. 
 [/INST] We have
\begin{align}
\int\frac{6x+4}{x^2+4}dx&=\int\frac{6x}{x^2+4}dx+\int\frac{4}{x^2+4}dx\\&=3\ln(x^2+4)+2\arctan \frac{x}{2}+c
\end{align}
</s>