Integration

Partial Fractions Integration

Decompose P(x)/Q(x) into simpler fractions, integrate each piece

To integrate a rational function P(x)/Q(x), factor the denominator, decompose into a sum of A/(x−a) terms plus (Bx+C)/(x²+bx+c) terms, and integrate term-wise. The Heaviside cover-up trick reads off coefficients in one line.

  • Distinct linear (x − a)A/(x − a) → A · ln|x − a|
  • Repeated (x − a)ⁿA₁/(x − a) + A₂/(x − a)² + … + Aₙ/(x − a)ⁿ
  • Irreducible quadratic(Bx + C)/(x² + bx + c) → log + arctan
  • Heaviside cover-upA = P(a)/Q'(a) for simple linear poles
  • Prerequisitedeg P < deg Q (else polynomial long division first)
  • OutputSum of logarithms and arctangents

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

The idea

Adding fractions with different denominators creates a single fraction with a complicated denominator: A/(x−1) + B/(x+2) becomes (A(x+2) + B(x−1))/((x−1)(x+2)). Partial fractions runs that arithmetic backwards. Given a rational integrand P(x)/Q(x), we split it back into the simple pieces whose denominators are the factors of Q(x). Each simple piece has a known antiderivative — log or arctan — and the original integral falls out as a sum.

The technique is mechanical once you factor Q(x). The skill is recognizing which decomposition template to use and how to extract the coefficients.

The three decomposition templates

Factor of Q(x)ContributesEach piece integrates to
Distinct linear (x − a)A/(x − a)A · ln|x − a|
Repeated linear (x − a)ⁿA₁/(x − a) + A₂/(x − a)² + ⋯ + Aₙ/(x − a)ⁿlog (n = 1) or power rule (n ≥ 2)
Irreducible quadratic x² + bx + c(Bx + C)/(x² + bx + c)log + arctan after completing the square
Repeated irreducible quadratic (x² + bx + c)ⁿStacked (Bᵢx + Cᵢ)/(x² + bx + c)ⁱ termsReduction formulas; rarely seen in practice

"Irreducible" means the quadratic has no real roots — i.e., its discriminant b² − 4c < 0. Reducible quadratics factor into two linear pieces and reduce to the linear cases.

How to apply it

  1. Check degree — if deg P ≥ deg Q, do polynomial long division first.
  2. Factor Q(x) into linear and irreducible quadratic factors.
  3. Write the decomposition template based on the factors.
  4. Solve for the unknown constants — by Heaviside cover-up (for distinct linear factors) or by matching coefficients.
  5. Integrate each piece — log for simple linear, power rule for repeated, log + arctan for quadratic.
  6. Combine. Don't forget + C.

Worked example — ∫ dx / ((x − 1)(x + 2))

The denominator has two distinct linear factors. Template:

1/((x − 1)(x + 2))  =  A/(x − 1)  +  B/(x + 2).

Apply the Heaviside cover-up. To find A, cover up (x − 1) in the original and substitute x = 1:

A  =  1/(x + 2) |_{x = 1}  =  1/(1 + 2)  =  1/3.

B  =  1/(x − 1) |_{x = −2}  =  1/(−2 − 1)  =  −1/3.

Two lines, no algebra. The decomposition is:

1/((x − 1)(x + 2))  =  (1/3)/(x − 1)  −  (1/3)/(x + 2).

Integrate:

∫ dx/((x − 1)(x + 2))
  =  (1/3) ∫ dx/(x − 1)  −  (1/3) ∫ dx/(x + 2)
  =  (1/3) ln|x − 1|  −  (1/3) ln|x + 2|  +  C
  =  (1/3) ln| (x − 1)/(x + 2) |  +  C.

Worked example — ∫ (3x + 1) / (x − 1)² dx (repeated factor)

The denominator has a repeated linear factor (x − 1)². Template:

(3x + 1) / (x − 1)²  =  A/(x − 1)  +  B/(x − 1)².

