Integration by Partial Fractions

A rational function that looks impossible to integrate whole often splits into simple pieces — one small fraction per factor of the denominator — and each piece integrates to a logarithm or an arctangent you already know.

By the end you'll be able to decompose a proper rational function into partial fractions — choosing the right template for linear, repeated, and irreducible-quadratic factors — solve for the constants, and integrate the result term by term.

Predict: if you increase A, does the combined numerator's x-coefficient rise, or the constant term? Drag the A slider to check — and notice why the answer forces you to solve for A and B together.

You're trying to hit the target \(\dfrac{3x+5}{(x-2)(x+1)}\) (dashed green-blue curve) with a sum of two simple fractions, \(\dfrac{A}{x-2} + \dfrac{B}{x+1}\) (solid blue curve). Over a common denominator that sum has numerator \((A+B)x + (A-2B)\). When both coefficients match \(3x+5\), the curves lock together and turn green. Hover the chart for exact values at any x.

Combined numerator: 2x − 1 · target: 3x + 5

Not a match yet — adjust A and B until both coefficients agree.

Target vs. your combination — vertical asymptotes at the denominator's roots
target (3x+5)/((x−2)(x+1)) A/(x−2) + B/(x+1) asymptotes

A proper rational function is integrated by decomposing it into a sum of partial fractions — one term per linear or irreducible-quadratic factor of the denominator — each of which integrates to a logarithm or arctangent.

Algebraic

The decomposition is a purely algebraic fact: every proper rational function \(P(x)/Q(x)\) splits according to \(Q\)'s factors. A distinct linear factor \((x-r)\) contributes \(\dfrac{A}{x-r}\); a repeated factor \((x-r)^k\) contributes the full chain \(\dfrac{A_1}{x-r} + \cdots + \dfrac{A_k}{(x-r)^k}\); an irreducible quadratic \((x^2+bx+c)\) contributes \(\dfrac{Bx+C}{x^2+bx+c}\) — note the full linear numerator, not a bare constant. And the template only holds for proper fractions: if \(\deg P \ge \deg Q\), do polynomial long division first and decompose only the proper remainder.

Procedural

In practice you run a fixed pipeline: (1) if improper, long-divide; (2) factor the denominator; (3) write the template with unknown constants; (4) clear denominators to get a polynomial identity; (5) find the constants by substituting each linear factor's root (which zeroes out every other term — that's why it's fast) or by matching coefficients of like powers of x; (6) integrate each piece. Linear-factor pieces give logs, \((x-r)^{-k}\) pieces give power-rule results, and a \(\dfrac{Bx+C}{x^2+bx+c}\) piece splits into a log part (numerator matching the denominator's derivative) plus, after completing the square, an arctangent part.

Worked example

Evaluate \(\displaystyle\int \frac{3x+5}{x^2-x-2}\,dx\) — the demo's target. Factor: \(x^2-x-2 = (x-2)(x+1)\); the fraction is proper. Template: \(\dfrac{3x+5}{(x-2)(x+1)} = \dfrac{A}{x-2} + \dfrac{B}{x+1}\). Clear denominators: \(3x+5 = A(x+1) + B(x-2)\). Substitute \(x=2\): \(11 = 3A \Rightarrow A = \tfrac{11}{3}\). Substitute \(x=-1\): \(2 = -3B \Rightarrow B = -\tfrac{2}{3}\). Integrate: \(\displaystyle\int\left(\frac{11/3}{x-2} - \frac{2/3}{x+1}\right)dx = \frac{11}{3}\ln|x-2| - \frac{2}{3}\ln|x+1| + C\). Those are exactly the A and B that turn the demo's curve green — set them and see.

Your turn

Evaluate \(\displaystyle\int \frac{x+5}{(x+1)(x-3)}\,dx\). The fraction is proper, so set \(\dfrac{x+5}{(x+1)(x-3)} = \dfrac{A}{x+1} + \dfrac{B}{x-3}\) and clear denominators: \(x+5 = A(x-3) + B(x+1)\). Substitute \(x=-1\): \(4 = -4A \Rightarrow A = -1\). Now substitute \(x = 3\) and finish: \(B = \) ____ , so the integral is ____

Reveal the answer

\(x=3\) gives \(8 = 4B \Rightarrow B = 2\). So the integrand is \(\dfrac{-1}{x+1} + \dfrac{2}{x-3}\), and the integral is \(-\ln|x+1| + 2\ln|x-3| + C\). Quick check: at \(x=0\) the original fraction is \(\tfrac{5}{-3}\), and \(\tfrac{-1}{1} + \tfrac{2}{-3} = -\tfrac{5}{3}\) — the decomposition agrees.

More info — why one slider moves both coefficients

In the demo, \(\dfrac{A}{x-2} + \dfrac{B}{x+1}\) recombines to numerator \(A(x+1) + B(x-2) = (A+B)x + (A-2B)\). A appears in both the x-coefficient and the constant, so nudging one slider moves both readouts at once — matching \(3x+5\) means solving the simultaneous system \(A+B=3\), \(A-2B=5\). The root-substitution trick from the worked example is just a shortcut for solving that system: plugging in \(x=2\) or \(x=-1\) collapses it to one equation in one unknown. This is the same "match the form, then solve for the constants" move you used when completing the square for trigonometric substitution in the previous lesson — see the OpenStax link in Dive deeper for all four decomposition cases laid out side by side.

Check your understanding

Question 1 of 4

Evaluate \(\int \frac{x+7}{(x-1)(x+3)}\,dx\).

Question 2 of 4

\(x^2+4\) has no real roots. Which is the correct decomposition template for \(\frac{2x+1}{x(x^2+4)}\)?

Question 3 of 4

To evaluate \(\int \frac{x^2}{x-1}\,dx\) using the partial-fractions machinery, what must you do first?

Question 4 of 4

You meet \(\int \frac{dx}{x^2-9}\) and \(\int \frac{dx}{\sqrt{x^2-9}}\). Which technique fits each?

Recap

  • Partial fractions applies to proper rational functions only — if \(\deg P \ge \deg Q\), do polynomial long division first.
  • Templates: \(\dfrac{A}{x-r}\) per distinct linear factor; the full chain \(\dfrac{A_1}{x-r} + \cdots + \dfrac{A_k}{(x-r)^k}\) per repeated factor; \(\dfrac{Bx+C}{x^2+bx+c}\) (full linear numerator) per irreducible quadratic.
  • Find constants by clearing denominators, then substituting roots of the linear factors and/or matching coefficients of like powers of x.
  • Each piece integrates with existing tools: \(\int \frac{A}{x-r}dx = A\ln|x-r|+C\); higher powers via the power rule; irreducible-quadratic pieces give a logarithm plus (after completing the square) an arctangent.
  • Radicals like \(\sqrt{x^2-a^2}\) are NOT partial-fractions territory — that shape calls for trigonometric substitution.

Dive deeper

Sources

  • Integration by Partial Fractions