<s>[INST] 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.
 [/INST] Hint:
$$\int{\frac{(x^2 + 4)dx}{x^2 + 6x +10}}=\int{\frac{x^2 + 6x + 10-6x-6}{x^2 + 6x +10}}dx=x-6\int{\frac{x+1}{x^2 + 6x +10}}dx$$
Next hint:
$$6\frac{x+1}{x^2 + 6x +10}=3\frac{\color{blue}{2x+6}-4}{x^2 + 6x +10}$$
Next hint:
$$x^2 + 6x +10 = (x+3)^2+1$$
</s>