Partial Fractions

Splitting a complicated fraction into simple pieces sounds like an exam-only ritual, yet it is exactly how engineers decode the behaviour of circuits, autopilots and camera stabilisers — and how a computer integrates any rational function you hand it. The move behind all of that is surprisingly homely.

You have spent years adding fractions: put them over a common denominator, combine, tidy up. Partial fractions is that skill played backwards — un-adding. Watch what happens when we add two utterly harmless fractions:

\frac{1/2}{x-1} - \frac{1/2}{x+1} \;=\; \frac{\tfrac12(x+1) - \tfrac12(x-1)}{(x-1)(x+1)} \;=\; \frac{1}{x^2-1}.

So \dfrac{1}{x^2-1} is secretly two simple fractions in a trench coat. Why does a calculus course care? Because as written, \displaystyle\int \frac{dx}{x^2-1} looks hopeless — it is not a power, not a standard form, and no obvious substitution cracks it. But each piece integrates to a logarithm in one line:

\int \frac{dx}{x^2-1} = \frac{1}{2}\ln|x-1| - \frac{1}{2}\ln|x+1| + C = \frac{1}{2}\ln\left|\frac{x-1}{x+1}\right| + C.

That is the whole method in one sentence: factor the denominator, split the fraction into its simple parts, integrate each part in one line. A single algebraic move unlocks an entire family of integrals — every rational function \dfrac{P(x)}{Q(x)} whose denominator factors becomes a sum of pieces you already know how to integrate. The calculus here is trivial; the craft is in the un-adding. This page is about that craft.

Worked example 1: \displaystyle\int \frac{dx}{(x-1)(x+2)}

Step 1 — write the decomposition with unknowns. Two distinct linear factors, so two simple fractions:

\frac{1}{(x-1)(x+2)} = \frac{A}{x-1} + \frac{B}{x+2}.

Step 2 — clear the denominators. Multiply both sides by (x-1)(x+2):

1 = A(x+2) + B(x-1).

This is an identity — it must hold for every x, not just some solution. That single fact gives us two different ways to hunt down A and B. Learn both: one is fast, the other never lets you down.

Route 1 — substitute the roots (the cover-up idea)

Since the identity holds for every x, pick values that make terms vanish. Setting x = 1 kills the B term (x - 1 = 0):

1 = A(1 + 2) + B(0) = 3A \qquad\Longrightarrow\qquad A = \frac{1}{3}.

Setting x = -2 kills the A term:

1 = A(0) + B(-2 - 1) = -3B \qquad\Longrightarrow\qquad B = -\frac{1}{3}.

Route 2 — equate coefficients

Alternatively, expand the right side and gather powers of x:

1 = A(x+2) + B(x-1) = (A + B)\,x + (2A - B).

The left side is 0 \cdot x + 1. Two polynomials are identical only if their coefficients match, power by power:

x^1:\;\; A + B = 0, \qquad x^0:\;\; 2A - B = 1.

Solve the pair: adding gives 3A = 1, so A = \tfrac13 and B = -\tfrac13 — the same answer, as it must be. Substituting roots is quicker when the factors are distinct and linear; equating coefficients works for every shape of decomposition, and doubles as a check on your arithmetic.

Finish — integrate each piece

\frac{1}{(x-1)(x+2)} = \frac{1/3}{x-1} - \frac{1/3}{x+2},

and each piece is a one-line logarithm (via u = x - 1 and u = x + 2):

\int \frac{dx}{(x-1)(x+2)} = \frac{1}{3}\ln|x-1| - \frac{1}{3}\ln|x+2| + C = \frac{1}{3}\ln\left|\frac{x-1}{x+2}\right| + C.

The full-speed version of Route 1 is the cover-up method: to find the constant over (x - r), put your finger over that factor in the original fraction and evaluate everything left at x = r. For our example, cover (x-1) and read off

A = \left.\frac{1}{\;x + 2\;}\right|_{x = 1} = \frac{1}{3}, \qquad B = \left.\frac{1}{\;x - 1\;}\right|_{x = -2} = -\frac{1}{3}.

No equations, no clearing denominators — done in your head. Why is this legal? Multiply the identity \frac{1}{(x-1)(x+2)} = \frac{A}{x-1} + \frac{B}{x+2} through by (x - 1) alone:

\frac{1}{x+2} = A + \frac{B(x-1)}{x+2}.

Now let x \to 1. The B term carries a factor (x-1), so it dies, leaving exactly A = \tfrac{1}{1+2}. "Covering up" the factor is just this multiply-and-substitute compressed into one gesture.

The trick is often credited to Oliver Heaviside, the self-taught Victorian engineer who used it to solve circuit equations at scandalous speed. When mathematicians complained his shortcuts weren't rigorously justified, he shot back: "Shall I refuse my dinner because I do not fully understand the process of digestion?" (One caution before you feast: cover-up reads off the constant for a simple linear factor only — for repeated or quadratic factors it gives you some of the constants, never all of them.)

The shapes of decomposition

Distinct linear factors are the easy case; two more shapes round out the method. The guiding principle: each factor of the denominator contributes its own template of unknowns, and the total number of unknowns always equals the degree of the denominator.

Write a proper rational function (degree of P below degree of Q) as a sum of these building blocks, one per factor of Q:

The linear-factor pieces integrate to logarithms; the higher powers \dfrac{A}{(x-r)^k} integrate by the power rule to \dfrac{-A}{(k-1)(x-r)^{k-1}}; and the quadratic pieces split into a logarithm plus an \arctan. Every proper rational function, without exception, dissolves into these three kinds of one-line integrals — which is why partial fractions is the closing move of the integration toolkit: it guarantees that every rational function can be integrated in elementary terms.

