---
title: Partial Fractions and Integration Strategy
module: Techniques of Integration
moduleNumber: 7
lessonNumber: 3
order: 703
summary: >
  Any rational function integrates in closed form: factor the denominator, split
  the fraction into simple pieces by partial fractions, and integrate each piece
  as a logarithm or an arctangent. Four denominator cases exhaust the
  possibilities. A four-step strategy then sorts an arbitrary integrand by its
  shape to the technique that fits it, and a short catalog records elementary
  functions whose antiderivatives are not elementary.
topics: [Techniques of Integration]
sources:
  - book: Stewart
    ref: "Ch. 7 — Techniques of Integration; §7.4 Integration of Rational Functions by Partial Fractions, §7.5 Strategy for Integration, §7.6 Integration Using Tables and CAS"
---

A **rational function** is a ratio $f(x) = P(x)/Q(x)$ of polynomials. Every such
function has an elementary antiderivative, and there is a mechanical procedure to
find it: rewrite $f$ as a sum of simpler fractions, each of which integrates to a
logarithm or an arctangent. The rewriting is the **method of partial fractions**,
running the addition of fractions in reverse.

The direction to reverse looks like this: combining two fractions over a common
denominator gives

$$
\frac{2}{x-1} - \frac{1}{x+2} = \frac{2(x+2) - (x-1)}{(x-1)(x+2)} = \frac{x+5}{x^2 + x - 2}.
$$

Read backward, the messy right side splits into two pieces that each integrate at
sight:

$$
\int \frac{x+5}{x^2 + x - 2}\,\d x = \int\!\left(\frac{2}{x-1} - \frac{1}{x+2}\right)\d x = 2\ln|x-1| - \ln|x+2| + C.
$$

## Proper fractions and factoring

Partial fractions applies only to a **proper** rational function, one with
$\deg P < \deg Q$. If $f$ is improper, divide first: polynomial long division
writes

$$
\frac{P(x)}{Q(x)} = S(x) + \frac{R(x)}{Q(x)}, \qquad \deg R < \deg Q,
$$

where the quotient $S$ integrates directly and the proper remainder
$R(x)/Q(x)$ goes to partial fractions.

> **Worked example.** Evaluate $\displaystyle\int \frac{x^3 + x}{x-1}\,\d x$.
>
> The integrand is improper ($\deg = 3 \ge 1$), so divide first. Long division of
> $x^3 + x$ by $x - 1$ gives quotient $x^2 + x + 2$ and remainder $2$:
>
> $$
> \frac{x^3 + x}{x-1} = x^2 + x + 2 + \frac{2}{x-1}.
> $$
>
> Every term is now immediate:
>
> $$
> \int \frac{x^3 + x}{x-1}\,\d x = \frac{x^3}{3} + \frac{x^2}{2} + 2x + 2\ln|x-1| + C.
> $$

Once the fraction is proper, factor the denominator. Any polynomial with real
coefficients factors completely into linear factors $ax + b$ and irreducible
quadratic factors $ax^2 + bx + c$ (those with $b^2 - 4ac < 0$, which have no real
root). The shape of that factorization determines the form of the decomposition,
in four cases.

$$
% caption: The four decomposition cases. Each factor of the denominator contributes a fixed template of partial fractions; a repeated factor contributes one term per power up to its multiplicity.
\begin{tikzpicture}[>=stealth,font=\small,
  box/.style={draw,minimum width=41mm,minimum height=15mm,align=center,font=\scriptsize}]
