---
title: Partial fractions
heading: Splitting a fraction into pieces you can integrate
eyebrow: A6 · Lesson 4 · Partial fractions
xp: 40
---

::: hook
A circuit's response often arrives as one fraction, such as $\frac{3s + 5}{(s + 1)(s + 2)}$, and what you want is the time signal behind it. Split that fraction into $\frac{2}{s + 1} + \frac{1}{s + 2}$ and each piece is a single decaying exponential you can recognize on sight. In calculus the same split turns an integral nobody could do directly into two logarithms. The technique is called partial fractions, and C9 and A10 use it constantly.
:::

::: play
- The curve is $\frac{1}{(x + a)(x + b)}$. The two dashed curves are its pieces, $\frac{A}{x + a}$ and $\frac{B}{x + b}$.
- Move $a$ and $b$. The pieces always add up to the original curve exactly.
- Watch the readout: $A = \frac{1}{b - a}$ and $B = -A$. What happens as $a$ and $b$ get close?
:::
:::

```sim plot
view: graph
x: x = 0..5
y: y = -0.5..1.5
slider: a = 0.2..2 step 0.1 = 0.5
slider: b = 2.2..4 step 0.1 = 3
plot: 1/((x + a)*(x + b)) | label: whole
plot: 1/((b - a)*(x + a)) | label: A/(x + a) | color: ch2
plot: -1/((b - a)*(x + b)) | label: B/(x + b) | color: ch3
readout: A = 1/(b - a) | digits: 4
readout: B = -1/(b - a) | digits: 4
```

::: predict
## $\frac{1}{(x + 1)(x + 3)}$ splits into $\frac{A}{x + 1} + \frac{B}{x + 3}$. What is $A$?

- [x] $\frac{1}{2}$
- [ ] $-\frac{1}{2}$
- [ ] 1
- [ ] $\frac{1}{3}$

::: reveal
$\frac{1}{2}$. Multiply both sides by $x + 1$ and set $x = -1$: the $B$ term vanishes and $A = \frac{1}{-1 + 3} = \frac{1}{2}$. This shortcut is the **cover-up method**: cover the factor $(x + 1)$ in the original fraction and evaluate what's left at its root.
:::
:::

::: nameit
## Distinct linear factors

If the denominator factors into different linear terms, write one fraction per factor:

$$\frac{px + q}{(x - r_1)(x - r_2)} = \frac{A}{x - r_1} + \frac{B}{x - r_2}$$

**Cover-up:** $A$ is the original with $(x - r_1)$ covered, evaluated at $x = r_1$; likewise for $B$. Then each piece integrates to a logarithm: $\int\frac{A}{x - r}\,dx = A\ln|x - r| + C$.

## Repeated factors

A squared factor needs a term for each power:

$$\frac{px + q}{(x - r)^2} = \frac{A}{x - r} + \frac{B}{(x - r)^2}$$

Find $B$ by cover-up at $x = r$, then $A$ by comparing the coefficients of $x$ (or by putting in any other value of $x$).

## Irreducible quadratics

A quadratic that won't factor over the reals, like $x^2 + 2x + 2$, gets a linear numerator: $\frac{Bx + C}{x^2 + 2x + 2}$. Complete the square, $(x + 1)^2 + 1$, and the pieces integrate to a logarithm and an arctangent. In circuits, these are the underdamped responses: complex roots, and a decaying sine.

## Divide first

If the numerator's degree is at least the denominator's, do polynomial long division first; partial fractions apply only to the proper fraction left over.

## Checking

Always recombine the pieces over a common denominator, or test one value of $x$. It takes ten seconds and catches most slips.
:::

::: example
## Evaluate $\displaystyle\int_2^3\frac{dx}{x^2 - 1}$.

::: solution
1. **Factor the denominator.**
   $$x^2 - 1 = (x - 1)(x + 1)$$
2. **Cover up.** Set $x = 1$ for $A$ and $x = -1$ for $B$:
   $$\begin{aligned} A &= \frac{1}{1 + 1} \\ &= \frac{1}{2} \\ B &= \frac{1}{-1 - 1} \\ &= -\frac{1}{2} \end{aligned}$$
3. **Integrate.** Call the integral $I$:
   $$\begin{aligned} I &= \int_2^3\frac{1}{2}\left(\frac{1}{x - 1} - \frac{1}{x + 1}\right)dx \\ &= \frac{1}{2}\Big[\ln(x - 1) - \ln(x + 1)\Big]_2^3 \\ &= \frac{1}{2}\left(\ln\frac{2}{4} - \ln\frac{1}{3}\right) \\ &= \frac{1}{2}\ln\frac{3}{2} \\ &= 0.2027 \end{aligned}$$

**Answer:** the integral is $\frac{1}{2}\ln\frac{3}{2} = 0.2027$.
:::
:::

::: example
## Split $\dfrac{3s + 5}{(s + 1)(s + 2)}$.

::: solution
1. **Cover $(s + 1)$ and set $s = -1$.**
   $$\begin{aligned} A &= \frac{-3 + 5}{-1 + 2} \\ &= 2 \end{aligned}$$
