<s>[INST] 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}$
 [/INST] 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?
</s>