$\int\frac{2x+1}{x^2+2x+5}dx$ by partial fractions $$\int\frac{2x+1}{x^2+2x+5}dx$$
I know I'm supposed to make the bottom a perfect square by making it $(x+1)^2 +4$ but I don't know what to do after that. I've tried to make $x+1= \tan x$ because that's what we did in a class example but I keep getting stuck.

$$
\int\frac{2x+1}{x^2+2x+5}dx
$$
I would first write $w=x^2+2x+5$, $dw=(2x+2)\,dx$, and then break the integral into
$$
\int\frac{2x+2}{x^2+2x+5}dx + \int\frac{-1}{x^2+2x+5}dx.
$$
For the first integral I would use that substitution.  Then
$$
\overbrace{\int\frac{-dx}{x^2+2x+5} = \int\frac{-dx}{(x+1)^2 + 2^2}}^{\text{completing the square}} = \frac{-1}2\int \frac{dx/2}{\left(\frac{x+1}{2}\right)^2+1} = \frac{-1}2 \int\frac{du}{u^2+1}.
$$
Then we get an arctangent.
