We now factor the denominator down to linear factors:
where the multiplicities must sum to n, and m is the number of distinct roots. Given this factorization (admittedly difficult to obtain sometimes) we have, from first year calculus,
Calculation of the coefficients is tedious but straightforward, and several techniques exist for hand calculation (one will be sketched in the first example). The key point is that each term can be easily integrated, so
and we are done. Notice that the only new function we need is a logarithm. I remark that even in first year calculus, students find the complex form with logarithms easier than the real form with arctangents, once they have been properly prepared. In B.C. I understand that's not really an option since students are not taught complex numbers (which is the shame of the world, so it is).
The fact that is indeed a new function requires proof---this is exercise 1 in Assignment 5. What is surprising is that this one new function gets us all the elementary functions that can be integrated (more on that next week).