2. **Cover $(s + 2)$ and set $s = -2$.**
   $$\begin{aligned} B &= \frac{-6 + 5}{-2 + 1} \\ &= 1 \end{aligned}$$
3. **Write the split.**
   $$\frac{3s + 5}{(s + 1)(s + 2)} = \frac{2}{s + 1} + \frac{1}{s + 2}$$
4. **Check.** Put the numerators back over the common denominator:
   $$2(s + 2) + (s + 1) = 3s + 5$$
   In C9 you'll read this at a glance as the signal $2e^{-t} + e^{-2t}$.

**Answer:** $\dfrac{3s + 5}{(s + 1)(s + 2)} = \dfrac{2}{s + 1} + \dfrac{1}{s + 2}$.
:::
:::

::: example
## Evaluate $\displaystyle\int_1^2\frac{dx}{x(x + 1)^2}$.

::: solution
1. **Set up the terms.** A repeated factor needs a term for each power:
   $$\frac{1}{x(x + 1)^2} = \frac{A}{x} + \frac{B}{x + 1} + \frac{C}{(x + 1)^2}$$
2. **Find the constants.** Covering up gives $A = 1$ and $C = -1$; matching the $x^2$ terms gives $B = -1$.
3. **Integrate and evaluate.**
   $$\begin{aligned} &\left[\ln x - \ln(x + 1) + \frac{1}{x + 1}\right]_1^2 \\ &= \ln\frac{4}{3} - \frac16 \\ &= 0.121 \end{aligned}$$

**Answer:** the integral is $\ln\frac{4}{3} - \frac16 = 0.121$.
:::
:::

::: check
given: a = 1 | 2; b = 3 | 5
answer: 1/(b - a)

## $\frac{1}{(x + \given{a})(x + \given{b})} = \frac{A}{x + \given{a}} + \frac{B}{x + \given{b}}$. What is $A$?

::: right
Right. Cover $(x + \given{a})$ and set $x = -\given{a}$: $A = \frac{1}{\given{b} - \given{a}}$ = {answer}.
:::

::: misses
- [1/(a - b)] Check the sign: at $x = -\given{a}$, the factor $x + \given{b}$ is $\given{b} - \given{a}$.
- [1/b] Evaluate $\frac{1}{x + \given{b}}$ at the root of the covered factor, $x = -\given{a}$.
- [any] Not yet. Cover up $(x + \given{a})$ and evaluate the rest at $x = -\given{a}$.
:::
:::

::: check
given: p = 2 | 3; q = 7 | 9
answer: q - p

## $\frac{\given{p}s + \given{q}}{(s + 1)(s + 2)} = \frac{A}{s + 1} + \frac{B}{s + 2}$. What is $A$?

::: right
Right. At $s = -1$: $\frac{-\given{p} + \given{q}}{-1 + 2}$ = {answer}.
:::

::: misses
- [2*p - q] That's $B$, from $s = -2$.
- [q + p] At $s = -1$ the numerator is $-\given{p} + \given{q}$.
- [any] Not yet. Cover up $(s + 1)$ and set $s = -1$.
:::
:::

::: check
given: a = 1 | 2; b = 3 | 4
answer: ln(b*(1 + a)/(a*(1 + b)))/(b - a)
tolerance: 0.5%

## Evaluate $\displaystyle\int_0^1\frac{dx}{(x + \given{a})(x + \given{b})}$.

::: right
Right. $\frac{1}{b - a}\ln\frac{x + a}{x + b}\Big|_0^1$ = {answer}.
:::

::: misses
- [ln((1 + a)/(1 + b))/(b - a)] Subtract the value at $x = 0$, which isn't zero here.
- [any] Not yet. Split it with cover-up, then each piece is a logarithm.
:::
:::

::: check
kind: expression
answer: ln(x - 1) - ln(x + 1)
vars: x = 2..6

## Find $\displaystyle\int\frac{2\,dx}{x^2 - 1}$ for $x > 1$ (constant zero).

::: right
Right. $\frac{2}{x^2 - 1} = \frac{1}{x - 1} - \frac{1}{x + 1}$, which integrates to two logarithms.
:::

::: misses
- [ln(x^2 - 1)] That's the integral of $\frac{2x}{x^2 - 1}$. Here the numerator has no $x$.
- [ln(x + 1) - ln(x - 1)] The signs are swapped: cover-up at $x = 1$ gives $+1$.
- [any] Not yet. Split it with cover-up first.
:::
:::

::: check
given: c = 3 | 4 | 6
answer: c - 1

## $\frac{x + \given{c}}{(x + 1)^2} = \frac{A}{x + 1} + \frac{B}{(x + 1)^2}$. What is $B$?

::: right
Right. Multiply through: $x + \given{c} = A(x + 1) + B$. At $x = -1$, $B = \given{c} - 1$ = {answer}, and comparing $x$ terms gives $A = 1$.
:::

::: misses
- [c] Put $x = -1$ into $x + \given{c}$.
- [1] That's $A$, from the $x$ terms.
- [any] Not yet. Write $x + \given{c} = A(x + 1) + B$ and set $x = -1$.
:::
:::

