<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] Since you've nailed the first of the split integral, I'll address only the second:
If you make the substitution $\,x = 2\tan\theta,\,$ then $\,\theta = \arctan\left(\frac x2\right)\,$ and $\,dx = 2\sec^2 \theta.$
We also make use of the identity: $$\tan^2 \theta + 1 = \sec^2\theta\tag{1}$$
That gives you $$\begin{align} \int\frac{4\,dx}{x^2+4}& =\int \frac{4\cdot 2\sec^2\theta\,d\theta}{4\tan^2\theta + 4} \\ \\ 
& = \int \frac{2\sec^2 \theta\,d\theta}{\tan^2\theta +1}\\ \\ 
& = \int \frac{2\sec^2 \theta\,d\theta}{\sec^2\theta}\tag{1}\\
& = \int 2d\theta \\ \\ 
& = 2\theta + C \\ \\ 
& = 2\arctan\left(\frac x2\right) + C\end{align}$$
</s>