$\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.

$$\frac{d}{dx} \ln(x^2 + 2x + 5) = \frac{2x + 2}{x^2 + 2x + 5}dx$$
$$\int\,\left(\dfrac{2x+2}{x^2 + 2x + 5}- \dfrac{1}{x^2 + 2x + 5}\right)\,dx = \ln(x^2 + 2x + 5) + C - \int\,\dfrac{1}{x^2+2x+5}dx$$
 = 
Let $u=x+1$, so $du = dx$, $x = u - 1$, and $$x^2 + 2x + 5=  u^2 - 2u + 1 + 2u - 2 + 5 = u^2 + 4$$
$$\begin{align}
\int\,\dfrac{1}{x^2+2x+5}dx & = \int\,\dfrac{1}{u^2 + 4}du\\
& = \frac{\arctan\left(\frac{u}2\right)}{2} + C\\
& = \frac{\arctan\left(\frac{x+1}{2}\right)}{2} + C\\
\end{align}$$
$$\int\,\dfrac{2x+1}{x^2+2x+5}\,dx  = \ln(x^2 + 2x + 5) - \frac{\arctan\left(\frac{x+1}{2}\right)}{2} + C$$