Three traps swallow more exam marks than all the algebra combined:

Worked example 2: a repeated factor — \displaystyle\int \frac{x+2}{(x-1)^2}\,dx

The denominator is (x-1)^2: one linear factor, squared. The template demands a term for each power:

\frac{x+2}{(x-1)^2} = \frac{A}{x-1} + \frac{B}{(x-1)^2}.

Multiply through by (x-1)^2:

x + 2 = A(x-1) + B.

Substituting the root x = 1 gives 3 = B — note that the root only reaches the highest power's constant; that is why cover-up alone cannot finish a repeated-factor problem. For A, equate the x-coefficients: 1 = A. So

\frac{x+2}{(x-1)^2} = \frac{1}{x-1} + \frac{3}{(x-1)^2}.

Now integrate: the first piece is a log, and the second is just the power rule in disguise (3(x-1)^{-2} integrates to -3(x-1)^{-1}):

\int \frac{x+2}{(x-1)^2}\,dx = \ln|x-1| - \frac{3}{x-1} + C.

A quick sanity check never hurts: differentiate the answer — \frac{1}{x-1} + \frac{3}{(x-1)^2} — and you are looking at the decomposition again. The circle closes.

Worked example 3: an improper fraction — \displaystyle\int \frac{x^2}{(x-1)(x+2)}\,dx

Degree check first: the top has degree 2, the bottom has degree 2 — top \ge bottom, so this fraction is improper and we must divide before we may decompose. Expanding the denominator, (x-1)(x+2) = x^2 + x - 2, and dividing:

\frac{x^2}{x^2 + x - 2} = 1 + \frac{2 - x}{x^2 + x - 2} = 1 + \frac{2 - x}{(x-1)(x+2)}.

The polynomial part 1 integrates trivially; the remainder is now proper (degree 1 over degree 2), so the templates apply. Cover-up on \dfrac{2-x}{(x-1)(x+2)} = \dfrac{A}{x-1} + \dfrac{B}{x+2}:

A = \left.\frac{2-x}{\;x+2\;}\right|_{x=1} = \frac{1}{3}, \qquad B = \left.\frac{2-x}{\;x-1\;}\right|_{x=-2} = \frac{4}{-3} = -\frac{4}{3}.

(Check by coefficients: A + B = \tfrac13 - \tfrac43 = -1 matches the -x, and 2A - B = \tfrac23 + \tfrac43 = 2 matches the constant. It works.) Assemble and integrate term by term:

\int \frac{x^2}{(x-1)(x+2)}\,dx = \int \left( 1 + \frac{1/3}{x-1} - \frac{4/3}{x+2} \right) dx = x + \frac{1}{3}\ln|x-1| - \frac{4}{3}\ln|x+2| + C.

Three moves — divide, decompose, integrate — and a fraction that offered no way in has become a polynomial plus two logarithms.

See it: a rational function and its antiderivative

The faint curve is the integrand \dfrac{1}{(x-1)(x-s)}, blowing up at its two vertical asymptotes x = 1 and x = s. The bold curve is the antiderivative that partial fractions hands us, \dfrac{1}{1-s}\big(\ln|x-1| - \ln|x-s|\big) — cover-up gives A = \tfrac{1}{1-s} and B = -\tfrac{1}{1-s}, so the two log coefficients are always equal and opposite.

Slide the right root s and watch the pair respond. Two things are worth spotting. First, the antiderivative has its own vertical asymptotes at the very same places — where the integrand blows up, its accumulated area blows up too, so \ln|x-r| plunges to -\infty at each root. Second, drag s down towards 1: the coefficient \tfrac{1}{1-s} grows without bound as the two roots close in on each other. The distinct-roots formula is tearing itself apart — a preview of why a repeated root demands the different template \tfrac{A}{x-r} + \tfrac{B}{(x-r)^2} you met in worked example 2.

Partial fractions might look like an exam-only ritual, but it is quietly running inside every control system you have ever trusted — autopilots, cruise control, the stabiliser in your phone's camera. The reason is the Laplace transform: engineers convert a differential equation describing a circuit or a robot arm into an algebraic equation in a new variable s. Solving that is easy — but the answer comes out as a rational function like

F(s) = \frac{s + 3}{(s+1)(s+2)},

and to translate it back into the real world (a voltage over time, a wing's response to a gust) you must first split it into partial fractions: \frac{2}{s+1} - \frac{1}{s+2}. Each simple piece \frac{A}{s+a} converts back to a term A e^{-at} — a decaying exponential. The roots of the denominator (the "poles") literally tell the engineer whether the system settles smoothly, rings like a bell, or shakes itself to pieces. The same un-adding also powers the standard trick for summing series by telescoping, and it is how computer algebra systems integrate every rational function you throw at them. Not bad for reversed fraction addition.

The method is genuinely old: Johann Bernoulli and Gottfried Leibniz worked it out around 1700, precisely because they wanted to integrate rational functions. Leibniz briefly worried that fractions like \tfrac{1}{x^4+1} might not split over the reals — the denominator has no real roots, and he suspected no real factorisation existed. Bernoulli disagreed, and Bernoulli was right: x^4 + 1 = (x^2 + \sqrt{2}\,x + 1)(x^2 - \sqrt{2}\,x + 1). In fact every real polynomial factors into real linear and quadratic pieces — a consequence of the fundamental theorem of algebra, proved rigorously a century later by Gauss. That theorem is the quiet guarantee behind this whole page: the three templates in the box above are always enough.

See it explained