How to integrate $\frac{x+4}{x^2+2x+5}$ Having a little trouble on how to break it up. How to integrate $$\frac{x+4}{x^2+2x+5}$$

You may want to try this approach:


*

*Let $r_{i}$ be the complex roots of the polynomial $x^2 + 2x+5$, $r_{1,2} = -1 \pm 2 \mathrm{i}$.

*Perform a partial fraction decomposition of the integrand:
$$Q(x) = \frac{x+4}{x^2+ 2x +5} = \frac{A}{x-r_1} + \frac{B}{x-r_2},$$

*Then the coefficients $A$ and $B$ can be computed as follows:
$$\begin{align}
&A = \lim_{x \to r_1} (x-r_1) Q(x) = \frac{r_1 +4}{r_1 -r_2}, \\
&B = \lim_{x \to r_2} (x-r_2) Q(x) = \frac{r_2 +4}{r_2 -r_1}, 
\end{align}$$ and $A = \overline{B}$ (complex conjugates).

*Integrate and simplify:
$$I = \int Q(x) \, \mathrm{d}x = A \log{|x-r_1|} + B \log{|x-r_2|}.$$
The result should remain real.
Cheers!