\definecolor{acc}{HTML}{4A6FA5}
\node[draw,draw=acc,minimum width=44mm,minimum height=11mm,align=center,font=\footnotesize] (r) at (0,0) {proper $\;R(x)/Q(x)\;$ by factor of $Q$};
\node[box] (c1) at (-6.9,-2.6) {distinct linear $ax+b$\\[1mm]$\dfrac{A}{ax+b}$};
\node[box] (c2) at (-2.3,-2.6) {repeated linear $(ax+b)^r$\\[1mm]$\dfrac{A_1}{ax+b}+\cdots+\dfrac{A_r}{(ax+b)^r}$};
\node[box] (c3) at (2.3,-2.6) {irreducible $ax^2+bx+c$\\[1mm]$\dfrac{Ax+B}{ax^2+bx+c}$};
\node[box] (c4) at (6.9,-2.6) {repeated quadratic $(\cdots)^r$\\[1mm]$\dfrac{A_1x+B_1}{ax^2+bx+c}+\cdots$};
\draw[->,acc,thick] (r) -- (c1);
\draw[->,acc,thick] (r) -- (c2);
\draw[->,acc,thick] (r) -- (c3);
\draw[->,acc,thick] (r) -- (c4);
\end{tikzpicture}
$$

## Case I: distinct linear factors

If $Q$ is a product of distinct linear factors, each contributes one term with an
unknown constant on top. For $\displaystyle\int \frac{x^2 + 2x - 1}{2x^3 + 3x^2 - 2x}\,\d x$,
factor the denominator as $x(2x-1)(x+2)$ and write

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

Multiply through by $x(2x-1)(x+2)$:

$$
x^2 + 2x - 1 = A(2x-1)(x+2) + Bx(x+2) + Cx(2x-1).
$$

### The cover-up shortcut

This identity holds for **every** $x$, so choosing values at which factors
vanish isolates one constant at a time. Setting $x = 0$ leaves $-1 = A(-1)(2)$, so
$A = \tfrac{1}{2}$. Setting $x = \tfrac{1}{2}$ leaves only the $B$ term; setting
$x = -2$ leaves only $C$:

$$
A = \tfrac{1}{2}, \qquad B = \tfrac{1}{5}, \qquad C = -\tfrac{1}{10}.
$$

Each root of a linear factor "covers up" that factor and reads its coefficient
directly.

