Is there a general formula for the antiderivative of rational functions? Some antiderivatives of rational functions involve inverse trigonometric functions, and some involve logarithms. But inverse trig functions can be expressed in terms of complex logarithms. So is there a general formula for the antiderivative of any rational function that uses complex logarithms to unite the two concepts?

Write the rational function as $$f(z) = \dfrac{p(z)}{q(z)} = \dfrac{p(z)}{\prod_{j=1}^n (z - r_j)}$$
where $r_j$ are the roots of the denominator, and $p(z)$ is a polynomial.
I'll assume $p$ has degree less than $n$  and the roots $r_j$ are all distinct.
Then the partial fraction decomposition of $f(z)$ is
$$ f(z) = \sum_{j=1}^n \frac{p(r_j)}{q'(r_j)(z - r_j)}$$
where $p(r_j)/q'(r_j)$ is the residue of $f(z)$ at $r_j$.  An antiderivative
 is 
$$ \int f(z)\ dz = \sum_{j=1}^n \frac{p(r_j)}{q'(r_j)} \log(z -r_j)$$
