Partial Fractions

You know how to add two fractions by getting a common denominator. Partial fractions runs that movie in reverse: it splits one ugly fraction into simple pieces whose integrals are just \(\ln|\dots|\).

By the end you can

The big idea

Think back to algebra. Adding two simple fractions gives one combined fraction:

\[ \frac{3}{x-2} + \frac{2}{x+1} = \frac{3(x+1) + 2(x-2)}{(x-2)(x+1)} = \frac{5x-1}{x^2-x-2} \]

Now suppose an AP question hands you the right side and asks for \(\displaystyle\int \frac{5x-1}{x^2-x-2}\,dx\). A quick check says u-substitution fails: the derivative of \(x^2-x-2\) is \(2x-1\), which isn't a multiple of \(5x-1\). But if you split it back into the left side, each piece integrates in one second:

\[ \int \left(\frac{3}{x-2} + \frac{2}{x+1}\right)dx = 3\ln|x-2| + 2\ln|x+1| + C \]
AP BC scope

AP Calculus BC tests only non-repeated linear factors in the denominator, like \((x-2)(x+1)\) or \(x(x-1)(x+2)\). Repeated factors like \((x-1)^2\) and irreducible quadratics like \(x^2+4\) are not on the AP exam.

Step 0: Check before you start

Before jumping into partial fractions on \(\displaystyle\int \frac{P(x)}{Q(x)}\,dx\), run two fast checks:

  1. Does u-sub work? If \(P(x)\) is a constant multiple of \(Q'(x)\), just use \(u = Q(x)\). Don't waste time factoring!
  2. Is the fraction proper? "Proper" means \(\deg(\text{top}) < \deg(\text{bottom})\). If \(\deg(\text{top}) \ge \deg(\text{bottom})\), you must do polynomial long division first, then use partial fractions on the remainder.

How to split and solve

Once your fraction is proper and the denominator factors into distinct linear pieces, write one unknown constant over each factor:

Distinct linear factors setup
\[ \frac{P(x)}{(x-a)(x-b)} = \frac{A}{x-a} + \frac{B}{x-b} \]

Multiply both sides by the common denominator \((x-a)(x-b)\) to clear fractions:

\[ P(x) = A(x-b) + B(x-a) \]

This equation holds for every \(x\), so you can plug in convenient values of \(x\)—specifically the roots \(x = a\) and \(x = b\)—to kill one term at a time. This is the plug-in (Heaviside) method, and it's the fastest way on the AP exam.

Example 1

Find \(\displaystyle\int \frac{5x-1}{x^2-x-2}\,dx\).

  1. Check: proper (degree 1 < degree 2), u-sub doesn't work. Factor the bottom: \(x^2-x-2 = (x-2)(x+1)\).
  2. Set up: \[ \frac{5x-1}{(x-2)(x+1)} = \frac{A}{x-2} + \frac{B}{x+1} \]
  3. Clear denominators: \(5x-1 = A(x+1) + B(x-2)\).
  4. Plug in \(x = 2\): \(5(2)-1 = A(3) + B(0) \Rightarrow 9 = 3A \Rightarrow A = 3\). Choosing \(x=2\) makes \((x-2)=0\), wiping out \(B\) instantly.
  5. Plug in \(x = -1\): \(5(-1)-1 = A(0) + B(-3) \Rightarrow -6 = -3B \Rightarrow B = 2\).
  6. Integrate each piece: \[ \int \left(\frac{3}{x-2} + \frac{2}{x+1}\right)dx = 3\ln|x-2| + 2\ln|x+1| + C \]
\(3\ln|x-2| + 2\ln|x+1| + C\)
Alternative: matching coefficients

You can also expand \(A(x+1)+B(x-2) = (A+B)x + (A-2B)\) and match terms with \(5x-1\): \(A+B=5\) and \(A-2B=-1\). Solving gives \(A=3, B=2\). It's a great backup check, though plugging in roots is usually faster.

Example 2 · Definite integral + combining logs

Evaluate \(\displaystyle\int_0^1 \frac{7x+1}{x^2+3x+2}\,dx\).

  1. Factor: \(x^2+3x+2 = (x+1)(x+2)\). Set up \(\dfrac{7x+1}{(x+1)(x+2)} = \dfrac{A}{x+1} + \dfrac{B}{x+2}\).
  2. Clear denominators: \(7x+1 = A(x+2) + B(x+1)\).
  3. Plug in \(x = -1\): \(-6 = A(1) \Rightarrow A = -6\).
    Plug in \(x = -2\): \(-13 = B(-1) \Rightarrow B = 13\).
  4. Integrate and plug in bounds: \[ \Big[-6\ln|x+1| + 13\ln|x+2|\Big]_0^1 = (-6\ln 2 + 13\ln 3) - (-6\ln 1 + 13\ln 2) \] Remember \(\ln 1 = 0\). On multiple choice, answers often combine the logs using log rules.
  5. Combine: \(13\ln 3 - 19\ln 2 = \ln\!\left(\dfrac{3^{13}}{2^{19}}\right)\).
\(13\ln 3 - 19\ln 2\) (about \(1.112\))

If \(\dfrac{x+7}{(x+1)(x+3)} = \dfrac{A}{x+1} + \dfrac{B}{x+3}\), what are \(A\) and \(B\)?

Clearing denominators gives \(x+7 = A(x+3) + B(x+1)\). Plug in \(x=-1\): \(6 = 2A \Rightarrow A = 3\). Plug in \(x=-3\): \(4 = -2B \Rightarrow B = -2\). Watch the negative sign when dividing \(4\) by \(-2\).

When top degree ≥ bottom degree: long division first

If you try partial fractions on \(\frac{x^2+2x+3}{x^2-1}\) without dividing first, you'll miss the polynomial part completely and get a wrong answer. Divide first so the remainder is proper.

Example 3 · Improper rational function

Find \(\displaystyle\int \frac{x^2+2x+3}{x^2-1}\,dx\).

  1. Degrees are equal (both 2), so divide \(x^2+2x+3\) by \(x^2-1\). Quick trick here: write \(x^2+2x+3 = (x^2-1) + (2x+4)\). \[ \frac{x^2+2x+3}{x^2-1} = 1 + \frac{2x+4}{(x-1)(x+1)} \]
  2. Split the remainder: \(\dfrac{2x+4}{(x-1)(x+1)} = \dfrac{A}{x-1} + \dfrac{B}{x+1}\).
  3. Clear denominators: \(2x+4 = A(x+1) + B(x-1)\).
    • \(x=1 \Rightarrow 6 = 2A \Rightarrow A = 3\)
    • \(x=-1 \Rightarrow 2 = -2B \Rightarrow B = -1\)
  4. Integrate everything (don't forget the \(1\)!): \[ \int \left(1 + \frac{3}{x-1} - \frac{1}{x+1}\right)dx = x + 3\ln|x-1| - \ln|x+1| + C \]
\(x + 3\ln|x-1| - \ln|x+1| + C\)

Three cases that trip students up

1. Factors like \((2x+1)\) where \(x\) has a coefficient

When you integrate \(\int \frac{1}{2x+1}\,dx\), a mini u-substitution (\(u = 2x+1,\; du = 2\,dx\)) brings out a \(\tfrac12\): \(\int \frac{1}{2x+1}\,dx = \tfrac12\ln|2x+1| + C\).

Example 4 · Coefficient on \(x\)

Find \(\displaystyle\int \frac{5x+7}{(2x+1)(x+2)}\,dx\).

  1. Set up \(\dfrac{5x+7}{(2x+1)(x+2)} = \dfrac{A}{2x+1} + \dfrac{B}{x+2}\), so \(5x+7 = A(x+2) + B(2x+1)\).
  2. Plug in \(x = -\tfrac12\): \(\tfrac92 = A(\tfrac32) \Rightarrow A = 3\).
    Plug in \(x = -2\): \(-3 = B(-3) \Rightarrow B = 1\).
  3. Integrate: \[ \int \left(\frac{3}{2x+1} + \frac{1}{x+2}\right)dx = \frac{3}{2}\ln|2x+1| + \ln|x+2| + C \] The \(3\) gets divided by \(2\) because the derivative of \(2x+1\) is \(2\).
\(\tfrac32\ln|2x+1| + \ln|x+2| + C\)

2. Three linear factors

Same recipe, just \(A\), \(B\), and \(C\). Each root kills two of the three terms at once.

Example 5 · Three factors

Find \(\displaystyle\int \frac{2x^2-x-4}{x(x-1)(x+2)}\,dx\).

  1. \(\dfrac{2x^2-x-4}{x(x-1)(x+2)} = \dfrac{A}{x} + \dfrac{B}{x-1} + \dfrac{C}{x+2}\).
  2. Clear denominators: \(2x^2-x-4 = A(x-1)(x+2) + Bx(x+2) + Cx(x-1)\).
  3. Plug in the three roots:
    • \(x = 0\): \(-4 = A(-1)(2) = -2A \Rightarrow A = 2\)
    • \(x = 1\): \(-3 = B(1)(3) = 3B \Rightarrow B = -1\)
    • \(x = -2\): \(6 = C(-2)(-3) = 6C \Rightarrow C = 1\)
  4. Integrate: \(2\ln|x| - \ln|x-1| + \ln|x+2| + C\).
\(2\ln|x| - \ln|x-1| + \ln|x+2| + C\)

3. The logistic integral (preview of Unit 7)

When you solve the logistic differential equation in Logistic Growth, you separate variables and land right on an integral like this one:

Example 6 · Logistic-style integral

Find \(\displaystyle\int \frac{1}{P(10-P)}\,dP\).

  1. \(\dfrac{1}{P(10-P)} = \dfrac{A}{P} + \dfrac{B}{10-P} \Rightarrow 1 = A(10-P) + BP\).
  2. \(P = 0 \Rightarrow A = \tfrac{1}{10}\). \(P = 10 \Rightarrow B = \tfrac{1}{10}\).
  3. Integrate carefully: \[ \frac{1}{10}\int \left(\frac{1}{P} + \frac{1}{10-P}\right)dP = \frac{1}{10}\Big(\ln|P| - \ln|10-P|\Big) + C \] Look at that minus sign! Because \(\frac{d}{dP}(10-P) = -1\), \(\int \frac{1}{10-P}\,dP = -\ln|10-P|\).
\(\dfrac{1}{10}\ln\left|\dfrac{P}{10-P}\right| + C\)

What is \(\displaystyle\int \frac{1}{5-2x}\,dx\)?

Let \(u = 5-2x\), so \(du = -2\,dx\) and \(dx = -\tfrac12\,du\). That gives \(-\tfrac12\ln|5-2x| + C\). Differentiating checks out: \(-\tfrac12\cdot\frac{-2}{5-2x} = \frac{1}{5-2x}\).

To integrate \(\displaystyle\int \frac{x^3+2}{x^2-4}\,dx\), what must you do first?

Degree 3 on top is greater than or equal to degree 2 on bottom, so the fraction is improper. Divide first: \(\frac{x^3+2}{x^2-4} = x + \frac{4x+2}{(x-2)(x+2)}\), and then use partial fractions on the remainder.

Common mistakes

Watch out for these
On the AP exam

Partial fractions shows up on multiple choice and occasionally inside a differential-equation FRQ (separating variables on a logistic-like equation). On multiple choice, the answer choices often combine logarithms using \(a\ln b = \ln(b^a)\) and \(\ln m - \ln n = \ln(m/n)\) — be ready to rewrite your answer to match.

Practice problems

Warm-up

\(\displaystyle\int \frac{1}{x^2-9}\,dx\)

Hint

Factor as \((x-3)(x+3)\) and plug in \(x = 3\) and \(x = -3\).

Solution

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

\(x=3 \Rightarrow A = \tfrac16\). \(x=-3 \Rightarrow B = -\tfrac16\).

\[ \frac16\int\left(\frac{1}{x-3} - \frac{1}{x+3}\right)dx = \frac16\ln|x-3| - \frac16\ln|x+3| + C \]
\(\dfrac16\ln\left|\dfrac{x-3}{x+3}\right| + C\)
Warm-up

\(\displaystyle\int_0^1 \frac{x+7}{(x+1)(x+3)}\,dx\)

Hint

You found \(A=3,\; B=-2\) in the first quiz above. Integrate and combine logs.

Solution
\[ \int_0^1\left(\frac{3}{x+1} - \frac{2}{x+3}\right)dx = \Big[3\ln|x+1| - 2\ln|x+3|\Big]_0^1 \] \[ = (3\ln 2 - 2\ln 4) - (3\ln 1 - 2\ln 3) = 3\ln 2 - 4\ln 2 + 2\ln 3 = 2\ln 3 - \ln 2 \]
\(\ln\left(\dfrac{9}{2}\right)\) (about \(1.504\))
Medium

\(\displaystyle\int \frac{4x+1}{(2x-1)(x+1)}\,dx\)

Hint

Plug in \(x = \tfrac12\) and \(x = -1\). Don't forget the \(\tfrac12\) when integrating \(\frac{1}{2x-1}\).

Solution

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

\(x = \tfrac12 \Rightarrow 3 = \tfrac32 A \Rightarrow A = 2\). \(x = -1 \Rightarrow -3 = -3B \Rightarrow B = 1\).

\[ \int\left(\frac{2}{2x-1} + \frac{1}{x+1}\right)dx = \frac{2}{2}\ln|2x-1| + \ln|x+1| + C \]
\(\ln|2x-1| + \ln|x+1| + C\) (or \(\ln|2x^2+x-1| + C\))
Medium

\(\displaystyle\int \frac{2x^3 - 4x^2 - x - 3}{x^2 - 2x - 3}\,dx\)

Hint

Top degree is 3, bottom is 2 — do polynomial long division first. The quotient is \(2x\).

Solution

Notice \(2x(x^2-2x-3) = 2x^3 - 4x^2 - 6x\). Subtracting from the numerator leaves \(5x - 3\).

\[ \frac{2x^3-4x^2-x-3}{x^2-2x-3} = 2x + \frac{5x-3}{(x-3)(x+1)} \]

Split \(\frac{5x-3}{(x-3)(x+1)} = \frac{A}{x-3} + \frac{B}{x+1} \Rightarrow 5x-3 = A(x+1)+B(x-3)\).

\(x=3 \Rightarrow 12 = 4A \Rightarrow A = 3\). \(x=-1 \Rightarrow -8 = -4B \Rightarrow B = 2\).

\[ \int \left(2x + \frac{3}{x-3} + \frac{2}{x+1}\right)dx = x^2 + 3\ln|x-3| + 2\ln|x+1| + C \]
\(x^2 + 3\ln|x-3| + 2\ln|x+1| + C\)
AP-style

Solve the differential equation \(\dfrac{dy}{dt} = y(4-y)\) with \(y(0) = 1\). (Find an explicit formula for \(y\) in terms of \(t\).)

Hint

Separate variables: \(\int \frac{1}{y(4-y)}\,dy = \int 1\,dt\). Use partial fractions on the left.

Solution

\(\frac{1}{y(4-y)} = \frac{1/4}{y} + \frac{1/4}{4-y}\). Integrating both sides:

\[ \frac14\ln\left|\frac{y}{4-y}\right| = t + C \implies \ln\left|\frac{y}{4-y}\right| = 4t + C_1 \]

Since \(y(0) = 1\) is between \(0\) and \(4\), drop absolute values: \(\frac{y}{4-y} = Ke^{4t}\).

Plug in \(t=0,\; y=1\): \(\frac{1}{3} = K\). Solve for \(y\): \(3y = (4-y)e^{4t} \Rightarrow y(3 + e^{4t}) = 4e^{4t}\).

\(y = \dfrac{4e^{4t}}{3 + e^{4t}} = \dfrac{4}{1 + 3e^{-4t}}\)