How to integrate fractions of polynomials with complex roots $$\int\frac{4x^3-2x^2+60x+10}{x^4+30x^2+125} dx $$
The denominator has no rational roots. It can be factored as $(x^2+5)(x^2+25)$ which gives roots of $\pm i \sqrt{5}$ and $\pm 5i$.  
How can these complex roots be used to integrate the function?
 A: First split up the integral into two parts and then use the natural logarithm and arctan.
$$\begin{align*} P = &\frac{4x^3-2x^2+60x+10}{x^4+30x^2+125} \\
  = &\frac{4x^3-2x^2+60x+10}{(x^2+25)(x^2+5)} \\
  = &\frac{2x-3}{x^2+25} + \frac{2x+1}{x^2+5}\end{align*}$$
So $\int P \,\mathrm{d}x = \int \frac{2x-3}{x^2+25}\mathrm{d}x + \int\frac{2x+1}{x^2+5}\mathrm{d}x $ :
$$ \int \frac{2x-3}{x^2+25}\mathrm{d}x = \int \left(\frac{2x}{x^2+25}-\frac{3}{x^2+25}\right)\mathrm{d}x = \ln(x^2+25)-\frac{3}{5}\arctan{\left(\frac{x}{5}\right)} + c$$
$$ \int\frac{2x+1}{x^2+5}\mathrm{d}x = \int \left(\frac{2x}{x^2+5} + \frac{1}{x^2+5}\right)\mathrm{d}x = \ln(x^2+5) + \frac{1}{\sqrt{5}}\arctan{\left(\frac{x}{\sqrt{5}}\right)} + c$$
Now add these to get (which could simplify further, but I'll leave as is):
$$ \int P \,\mathrm{d}x = \ln(x^2+25) + \ln(x^2+5) + \frac{1}{\sqrt{5}}\arctan{\left(\frac{x}{\sqrt{5}}\right)} - \frac{3}{5}\arctan{\left(\frac{x}{5}\right)} + c$$
A: This answer is just an sketch for the general way to solve these integrals. For rational functions $p/q$ (such that the degree of $q$ is greater than the degree of $p$) with real coefficients we ever can write our rational function in a simple partial fraction decomposition of the kind
$$p/q=\sum_{k=0}^{n-1}\sum_{j=1}^{m_k}\frac{a_{k,j}}{(x-r_k)^j}$$
for $n$ distinct roots $r_k$ (of the denominator $q$) of multiplicity each one $m_k$, and all $a_{k,j}\in\Bbb C$. We have the following results:


*

*If $r_k$ is complex then $r_h=\bar r_k$ is a root of $q$ with the same multiplicity of $r_k$, and $a_{h,j}=\bar a_{k,j}$ for each $j$.

*If $r_k$ is real then $a_{k,j}$ is real for each $j$.
For $j\ge 2$ the integration of any partial fraction is immediate and we can combine the result of the integration of conjugated roots with the same multiplicity to have a rational function with real coefficients.
For $j=1$ we can integrate together the conjugated roots writting
$$\frac{a_{k,1}}{x-r_k}+\frac{\bar a_{k,1}}{x-\bar r_k}=\frac{2x\Re(a_{k,1})-2\Re(a_{k,1}\bar r_k)}{x^2-2x\Re (r_k)+|r_k|^2}=\\=\Re(a_{k,1})\cdot\frac{2x-2\Re(r_k)}{x^2-2x\Re (r_k)+|r_k|^2}+\underbrace{\frac{2(\Re(a_{k,1})\Re(r_k)-\Re(a_{k,1}\bar r_k))}{|r_k|^2-(\Re(r_k))^2}}_{\text{this is a constant}}\cdot\frac{1}{\left(\frac{x-\Re(r_k)}{\sqrt{|r_k|^2-(\Re(r_k))^2}}\right)^2+1}$$
Then the above can be solved as a logarithm and an arc-tangent because
$$|r_k|\ge|\Re(r_k)|\implies |r_k|^2-(\Re(r_k))^2\ge 0$$
