Can you show me how to integrate by using partial fractions?
Oh, I’d be happy to.
Integration by partial fractions has a peculiar pedagogical pedigree. It is often presented in calculus courses as a way of integrating rational functions, but it is rarely accompanied by a complete theoretical description – it’s more like a messy recipe with various cases which suffice for the final exam. The presentation leaves many students unsure what exactly is it that they’re doing, what the general case is like, and why. This is usually left unresolved throughout undergrad and graduate studies.
I can’t think of another instance where a basic result or technique is taught in such a half-assed way. Curriculum designers often choose to leave or include this or that in an undergrad program, but when something is included, it is usually included properly. The situation with partial fractions is akin to learning about the Jordan canonical form in the real case only, and merely through a few examples. It’s a travesty.
In the paper by Bradley and Cook I cite below, they write:
Analysts view this as pure algebra (which it is) so it should not be addressed in a course on analysis. Algebraists typically view partial fractions as a technique only good for integrating and thus a problem for analysts. So, outside of the realm of symbolic computation, the partial fraction decomposition tends to never be fully discussed.
This doesn’t bother all students, perhaps not even most students, but it drives people like me insane. I can’t comprehend anything if I don’t see the general context and complete proofs. Scattered techniques like this make me feel like my knowledge has decreased, rather than increased.
So, here’s my attempt at addressing this. I’ll try to explain the idea behind partial fraction decomposition in various contexts, as well as its (very legitimate) connection to integration, and perhaps a few other uses if we have time. I can’t do the topic full justice in an answer; I will merely be able to outline how I would teach this if I were to.
Shall we?
Representations
Everyone knows that natural numbers can be written down as usual, in decimal notation, like 196884, or through their prime factorization, as in 2^2 \times 3^3 \times 1823. Most people (I think) also understand that various things are easier or harder to do in either form of notation.
Many students of math also know that something very similar is true of polynomials. A (single variable) polynomial can be written down as x^8 + 2 x^7 - 2 x^6 - 6 x^5 + 6 x^3 + 2 x^2 - 2 x - 1, a sum of powers of x with coefficients, or as a product of irreducible factors with possible multiplicity, as in (x^2+1)^2(x-1)^2. Once again, certain tasks become easier with either form of presentation.
Now, what about rational numbers? And what about rational functions, which are the analogous thing for polynomials?
We usually write rational numbers like \frac{77}{12}: a numerator and a denominator expressed as decimals. Of course we can factor both numbers and write \frac{7 \times 11}{2^2 \times 3}. Same thing.
But there are other ways. One form is a continued fraction, as in
\displaystyle \frac{77}{12} = 6+\frac{1}{2+\frac{1}{2+\frac{1}{2}}}
This is also (extremely) useful in various ways, but we won’t go there now. Are there other ways?
Well, yes there are.
For reasons which, I think, aren’t fully understood, early texts from Egypt’s Middle Kingdom exhibit a strong preference to represent fractions as sums of distinct unit fractions, as in
\displaystyle \frac{29}{24} = \frac{1}{2}+\frac{1}{3}+\frac{1}{4}+\frac{1}{8}.
Such representations, dubbed “Egyptian Fractions”, do sometimes have a utility, but they aren’t important enough nowadays to be taught as a systematic way of representing rational numbers. We should note the idea, though: we are decomposing a rational number into a sum of fractions which have a certain simplicity. They all have a numerator of 1.
Also, let’s note something about the denominators in that representations: 2, 3, 4 and 8 all divide 24. This isn’t surprising, when you think about what happens when you add up fractions. We’ll see how this plays out later.
What would be the analogous thing for rational functions? And why would it be useful?
Integrating Rational Functions
First, a reminder: a rational function is a ratio of two polynomials, such as
\displaystyle \frac{x^5-2x^3+1}{x^2-3}.
In general, we write
\displaystyle R(x) = \frac{f(x)}{g(x)}
where f,g are polynomials.
Rational functions come up in many different contexts, both in pure math and in applications. Just like rational numbers, they can be represented in different ways, so first let us motivate why we would go looking for a representation as a sum of simple fractions.
When we learn about derivatives, we quickly see that differentiating any expression is a purely mechanical process. This is because, once we know to differentiate f and g, we can also handle f+g, fg, and also f \circ g which is the composition f(g(x)).
Then we start going the other way, finding antiderivatives: given a function f, we seek a function F with F'=f. This is usually denoted as F=\int f(x)\,\mathrm{d}x, an indefinite integral. And here things get complicated.
Indefinite integrals are linear, so they behave nicely with respect to addition and scalar multiplication. But unfortunately, that’s pretty much it. If you know the antiderivatives of f and g, there’s generally no way to determine the antiderivatives of fg or f\circ g and so on.
We do know how to integrate polynomials, and even some very simple rational functions, because we all know that \frac{d}{dx}x^n = nx^{n-1}, and so
\displaystyle \int x^k \,\mathrm{d}x = \frac{1}{k+1}x^{k+1}
for any integer k \ne -1, while
\displaystyle \int x^{-1} \,\mathrm{d}x = \log(x)
where \log denotes the natural logarithm. As a result, we can also handle \int (x-a)^k\,\mathrm{d}x for any number a and integer k.
Ok great. But what about more complicated rational functions, like \frac{x^3+x+5}{x^2-1}?
Well, obviously, all we need to do is manage to write every rational function as a sum of those simple ones, like \frac{1}{(x-a)^k}, or even \frac{17}{(x-a)^k}, since we aren’t worried about multiplicative constants. Integrating sums is easy, even with whatever multiplicative constants (aka linear combinations).
Note well: the “simple” fractions we seek have very simple numerators, just numbers; and denominators which are just powers of a linear polynomial. As we shall see, this works perfect over the complex numbers, but another complication is introduced if we insist on working with real numbers only.
Partial Fraction Decomposition: Fooling Around
Before we do the general case, let’s look at some simple examples.
\displaystyle \frac{1}{x-1}
This one is already fine. We know how to integrate (x-1)^{-1}.
\displaystyle \frac{x}{x-1}
Notice how merely changing the numerator from 1 to x makes the integral non-obvious. However, there’s an easy fix:
\displaystyle \frac{x}{x-1} = \frac{x-1+1}{x-1}=1+\frac{1}{x-1}
and similarly
\displaystyle \frac{x^2}{x-1} = \frac{(x+1)(x-1)+1}{x-1} =(x+1)+\frac{1}{x-1}
what’s going on here? This should remind you of something: we’re simply replacing the numerator with a quotient and remainder upon division by the denominator.
\displaystyle \frac{19}{6} = \frac{3 \times 6 + 1}{6} = 3+\frac{1}{6}
In a similar way, we re-wrote the numerator x^2 as q(x)(x-1)+r(x), a quotient and a remainder. A basic skill you should have before tackling partial fractions is polynomial division with remainder, aka the Euclidean Algorithm for polynomials. It really works the exact same way as with numbers.
The general conclusion here is that we can handle anything of the form
\displaystyle \frac{f(x)}{x-1}
by simply dividing f(x) = q(x)(x-1)+r(x), and so
\displaystyle \frac{f(x)}{x-1} = q(x)+\frac{r(x)}{x-1}
In fact, since the denominator has degree 1, the remainder r(x) is guaranteed to simply be a constant – just a number. We have no trouble integrating this.
Ok, let’s move on.
\displaystyle \frac{1}{(x-1)^2}
Still no problem. This is (x-1)^{-2}. Easy to integrate.
\displaystyle \frac{x}{(x-1)^2}
Hmmm. Polynomial division won’t save us here, because the numerator already had a smaller degree than the denominator. What do we do?
Here comes one of the basic ideas of Partial Fraction Decomposition. We can’t possibly hope to rewrite \frac{x}{(x-1)^2} as simply \frac{a}{(x-1)^2} for some number a, because x isn’t a constant. But we might still hope to manage something like this:
\displaystyle \frac{x}{(x-1)^2} = \frac{a}{x-1}+\frac{b}{(x-1)^2}
Why is that reasonable? Well, adding together the fractions on the right, we find
\displaystyle \frac{a}{x-1}+\frac{b}{(x-1)^2} = \frac{a(x-1)+b}{(x-1)^2}
The denominator is simply (x-1)^2, which is what we need, and the numerator looks darn close to a general polynomial of the first degree. Great: we can surely adjust a and b so they make a(x-1)+b be whatever we want, such as our original numerator which happened to be x. Clearly we want a=1, and then we get (x-1)+b, so we want b=1 as well.
\displaystyle \frac{x}{(x-1)^2} = \frac{1}{x-1}+\frac{1}{(x-1)^2}
The cool thing is, we could have done the exact same thing with \frac{mx+n}{(x-1)^2} for any numbers m,n. We just need to match a(x-1)+b with mx+n, which is no trouble at all.
And the coolest thing is, this lets us handle numerators up to degree 1, and numerators of degree 2 and beyond can be handled as before, by first dividing by the denominator, being left with a remainder of lower degree – meaning, the first degree! We are able to exactly match the freedom we need.
You may guess how this is going to go from here. For things like \frac{f(x)}{(x-1)^3}, we will first reduce f(x) to a remainder of the second degree, and then handle it by finding appropriate constants a,b,c to make \frac{a}{x-1}+\frac{b}{(x-1)^2}+\frac{c}{(x-1)^3} do what we need it to do.
Ok. So far the denominators were all (x-1)^k for some power k. The same thing obviously works for (x-u)^k for any u, but what about more complicated denominators? For example, what are we supposed to do with
\displaystyle \frac{1}{x^2-1}?
Well, x^2-1 factors as (x-1)(x+1). Does this help? Can we hope to achieve
\displaystyle \frac{1}{x^2-1} = \frac{a}{x-1}+\frac{b}{x+1}?
Why, sure. Again, let’s just add up those guys on the right, getting \frac{a(x+1)+b(x-1)}{(x-1)(x+1)}. The numerator can be adjusted to be any linear polynomial, and that’s all we need since the denominator has degree 2.
What’s the general lesson? The general lesson is that the denominator g(x) should be broken down into a product of (x-u)'s, and then we rewrite the fraction as a sum of simple things over these (x-u)'s individually. We’ve also learned that if any (x-u) appears with multiplicity, as in (x-u)^k, we should allow for denominators of (x-u)^j for j=1,2,\ldots,k, to get enough freedom to match our numerators.
Partial Fractions over the Complex Numbers
But… can we factor any polynomial g(x) into linear factors, as in g(x)=(x-u)^k(x-v)^l\ldots(x-w)^m? Can we?
Well, sure we can. That’s just what complex numbers were made for. Over the complex numbers, any polynomial has just as many roots as its degree, or in other words, every polynomial factors completely into linear factors.
Therefore, over the complex numbers, the random meanderings we just went through are completely sufficient to achieve a partial fraction decomposition of any rational function. It can have rational coefficients, it can have real coefficients, it can even have complex coefficients, doesn’t matter – it’s totally doable.
Start with
\displaystyle R(x) = \frac{f(x)}{g(x)}
If the degree of f(x) is greater than that of g(x), use long division to write f(x) = q(x)g(x)+r(x) where r has lower degree. Then
\displaystyle R(x) = q(x) + \frac{r(x)}{g(x)}
and now the numerator r(x) is smaller, in terms of degree, than the denominator.
Next, factor g(x) = (x-u_1)(x-u_2)\cdots(x-u_n). The roots u_1,u_2,\ldots,u_n may not be distinct, so a better way to write this is
\displaystyle g(x) = (x-u_1)^{m_1}\cdots(x-u_k)^{m_k}
where u_1,\ldots,u_k are the distinct roots and m_1,\ldots,m_k are their multiplicities. We expect to need simple fractions that look like \frac{a_{ij}}{(x-u_i)^j} where a_{ij} are just some numbers, nothing fancy, and the denominators are all powers of (x-u_i), never exceeding the appropriate multiplicity, meaning j =1,2,\ldots,m_i.
So the overall decomposition we expect looks like this:
\displaystyle \frac{r(x)}{g(x)} = \sum_{i=1}^k \sum_{j=1}^{m_i} \frac{a_{ij}}{(x-u_i)^j}
This looks a bit scary, but seriously, it’s nothing. You merely write out the right hand side, add things up, and solve for the a_{ij} to make them fit your actual numerator r(x). It’s nothing worse than solving linear equations, and you are guaranteed to succeed since there are just enough parameters a_{ij} to fit the numerator r(x).
A formal proof of this can be written down in several ways. Since this answer is long enough as it is, let me point you to a wonderful paper by Bradley and Cook (from, incredibly, 2012!), which does everything with complete rigor.
This Just Isn’t Hard Enough: Real Numbers
The way partial fractions are taught in most calculus or real analysis classes involves one more layer of complication, because teachers often insist on doing everything with real numbers. Honestly, in my mind, this adds unnecessary stress on top of something which is already notationally cumbersome, even if it’s not really complicated. Complex numbers are just awesome in how they let you factor any polynomial down to linear factors – why not use them?
Here’s what actually happens in the classroom. Using the general method we just outlined, we find
\displaystyle \frac{1}{x^2-1} = \frac{1/2}{x-1}-\frac{1/2}{x+1}
so we can integrate \frac{1}{x^2-1} easily using logs.
\displaystyle \int \frac{1}{x^2-1}\,\mathrm{d}x = \frac{1}{2}\log(x-1)-\frac{1}{2}\log(x+1).
Similarly,
\displaystyle \frac{1}{x^2+1} = \frac{-i/2}{x-i}+\frac{i/2}{x+i}
so
\displaystyle \int \frac{1}{x^2+1}\,\mathrm{d}x = \frac{i}{2}\log(x+i)-\frac{i}{2}\log(x-i)
but that’s not the answer most teachers want, unfortunately. They want \text{arctan}(x) or \text{atan}(x) or \tan^{-1}(x) or whatever they call the inverse tangent function.
Now of course, it’s the same thing. The expression we just wrote down with logs and i is exactly the inverse tangent. An antiderivative is an antiderivative; there can’t be two of them, except for additive constants. But we’re supposed to fear the complex number, so instead of doing it the right and easy way, we complicate things more.
Remember: partial fraction decomposition is really quite straightforward with complex numbers. You factor the denominator completely, you write down the required denominators to cover the multiplicities, done. Integrating is never more complicated then knowing how to integrate (x-u)^k, which is really easy.
But if you insist on doing things with real numbers only, you still can… at a cost. A polynomial with real coefficients cannot always be factored into linear factors with real coefficients, but it can factored into linear and quadratic factors with real coefficients. (Why? Because the complex non-real roots of a real polynomial must come in conjugate pairs, and multiplying these pairs out gives you real quadratics).
That’s not the end of the world. It just means that now, even in the absence of those annoying multiplicities, we will need to allow terms such as
\displaystyle \frac{ax+b}{x^2+ux+v}
in our partial fraction decomposition. If we also have multiplicities, we will likewise need to allow
\displaystyle \frac{ax+b}{x^2+ux+v}+\frac{cx+d}{(x^2+ux+v)^2}
or additional terms like this if the multiplicity is higher. The process of figuring out the coefficients now becomes correspondingly more cumbersome, but this is really just a nuisance.
In terms of integration, it also means that we need to know how to integrate those simple fractions: linear numerators and quadratic denominators. This isn’t hard either, using a few standard trigonometric integrals.
The general philosophy of partial fraction decomposition for rational functions over the real numbers is still the same: we write a general rational function as a sum of a polynomial and simple fractions, where “simple” now means having powers of linear of quadratic terms in the denominators, and nothing worse than linear polynomials in the numerators. Since we know how to integrate those, we can integrate any rational function.
The General Case
It is tempting to try and generalize everything we just did. We’ve handled rational functions over the real and complex numbers; what about other fields? And what if, instead of polynomials, we look at fractions made of elements of other rings?
One of the simplest steps in our process was the reduction of the numerator into something of lower degree than the denominator. This concept of “degree” generalizes nicely into something called Euclidean domains, where you have a “degree” function and a guaranteed division with a remainder which has smaller degree than what you’re dividing by.
In the general case, we cannot hope to control the degree of the irreducible factors of the denominators. Above, we made good use of the fact that complex numbers guarantee linear factors only, and real numbers guarantee linear or quadratic ones. In general, we don’t have a limit on the degrees of the irreducible factors, but that’s ok: we can still achieve a partial fraction decomposition where the denominators are powers of irreducible factors.
This helps clarify things, I think. The denominators in the approach as it’s usually taught are a hodge-podge of linear and quadratic factors with various powers. The underlying mechanism is irreducibility: you factor the denominator as much as you can, and allow for power of these factors in the decomposition.
One interesting quirk is that, in those more general cases, the decomposition ends up being non-unique. There doesn’t seem to be a simple recipe to define precisely the conditions on the terms that would guarantee uniqueness. The decomposition always exists, but it’s not necessarily unique in any obvious sense.
For the purposes of finding antiderivatives, this really isn’t a concern at all. The decomposition we’ve described over \C and \R is, in fact, unique, but it doesn’t really need to be: we know from other considerations that an antiderivative must be unique up to an additive constant (since f'=g' implies (f-g)'=0, so f-g is a constant). But it’s an interesting observation nonetheless. Uniqueness is often harder than mere existence, and it’s equally often very much necessary.
To go back to the context we started with, way back at the top of this answer: what can we say about the partial fraction decomposition of ordinary rational numbers? Well, it does always exist, and it is actually unique if we insist on always taking positive remainders. We get things like
\frac{77}{12}=5+\frac{1}{2}+\frac{1}{2^2}+\frac{2}{3}
note that this isn’t the “Egyptian Fraction” decomposition from ancient Egypt, but we do see how the numerators are smaller than the denominators. Also observe how we subtly needed to reduce the integer part from 6 to 5 in order for the decomposition to work. It’s a fascinating way of representing rational numbers, but unfortunately it’s not particularly useful (as far as we know), so we never teach it, which leaves the calculus technique sort of hanging there without context or precedent, which is really a shame. It’s a simple, and very useful, technique.