Evaluate $\int \frac{x+4}{x^2 + 2x + 5}$ I am having issues with this integral. I am not sure if it is irreducible or not. I can't use the quadratic formula, but I can rearrange the integral to be $\int \frac{x+4} {(x^2 + 2x + 1) + 4}$, but I don't know how to deal with the $+4$. 
Here is my work treating the quadratic equation as irreducible with no repeating factors.
$\int \frac{x+4}{x^2 + 2x + 5}$
= $\frac {Ax + B} {x^2 + 2x + 5} $
= $Ax+B(x^2 + 2x + 5)$
= $Ax^3 + 2Ax^2 + 5Ax + Bx^2 + 2Bx + 5B$
= $Ax^3 + (2A + 2B)x^2 + (5A + 2B)x + 5B$
However I get stuck trying to solve my system of equations. This leads me to believe that I did the partial fractions improperly.
$\begin{bmatrix}
1 & 0 & 0 \\
2 & 2 & 0 \\
5 & 2 & 1 \\
0 & 5 & 4 \\
\end{bmatrix}$
 A: Given $$\int\dfrac{x+4}{x^2+2x+5}dx=\int\dfrac{x+4}{(x+1)^2+4}dx$$
Use u-substitution: $u=x+1$ and we get
\begin{align}
\int\dfrac{u+3}{u^2+4}du &= \int\dfrac{u}{u^2+4}du+\int\dfrac{3}{u^2+4}du \\
&= \dfrac12\ln|u^2+4|+\dfrac32\arctan\left(\dfrac u2\right) +c \\
&= \dfrac12\ln|(x+1)^2+4|+\dfrac32\arctan\left(\dfrac{x+1}{2}\right) +c
\end{align}
Therefore, $$\int\dfrac{x+4}{x^2+2x+5}dx=\dfrac12\ln|(x+1)^2+4|+\dfrac32\arctan\left(\dfrac{x+1}{2}\right) +c$$
A: The denominator has no real roots, which means you'll try to rewrite as follows ($A,B\in\mathbb{R}$):
$$\frac{x+4}{x^2 + 2x + 5} = A\underbrace{\frac{\left(x^2 + 2x + 5\right)'}{x^2 + 2x + 5}}_{\to \ln}+\underbrace{\frac{B}{x^2 + 2x + 5}}_{\to \arctan}$$
where $\left(x^2 + 2x + 5\right)'=2x+2$, so this comes down to finding $A$ and $B$ such that:
$$x+4=A\left(2x+2\right)+B$$
Once you have $A$ and $B$, you split the integral in two (easy) parts. Can you take it from there?
A: \begin{align}
\frac{x+4}{x^2+2x+5} &= \frac{x+4}{(x+1)^2 +4}   \\
&=\frac{\color{blue}{x+1}}{\color{blue}{(x+1)}^2 +4} +\frac{3}{\color{blue}{(x+1)}^2 +4}   \\
&=\frac{\color{blue}{u}}{\color{blue}{u}^2 +4} +\frac{3}{\color{blue}{u}^2 +4}
\end{align}
A: We will integrate first of all change quadratic $(x+1)^2+4$ and after fraction of $x+1+3$ and divide by quadratic and we can integrate it.
