In short

Partial fraction decomposition breaks a complicated rational function into a sum of simpler fractions. Each piece has a standard integral — logarithms for linear denominators, arctangent for irreducible quadratics, and power-rule variants for repeated factors. If the degree of the numerator is at least as large as the denominator, do polynomial long division first.

Try to integrate this:

\int \frac{2x + 3}{x^2 + 3x + 2}\,dx

Stare at the numerator and denominator for a moment. The denominator factors as (x+1)(x+2). The numerator does not cancel with either factor. No substitution springs to mind. No integration-by-parts pattern is visible. This integral looks stuck.

But here is the idea: what if you could rewrite the integrand as a sum of two fractions, each with only one linear factor in the denominator? Something like

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

If you can find the right values of A and B, then the integral splits into two pieces, each of which is a standard \int \frac{1}{x+a}\,dx = \ln|x+a| + C integral. The hard problem becomes two easy ones.

This is partial fraction decomposition. You may have met it in algebra — breaking a complicated fraction into simpler ones. The payoff in calculus is that every piece you get has a known antiderivative. The decomposition is not the goal; the integration that follows is.

The four decomposition types

Every rational function \frac{P(x)}{Q(x)} where \deg P < \deg Q falls into one of four cases, depending on the factors of the denominator. Here they are, with the shape of the decomposition for each.

Type 1: Distinct linear factors

If Q(x) = (x - a_1)(x - a_2)\cdots(x - a_n) and all the a_i are different:

\frac{P(x)}{(x - a_1)(x - a_2)\cdots(x - a_n)} = \frac{A_1}{x - a_1} + \frac{A_2}{x - a_2} + \cdots + \frac{A_n}{x - a_n}

Each piece integrates to A_i \ln|x - a_i|.

Type 2: Repeated linear factors

If a linear factor appears more than once, say (x - a)^k, it contributes k terms:

\frac{A_1}{x - a} + \frac{A_2}{(x - a)^2} + \cdots + \frac{A_k}{(x - a)^k}

The first term integrates to a logarithm. The rest integrate using the power rule: \int \frac{A_j}{(x-a)^j}\,dx = \frac{A_j}{-(j-1)(x-a)^{j-1}} for j \geq 2.

Type 3: Irreducible quadratic factors

If Q(x) contains a factor x^2 + bx + c that does not factor over the reals (discriminant b^2 - 4c < 0), it contributes:

\frac{Ax + B}{x^2 + bx + c}

This piece is integrated by completing the square in the denominator, then splitting into a logarithm piece and an arctangent piece.

Type 4: Repeated irreducible quadratic factors

If the irreducible quadratic appears with multiplicity k:

\frac{A_1 x + B_1}{x^2 + bx + c} + \frac{A_2 x + B_2}{(x^2 + bx + c)^2} + \cdots + \frac{A_k x + B_k}{(x^2 + bx + c)^k}

The first term is handled as in Type 3. Higher powers require reduction formulas or trigonometric substitution — rare in a first course, but the structure is the same.

Finding the constants: the cover-up method

The classical approach is to multiply both sides by the full denominator and match coefficients. That always works. But for distinct linear factors, there is a faster technique.

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

To find A: mentally "cover up" the factor (x+1) in the original fraction and substitute x = -1 into what remains:

A = \frac{2(-1) + 3}{(-1) + 2} = \frac{1}{1} = 1

To find B: cover up (x+2) and substitute x = -2:

B = \frac{2(-2) + 3}{(-2) + 1} = \frac{-1}{-1} = 1

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

Why does this work? Multiplying both sides of the decomposition by (x+1) gives \frac{(x+1)(2x+3)}{(x+1)(x+2)} = A + \frac{B(x+1)}{x+2}. Setting x = -1 kills the B term, leaving A alone. The "cover-up" is just a shorthand for this algebraic step.

Integrating each type

Here is the integration formula for each decomposition piece, collected in one place.

Piece Integral
\dfrac{A}{x - a} A\ln|x - a| + C
\dfrac{A}{(x-a)^n}, n \geq 2 \dfrac{A}{-(n-1)(x-a)^{n-1}} + C
\dfrac{A(2x+b)}{x^2+bx+c} A\ln|x^2+bx+c| + C
\dfrac{A}{(x+p)^2 + q^2} \dfrac{A}{q}\arctan\!\dfrac{x+p}{q} + C

