A rational function can be rewritten using what is known as partial fraction decomposition. This procedure often allows integration to be performed on each term separately by inspection. For each factor of the form , introduce terms
(1)
For each factor of the form , introduce terms
(2)
Then write
(3)
and solve for the s and s. Partial fraction decomposition is implemented as Apart starting in Mathematica Version 4.0.