Solve integral $\int{\frac{x^2 + 4}{x^2 + 6x +10}dx}$ Please help me with this integral:
$$\int{\frac{x^2 + 4}{x^2 + 6x +10}}\,dx .$$
I know I must solve it by substitution, but I don't know how exactly.

\begin{align}
\int \frac{x^2+4}{x^2+6x+10}dx&=\int \frac{x^2+6x+10-(6x+18)+12}{x^2+6x+10}dx\\
&=\int1dx-3\int \frac{2x+6}{x^2+6x+10}dx+12\int \frac{1}{x^2+6x+10}dx\\
&=x-3\ln(x^2+6x+10)+12\int \frac{1}{(x+3)^2+1}dx\\
&=x-3\ln(x^2+6x+10)+12\int \frac{\sec^2u}{\tan^2u+1}du\\
&=x-3\ln(x^2+6x+10)+12\int 1du\\
&=x-3\ln(x^2+6x+10)+12\tan^{-1}(x+3)+C\\
\end{align}
