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.

$$\int{\frac{x^2 + 4}{x^2 + 6x +10}}dx=x-6\int{\frac{x+1}{x^2 + 6x +10}}dx$$
$$\int{\frac{x+1}{x^2 + 6x +10}}dx=\int{\frac{x+1}{(x+3)^2+1}}dx$$ now we can use $u$ substitution where $u=x+3$ and $du = dx$ so
$$\int{\frac{u-2}{u^2+1}}du=\int{\frac{u}{u^2+1}}du-2\int{\frac{1}{u^2+1}}du=\frac{\ln|u^2+1|}{2}-2\arctan(u)+C$$ now just substitute whatever u is.