Clear denominators: 3x + 1 = A(x − 1) + B. Substitute x = 1: 4 = B, so B = 4. Match x-coefficients: 3 = A, so A = 3.

(3x + 1)/(x − 1)²  =  3/(x − 1)  +  4/(x − 1)².

∫ (3x + 1)/(x − 1)² dx  =  3 ln|x − 1|  −  4/(x − 1)  +  C.

The first piece integrates to a log; the second uses the power rule (∫1/(x − 1)² dx = −1/(x − 1) + C).

Worked example — ∫ dx / (x · (x² + 1))

Denominator has one linear factor x and one irreducible quadratic x² + 1 (discriminant −4 < 0). Template:

1/(x(x² + 1))  =  A/x  +  (Bx + C)/(x² + 1).

Clear: 1 = A(x² + 1) + (Bx + C)x = Ax² + A + Bx² + Cx = (A + B)x² + Cx + A.

Match coefficients: x² gives A + B = 0; x gives C = 0; constant gives A = 1. So A = 1, B = −1, C = 0.

1/(x(x² + 1))  =  1/x  −  x/(x² + 1).

∫ dx/(x(x² + 1))  =  ∫ dx/x  −  ∫ x/(x² + 1) dx
                  =  ln|x|  −  (1/2) ln(x² + 1)  +  C
                  =  ln| x / √(x² + 1) |  +  C.

The second integral uses u = x² + 1, du = 2x dx — the (Bx + C)/(x² + 1) piece has a "derivative of denominator" part that goes to log. When C ≠ 0, the remaining 1/(x² + bx + c) piece completes the square and integrates to arctan.

Partial fractions vs other techniques

Partial fractionsU-substitutionIntegration by partsTrig substitution
Best whenRational function P(x)/Q(x)Inner function + derivativeProduct of dissimilar factorsSquare roots of quadratics
Underlying principleAlgebraic decompositionChain rule reversalProduct rule reversalPythagorean identity
When to tryFor every rational integrandFirst — alwaysSecondWhen square roots appear
Algebra-heavinessHigh (decomposition)LowMediumMedium
Output formsLogs and arctangentsAnythinguv-style mixed formsArctrig and logs
Shortcut toolHeaviside cover-upPattern recognitionLIATE mnemonicRight-triangle picture

When partial fractions is the right tool

  • Any rational integrand. When the integrand is P(x)/Q(x) and u-substitution doesn't apply directly, partial fractions is the systematic next step.
  • Inverse Laplace transforms. Most rational Laplace expressions decompose into simple pieces whose inverse transforms are tabulated.
  • Partial-fraction expansion in signal processing. Transfer functions H(s) = N(s)/D(s) decompose into modes, each contributing one exponential or sinusoidal response.
  • Generating functions in combinatorics. Rational generating functions decompose; each term gives one sequence component.
  • Probability — characteristic and moment-generating functions. Decomposition gives separable contributions to distribution computations.
  • Differential equations. Method of undetermined coefficients and Laplace methods both lean on partial fractions for the final step.

Common mistakes

  • Forgetting to long-divide first. If deg P ≥ deg Q, the decomposition template is wrong. Long-divide to reduce to a polynomial plus a proper rational, then decompose the proper part.
  • Wrong template for repeated factors. Repeated (x − a)ⁿ requires n separate terms, one for each power. Using only A/(x − a) gives an underdetermined system.
  • Missing the linear numerator for quadratics. Irreducible x² + bx + c needs (Bx + C), not just B. The numerator must span all polynomials of degree < 2.
  • Heaviside on the wrong factor type. Cover-up only works for distinct simple linear poles. Repeated factors and quadratics need other methods.
  • Sign errors in completing the square. Converting (x² + bx + c) to ((x + b/2)² + (c − b²/4)) requires careful sign tracking.
  • Forgetting absolute values in logs. ∫dx/(x − a) = ln|x − a| + C — the absolute value is essential for negative arguments.

Connections to other techniques

U-substitution. After decomposition, some pieces (the derivative-of-denominator part of a quadratic term) reduce by u-sub to logs. Partial fractions sets up u-sub at the term level.