$$
% caption: The cover-up method for a distinct linear factor: evaluate at the factor's root, where every other term vanishes, and the surviving equation gives that coefficient.
\begin{tikzpicture}[>=stealth,font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\node[black] at (0,0) {$x^2+2x-1 = \underbrace{A(2x-1)(x+2)}_{\text{keep}} + \underbrace{Bx(x+2) + Cx(2x-1)}_{\text{vanish at }x=0}$};
\node[acc,font=\footnotesize] at (0,-1.3) {set $x=0:\quad -1 = A(-1)(2) \;\Rightarrow\; A=\tfrac12$};
\end{tikzpicture}
$$

With the constants known,

$$
\int \frac{x^2 + 2x - 1}{2x^3 + 3x^2 - 2x}\,\d x = \tfrac{1}{2}\ln|x| + \tfrac{1}{10}\ln|2x-1| - \tfrac{1}{10}\ln|x+2| + K.
$$

Every distinct-linear case integrates to a sum of logarithms.

## Case II: repeated linear factors

A factor $(ax+b)$ repeated $r$ times contributes one term for each power from
$1$ up to $r$. For $\displaystyle\int \frac{x^4 - 2x^2 + 4x + 1}{x^3 - x^2 - x + 1}\,\d x$,
the integrand is improper, so divide first:

$$
\frac{x^4 - 2x^2 + 4x + 1}{x^3 - x^2 - x + 1} = x + 1 + \frac{4x}{x^3 - x^2 - x + 1}.
$$

The denominator factors as $(x-1)^2(x+1)$, so the repeated factor $(x-1)$ gets
two terms:

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

> **Worked example.** Finish $\displaystyle\int \frac{4x}{(x-1)^2(x+1)}\,\d x$.
>
> Clear the denominators:
>
> $$
> 4x = A(x-1)(x+1) + B(x+1) + C(x-1)^2.
> $$
>
> The cover-up values isolate the constants one at a time: $x = 1$ gives
> $4 = 2B$, so $B = 2$; $x = -1$ gives $-4 = 4C$, so $C = -1$; and $x = 0$ gives
> $0 = -A + B + C$, so $A = 1$. The squared term integrates by the power rule,
> not a logarithm:
>
> $$
> \int \frac{4x}{(x-1)^2(x+1)}\,\d x = \ln|x-1| - \frac{2}{x-1} - \ln|x+1| + K.
> $$

## Case III: irreducible quadratic factors

An irreducible quadratic $ax^2 + bx + c$ contributes a term with a **linear**
numerator, $(Ax + B)/(ax^2 + bx + c)$. Such a term integrates to a logarithm plus
an arctangent, using

$$
\int \frac{\d x}{x^2 + a^2} = \frac{1}{a}\tan^{-1}\!\Bigl(\frac{x}{a}\Bigr) + C.
$$

For $\displaystyle\int \frac{2x^2 - x + 4}{x^3 + 4x}\,\d x$, the denominator
$x(x^2 + 4)$ has one linear and one irreducible quadratic factor:

$$
\frac{2x^2 - x + 4}{x(x^2 + 4)} = \frac{A}{x} + \frac{Bx + C}{x^2 + 4}.
$$

Matching coefficients gives $A = 1$, $B = 1$, $C = -1$. Splitting the quadratic
term into a piece whose numerator is the derivative of $x^2 + 4$ and a constant
piece,

$$
\int \frac{2x^2 - x + 4}{x^3 + 4x}\,\d x = \ln|x| + \tfrac{1}{2}\ln(x^2 + 4) - \tfrac{1}{2}\tan^{-1}\!\Bigl(\frac{x}{2}\Bigr) + K.
$$

When the quadratic does not factor and its numerator is not already a derivative,
complete the square in the denominator first, then substitute to reach the
arctangent form.

$$
% caption: A linear-over-quadratic term always splits into two pieces: the part whose numerator is the derivative of the denominator integrates to a logarithm, and the leftover constant integrates to an arctangent.
\begin{tikzpicture}[>=stealth,font=\small,
  bx/.style={draw,minimum width=30mm,minimum height=12mm,align=center,font=\footnotesize}]
\definecolor{acc}{HTML}{4A6FA5}
\node[bx,draw=acc] (q) at (0,0) {$\frac{Ax+B}{x^2+a^2}$};
\node[bx] (l) at (5.4,1.1) {logarithm};
\node[bx] (a) at (5.4,-1.1) {arctangent};
\draw[->,acc,thick] (q) -- node[above,black,font=\scriptsize,pos=0.55]{derivative piece} (l);
\draw[->,acc,thick] (q) -- node[below,black,font=\scriptsize,pos=0.55]{constant piece} (a);
\end{tikzpicture}
$$

## Case IV: repeated irreducible quadratic factors

A factor $(ax^2 + bx + c)^r$ contributes one linear-over-quadratic term per power:

$$
\frac{A_1 x + B_1}{ax^2 + bx + c} + \frac{A_2 x + B_2}{(ax^2 + bx + c)^2} + \cdots + \frac{A_r x + B_r}{(ax^2 + bx + c)^r}.
$$

Each term integrates by substitution or by completing the square, though the
higher powers grow tedious by hand and are usually left to a computer algebra
system.

> **Worked example.** Evaluate $\displaystyle\int \frac{1 - x + 2x^2 - x^3}{x(x^2 + 1)^2}\,\d x$.
>
> The denominator has a linear factor and a repeated irreducible quadratic, so
>
> $$
> \frac{1 - x + 2x^2 - x^3}{x(x^2 + 1)^2} = \frac{A}{x} + \frac{Bx + C}{x^2 + 1} + \frac{Dx + E}{(x^2 + 1)^2}.
> $$
>
> Clearing denominators and matching coefficients gives $A = 1$, $B = -1$,
> $C = -1$, $D = 1$, $E = 0$, so the integrand is
>
> $$
> \frac{1}{x} - \frac{x + 1}{x^2 + 1} + \frac{x}{(x^2 + 1)^2}.
> $$
>
> Integrate term by term, using $u = x^2 + 1$ on the two rational-in-$u$ pieces
> and the arctangent form on the constant piece:
>
> $$
> \int \frac{1 - x + 2x^2 - x^3}{x(x^2 + 1)^2}\,\d x = \ln|x| - \tfrac{1}{2}\ln(x^2 + 1) - \tan^{-1}x - \frac{1}{2(x^2 + 1)} + K.
> $$

The four cases together are exhaustive: any proper rational function
decomposes into terms of these forms, so any rational function has an elementary
antiderivative.

### Rationalizing substitutions

An integrand containing $\sqrt[n]{g(x)}$ can sometimes be made rational by
substituting $u = \sqrt[n]{g(x)}$.

> **Worked example.** Evaluate $\displaystyle\int \frac{\sqrt{x + 4}}{x}\,\d x$.
>
> Let $u = \sqrt{x + 4}$, so $x = u^2 - 4$ and $\d x = 2u\,\d u$:
>
> $$
> \int \frac{u}{u^2 - 4}\,2u\,\d u = 2\int \frac{u^2}{u^2 - 4}\,\d u = 2\int\!\left(1 + \frac{4}{u^2 - 4}\right)\d u.
> $$
>
> The remaining fraction is a distinct-linear Case I in $u$, with
> $\dfrac{4}{u^2 - 4} = \dfrac{1}{u - 2} - \dfrac{1}{u + 2}$, so
>
> $$
> 2u + 2\ln\left|\frac{u - 2}{u + 2}\right| + C = 2\sqrt{x + 4} + 2\ln\left|\frac{\sqrt{x + 4} - 2}{\sqrt{x + 4} + 2}\right| + C.
> $$

## The overall strategy

Differentiation is mechanical: the rules say which formula applies. Integration is
not. Facing an unfamiliar integral, work through four steps.[^strategy]

1. **Simplify the integrand.** Algebra or a trigonometric identity may make the
   method obvious, as when $\int(\sin x + \cos x)^2\,\d x$ expands to
   $\int(1 + 2\sin x\cos x)\,\d x$.
2. **Look for an obvious substitution.** Find a $u = g(x)$ whose differential
   $g'(x)\,\d x$ is already present up to a constant.
3. **Classify by the form of the integrand.**
   - _Trigonometric_ products of powers use the
     [trigonometric-integral](/calculus/techniques-of-integration/trigonometric-integrals-and-substitution)
     strategies.
   - _Rational functions_ use partial fractions.
   - A _power of $x$ times a transcendental function_ uses
     [integration by parts](/calculus/techniques-of-integration/integration-by-parts).
   - A _quadratic radical_ $\sqrt{\pm x^2 \pm a^2}$ uses trigonometric
     substitution; $\sqrt[n]{ax+b}$ uses a rationalizing substitution.
4. **Try again.** Only two general methods exist, substitution and parts, so if
   the first three steps stall, attempt a less obvious substitution, apply parts
   to a single function, or manipulate the integrand toward a form already
   solved.

$$
% caption: The integration-strategy flowchart: simplify, seek a substitution, classify by form, and if all else fails fall back on the two general methods.
\begin{tikzpicture}[>=stealth,font=\small,
  phase/.style={draw,minimum width=33mm,minimum height=11mm,align=center,font=\footnotesize},
  form/.style={draw,minimum width=30mm,minimum height=9mm,align=center,font=\scriptsize}]
\definecolor{acc}{HTML}{4A6FA5}
\node[phase,draw=acc] (s1) at (0,0) {1. simplify};
\node[phase] (s2) at (0,-1.7) {2. obvious $u$?};
\node[phase] (s3) at (0,-3.4) {3. classify form};
\node[form] (f1) at (5.0,-2.3) {trig powers: convert};
\node[form] (f2) at (5.0,-3.4) {rational: partial fractions};
\node[form] (f3) at (5.0,-4.5) {$x^n\cdot$ transcendental: parts};
\node[form] (f4) at (5.0,-5.6) {radical: substitution};
\node[phase] (s4) at (0,-5.6) {4. try again};
\draw[->,acc,thick] (s1) -- (s2);
\draw[->,acc,thick] (s2) -- (s3);
\draw[->,acc,thick] (s3) -- (s4);
\draw[->,black] (s3.east) -- (f1.west);
\draw[->,black] (s3.east) -- (f2.west);
\draw[->,black] (s3.east) -- (f3.west);
\draw[->,black] (s3.east) -- (f4.west);
\end{tikzpicture}
$$

> **Worked example.** Sort and evaluate two similar-looking integrals.
>
> $\displaystyle\int \frac{x}{x^2 + 1}\,\d x$: step 2 spots the substitution
> $u = x^2 + 1$, $\d u = 2x\,\d x$, so the integral is
> $\tfrac{1}{2}\ln(x^2 + 1) + C$ — no partial fractions needed even though the
> integrand is rational.
>
> $\displaystyle\int \frac{\d x}{x^2 - 1}$: no such substitution presents itself,
> so step 3 classifies the integrand as rational and partial fractions give
> $\dfrac{1}{x^2 - 1} = \dfrac{1/2}{x - 1} - \dfrac{1/2}{x + 1}$, hence
>
> $$
> \int \frac{\d x}{x^2 - 1} = \frac{1}{2}\ln\left|\frac{x - 1}{x + 1}\right| + C.
> $$

## Nonelementary antiderivatives

The strategy does not always succeed. The **elementary functions** are those built from polynomials, roots, exponentials,
logarithms, and trigonometric functions by finitely many arithmetic operations
and compositions. Their derivatives are always elementary, but their integrals
need not be. It has been proved that

$$
\int e^{x^2}\,\d x, \qquad \int \frac{\sin x}{x}\,\d x, \qquad \int \frac{e^x}{x}\,\d x, \qquad \int \sqrt{x^3 + 1}\,\d x
$$

have no elementary antiderivative. Each still defines a perfectly good function
by the [Fundamental Theorem](/calculus/integrals/the-fundamental-theorem-of-calculus),
just not one expressible in closed form. Such integrals are handled by
[power series](/calculus/sequences-and-series/power-series) or by
[numerical approximation](/calculus/techniques-of-integration/approximate-and-improper-integrals).

## Tables and computer algebra

Extensive tables of integrals list hundreds of forms indexed by shape; matching a
given integrand usually needs a preliminary substitution or algebraic step to fit
one of the listed patterns. Computer algebra systems automate the same
pattern-matching and handle the tedious cases (repeated quadratic factors,
high-degree decompositions) instantly. Two cautions: a system returns a single
antiderivative with no constant of integration, and it may drop absolute-value
bars inside logarithms, valid only on part of the domain. A hand computation
sometimes yields a cleaner form than the machine's.[^tables]

| Denominator factor | Partial-fraction term | Integrates to |
| --- | --- | --- |
| distinct linear $ax+b$ | $\dfrac{A}{ax+b}$ | logarithm |
| repeated linear $(ax+b)^r$ | $\dfrac{A_1}{ax+b}+\cdots+\dfrac{A_r}{(ax+b)^r}$ | logarithm and powers |
| irreducible quadratic | $\dfrac{Ax+B}{ax^2+bx+c}$ | logarithm and arctangent |
| repeated quadratic $(\cdots)^r$ | one linear-over-power term per power | logarithm, arctangent, powers |

[^strategy]: **Stewart**, _Calculus_, §7.5 — Strategy for Integration: the four-step routine and the classification of integrands by form.
[^tables]: **Stewart**, _Calculus_, §7.6 — Integration Using Tables and Computer Algebra Systems: matching table forms and the caveats on machine answers.