The third row uses the fact that 2x + b is the derivative of x^2 + bx + c, so the integral is a direct logarithm. When the numerator of the quadratic piece is not a multiple of the derivative of the denominator, you split it into a part that is and a part that gives arctangent. This splitting is the key step for Type 3.

Handling improper fractions

Everything above assumed \deg P < \deg Q. When \deg P \geq \deg Q, the fraction is improper — and partial fractions cannot be applied directly. The fix is polynomial long division.

Take \frac{x^3 + 2x + 1}{x^2 + 1}. The numerator has degree 3, the denominator degree 2. Divide:

x^3 + 2x + 1 = (x^2 + 1) \cdot x + (x + 1)

So \frac{x^3 + 2x + 1}{x^2 + 1} = x + \frac{x + 1}{x^2 + 1}.

The polynomial part x integrates directly to \frac{x^2}{2}. The proper fraction \frac{x+1}{x^2+1} is handled by splitting: \frac{x}{x^2+1} gives \frac{1}{2}\ln(x^2+1) (since 2x is the derivative of x^2+1), and \frac{1}{x^2+1} gives \arctan x. The rule is simple: always do long division first if the degree on top is not smaller than the degree on the bottom.

Partial Fraction Integration

For a rational function \frac{P(x)}{Q(x)} where P and Q are polynomials with real coefficients:

  1. If \deg P \geq \deg Q, perform polynomial long division to write \frac{P}{Q} = S(x) + \frac{R(x)}{Q(x)} where \deg R < \deg Q.
  2. Factor Q(x) into linear and irreducible quadratic factors over the reals.
  3. Decompose \frac{R(x)}{Q(x)} into partial fractions according to the factor types.
  4. Integrate each piece using logarithms, power rules, and arctangent.

Worked examples

Example 1: Distinct linear factors

Evaluate \displaystyle\int \frac{5x - 4}{x^2 - x - 2}\,dx.

Step 1. Factor the denominator.

x^2 - x - 2 = (x-2)(x+1)

Why: look for two numbers that multiply to -2 and add to -1. Those are -2 and +1.

Step 2. Set up the decomposition and find the constants.

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

Cover-up for A: set x = 2: A = \frac{5(2)-4}{2+1} = \frac{6}{3} = 2.

Cover-up for B: set x = -1: B = \frac{5(-1)-4}{-1-2} = \frac{-9}{-3} = 3.

Why: covering up each factor and substituting its root isolates one constant at a time. This is faster than expanding and matching coefficients.

Step 3. Rewrite the integrand and integrate.

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

Why: each piece is a standard \frac{k}{x-a} integral, which gives k\ln|x-a|.

Step 4. Verify by differentiating.

\frac{d}{dx}\bigl[2\ln|x-2| + 3\ln|x+1|\bigr] = \frac{2}{x-2} + \frac{3}{x+1} = \frac{2(x+1) + 3(x-2)}{(x-2)(x+1)} = \frac{5x - 4}{x^2-x-2}

Why: the derivative of a logarithmic antiderivative is the original integrand, confirming the answer.

Result: \displaystyle\int \frac{5x-4}{x^2-x-2}\,dx = 2\ln|x-2| + 3\ln|x+1| + C.

The integrand $\frac{5x-4}{(x-2)(x+1)}$. The vertical dashed lines at $x = 2$ and $x = -1$ are the vertical asymptotes, coming from the zeros of the denominator. Between and beyond them, the curve is smooth and the antiderivative is built from logarithms of $|x-2|$ and $|x+1|$.

Example 2: Irreducible quadratic in the denominator

Evaluate \displaystyle\int \frac{3x + 5}{x^2 + 2x + 5}\,dx.

Step 1. Check whether the denominator factors.

\Delta = 4 - 20 = -16 < 0

The quadratic x^2 + 2x + 5 is irreducible over the reals — no partial fraction split is needed. The denominator stays as one piece.

Why: a negative discriminant means no real roots, so the quadratic cannot be written as a product of two linear factors.

Step 2. Split the numerator to match the derivative of the denominator.

The derivative of x^2 + 2x + 5 is 2x + 2. Write 3x + 5 = \frac{3}{2}(2x + 2) + 2.

\int \frac{3x+5}{x^2+2x+5}\,dx = \frac{3}{2}\int \frac{2x+2}{x^2+2x+5}\,dx + 2\int \frac{1}{x^2+2x+5}\,dx