::: check
given: k = 1 | 2 | 3
answer: atan(1 + k) - atan(k)
tolerance: 0.5%

## Evaluate $\displaystyle\int_0^1\frac{dx}{(x + \given{k})^2 + 1}$.

::: right
Right. It's $\tan^{-1}(x + \given{k})$ from 0 to 1: {answer}.
:::

::: misses
- [atan(1 + k)] Subtract the value at $x = 0$, $\tan^{-1}\given{k}$.
- [any] Not yet. With $u = x + \given{k}$ this is $\int\frac{du}{u^2 + 1}$.
:::
:::

::: check
kind: choice

## What form should you use to split $\dfrac{x^2 + 1}{x(x - 1)^2}$?

- [ ] $\frac{A}{x} + \frac{B}{x - 1}$
- [x] $\frac{A}{x} + \frac{B}{x - 1} + \frac{C}{(x - 1)^2}$
- [ ] $\frac{A}{x} + \frac{B}{(x - 1)^2}$
- [ ] $\frac{Ax + B}{x(x - 1)^2}$

::: right
Right. A squared factor needs one term for each power, so three unknowns for a cubic denominator.
:::

::: misses
- [1] With only two terms you can't match a cubic denominator. The squared factor needs both powers.
- [3] Keep the $\frac{B}{x - 1}$ term too; most fractions need it.
- [4] That's the original fraction rewritten, not split.
- [any] One term per power of each factor.
:::
:::

::: check
kind: parts
given: a = 1 | 2; b = 3 | 4

## Use partial fractions.

::: part
answer: ln(b/a) - ln((b + 1)/(a + 1)) - (b - a)/((a + 1)*(b + 1))
tolerance: 0.5%

### $\displaystyle\int_{\given{a}}^{\given{b}}\frac{dx}{x(x + 1)^2}$, split as $\frac1x - \frac{1}{x + 1} - \frac{1}{(x + 1)^2}$

::: misses
- [any] Integrate each piece: $\ln x - \ln(x + 1) + \frac{1}{x + 1}$.
:::
:::

::: part
answer: (ln(b) - ln(a))/2 - (ln(b + 2) - ln(a + 2))/2
tolerance: 0.5%

### $\displaystyle\int_{\given{a}}^{\given{b}}\frac{dx}{x(x + 2)}$

::: misses
- [ln(b/a) - ln((b + 2)/(a + 2))] Each piece has a factor ½: $\frac{1}{x(x + 2)} = \frac12\left(\frac1x - \frac{1}{x + 2}\right)$.
- [any] Split into $\frac{A}{x} + \frac{B}{x + 2}$.
:::
:::
:::

::: check
kind: derivation
vars: s = 0.1..5

## Split $\dfrac{1}{s(s + 1)^2}$ into partial fractions.

::: step
answer: 1

### Cover up $s$ and put $s = 0$: what is $A$, the coefficient of $\frac1s$?
:::

::: step
answer: -1

### Cover up $(s + 1)^2$ and put $s = -1$: what is $C$, the coefficient of $\frac{1}{(s + 1)^2}$?
:::

::: step
answer: 1/s - 1/(s + 1) - 1/(s + 1)^2

### The $s^2$ terms then fix $B = -1$. Write the whole split.
:::

::: right
Right. A repeated factor needs one term for each power, the shape behind a critically damped circuit's $te^{-t}$.
:::
:::

::: explain
## Why does the cover-up method give the coefficient $A$ of $\frac{A}{x - r}$?

::: model
Multiply both sides of the split by $(x - r)$. On the left, that factor cancels from the denominator. On the right, the $A$ term becomes just $A$, and every other term still has a factor $(x - r)$ in front. Now set $x = r$: every other term becomes zero, leaving $A$ equal to the left side with $(x - r)$ removed, evaluated at $x = r$. Covering the factor with your thumb does the same thing.
:::
:::

::: practice

::: check
given: a = 1 | 3; b = 4 | 6
answer: 1/(a - b)

## $\frac{1}{(x + \given{a})(x + \given{b})} = \frac{A}{x + \given{a}} + \frac{B}{x + \given{b}}$. What is $B$?

::: misses
- [1/(b - a)] That's $A$. $B$ has the opposite sign.
- [any] Cover up $(x + \given{b})$ and set $x = -\given{b}$.
:::
:::

::: check
given: p = 1 | 4; q = 5 | 10
answer: (q - 3*p)/(-3 + 1)

## $\frac{\given{p}s + \given{q}}{(s + 1)(s + 3)} = \frac{A}{s + 1} + \frac{B}{s + 3}$. What is $B$?

::: misses
- [any] Set $s = -3$ in $\frac{\given{p}s + \given{q}}{s + 1}$.
:::
:::

::: check
given: b = 2..12 int
answer: ln(2*b/(b + 1))
tolerance: 0.5%

## Evaluate $\displaystyle\int_1^{\given{b}}\frac{dx}{x(x + 1)}$.

::: misses
- [any] $\frac{1}{x(x + 1)} = \frac{1}{x} - \frac{1}{x + 1}$.
:::
:::
:::