Trig substitution. A Weierstrass substitution t = tan(θ/2) converts rational trig integrals to rational t integrals — partial fractions then finishes them. Trig sub and partial fractions compose.

Laplace transforms. The inverse Laplace transform of a rational H(s) is computed by partial fraction decomposition. The denominator factors give the poles; the residues become the partial-fraction coefficients.

Complex analysis — residues. The Heaviside cover-up is the real-variable face of the residue theorem. A = P(a)/Q'(a) is exactly the residue of P/Q at the simple pole x = a.

Polynomial algebra. Decomposition is finite-dimensional linear algebra in disguise. The space of proper rationals with denominator Q is finite-dimensional, and the partial-fraction basis is a natural decomposition.

Frequently asked questions

What is partial fraction decomposition?

A way to rewrite a rational function P(x)/Q(x) as a sum of simpler fractions. Each factor of Q(x) gives one term in the decomposition. Distinct linear factor (x − a) contributes A/(x − a); a repeated linear factor (x − a)ⁿ contributes A₁/(x − a) + A₂/(x − a)² + … + Aₙ/(x − a)ⁿ; an irreducible quadratic x² + bx + c contributes (Bx + C)/(x² + bx + c). Solving for the constants A, B, C by matching coefficients or substituting strategic values reduces the original integral to a sum of trivial integrals.

How do I use the Heaviside cover-up trick?

For distinct linear factors, the cover-up is the fastest route. To find A in A/(x − a), "cover up" the factor (x − a) in the original P(x)/Q(x) and evaluate the remaining expression at x = a. Equivalent formula — A = P(a)/Q'(a). For 1/((x − 1)(x + 2)) split as A/(x − 1) + B/(x + 2) — A = 1/(1 + 2) = 1/3, B = 1/(−2 − 1) = −1/3. Two lines, no algebra. Only works for distinct (simple) linear poles.

What happens with repeated linear factors?

Each power of the repeated factor gets its own term. (x − a)² in Q gives A₁/(x − a) + A₂/(x − a)². A₂ comes from the cover-up at x = a using (x − a)²·P(x)/Q(x) evaluated at a. A₁ requires differentiating once before substituting — or, more commonly, solving the system by matching coefficients on the cleared expression.

What about irreducible quadratic factors?

An irreducible quadratic x² + bx + c (no real roots) contributes (Bx + C)/(x² + bx + c). The numerator is linear, not constant — because the quadratic has two-dimensional space of polynomial factors. After decomposition, the term integrates by completing the square in the denominator — (Bx + C)/(x² + bx + c) splits into a (derivative of the quadratic)/(quadratic) part (integrates to log) and a constant/(quadratic) part (integrates to arctan after completing the square).

What if the numerator's degree is greater than or equal to the denominator's?

Do polynomial long division first. Write P(x) = D(x)·Q(x) + R(x) where deg R < deg Q. Then P/Q = D + R/Q. The polynomial D integrates trivially; partial fractions handles R/Q. Skipping this step gives wrong decompositions. Always check the degree before decomposing.

How does each piece integrate?

Simple linear A/(x − a) integrates to A·ln|x − a| + C. A repeated power A/(x − a)ⁿ for n ≥ 2 integrates by the power rule to −A/((n − 1)(x − a)^(n−1)) + C. The linear-over-quadratic (Bx + C)/(x² + bx + c) splits into a log piece and an arctan piece via completing the square. So every partial-fraction integral ends up being a sum of logs and arctangents — no transcendental functions needed.

Why doesn't u-substitution work directly on rational functions?

Sometimes it does — ∫1/(x² + 1) dx is u = x, giving arctan directly; ∫(2x)/(x² + 1) dx is u = x² + 1, giving a log. But for ∫1/((x − 1)(x + 2)) dx there's no inner function with its derivative present. The denominator's factorization is essential structure that u-substitution can't access. Partial fractions exposes that structure first; integration is mechanical afterwards.