Why: the first integral is now \frac{f'(x)}{f(x)}, which integrates to a logarithm. The second integral will give arctangent after completing the square.

Step 3. Evaluate each piece.

First piece: \frac{3}{2}\int \frac{2x+2}{x^2+2x+5}\,dx = \frac{3}{2}\ln|x^2+2x+5| = \frac{3}{2}\ln(x^2+2x+5).

(The absolute value is not needed because x^2 + 2x + 5 = (x+1)^2 + 4 > 0 always.)

Second piece: complete the square in the denominator. x^2 + 2x + 5 = (x+1)^2 + 4.

2\int \frac{1}{(x+1)^2 + 4}\,dx = 2 \cdot \frac{1}{2}\arctan\frac{x+1}{2} = \arctan\frac{x+1}{2}

Why: the standard form \int \frac{1}{u^2 + a^2}\,du = \frac{1}{a}\arctan\frac{u}{a} applies with u = x+1 and a = 2.

Step 4. Combine.

\int \frac{3x+5}{x^2+2x+5}\,dx = \frac{3}{2}\ln(x^2+2x+5) + \arctan\frac{x+1}{2} + C

Why: the two pieces add to give the full antiderivative — one logarithmic, one inverse-trigonometric.

Result: \displaystyle\int \frac{3x+5}{x^2+2x+5}\,dx = \frac{3}{2}\ln(x^2+2x+5) + \arctan\frac{x+1}{2} + C.

The integrand $\frac{3x+5}{x^2+2x+5}$. Unlike Example 1, there are no vertical asymptotes — the denominator is always positive, so the curve is smooth everywhere. The antiderivative is a mix of logarithm and arctangent, reflecting the two components of the numerator.

Common confusions

Going deeper

If you're comfortable with the four decomposition types and their integrals, you have the main toolkit — you can stop here. The sections below cover the algebraic justification for why the decomposition always exists, and a technique for repeated linear factors that avoids large systems of equations.

Why the decomposition always exists

It is not obvious that every proper rational function can be decomposed into partial fractions. The proof relies on two facts from algebra:

Fact 1. Every polynomial with real coefficients factors completely into a product of linear factors and irreducible quadratic factors. This is guaranteed by the Fundamental Theorem of Algebra (every polynomial of degree n has exactly n complex roots, counted with multiplicity) combined with the observation that complex roots of real polynomials come in conjugate pairs — and each conjugate pair multiplies back to a real irreducible quadratic.

Fact 2. Given such a factorisation, the partial fraction decomposition exists and is unique. This is proved by induction on the number of factors, using the fact that if (x - a) divides Q(x), you can always find a constant A such that \frac{P(x)}{Q(x)} - \frac{A}{x-a} has (x-a) cancelled from its denominator — reducing the problem to a simpler fraction.

The upshot: partial fractions are not a trick that happens to work on textbook problems. They work on every rational function, guaranteed.

The Heaviside method for repeated factors

The cover-up method finds constants instantly for distinct linear factors, but it fails when a factor is repeated. For example, decompose \frac{x^2 + 1}{(x-1)^3}:

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

Multiply both sides by (x-1)^3:

x^2 + 1 = A(x-1)^2 + B(x-1) + C

Set x = 1: C = 1 + 1 = 2.

To find B, differentiate both sides with respect to x: 2x = 2A(x-1) + B. Set x = 1: B = 2.

To find A, differentiate again: 2 = 2A, so A = 1.

The decomposition is \frac{1}{x-1} + \frac{2}{(x-1)^2} + \frac{2}{(x-1)^3}.

Each successive derivative peels off one constant. For a factor (x-a)^k, you need k evaluations (one substitution and k-1 differentiations). This is Oliver Heaviside's systematic extension of the cover-up idea.

A full integration with repeated factors

Integrating the result from the Heaviside example:

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

The key point: each piece has its own standard formula. The decomposition converts one hard integral into several easy ones.

Connection to complex analysis

There is a deeper reason partial fractions work so cleanly for integration. In complex analysis, every rational function can be expanded as a sum of terms of the form \frac{c_k}{(z - z_k)^{n_k}}, where the z_k are the poles (roots of the denominator, possibly complex). Each such term has a known antiderivative. The real-variable partial fraction decomposition is the real-number version of this expansion, with conjugate complex poles grouped into irreducible quadratic factors to keep everything real.

Where this leads next