# Partial Fractions: How to Decompose and Integrate, Step by Step

> Learn partial fraction decomposition for distinct linear, repeated linear and irreducible quadratic factors, the cover-up shortcut, and worked integrals.

Source: https://practicecalculus.com/blog/partial-fractions
Updated: 2026-09-22

## Key takeaways

- Partial fractions split a rational function into simple pieces like $\frac{A}{x-a}$ that each integrate to a log, a power or an arctangent.
- Before decomposing, make sure the numerator has lower degree than the denominator. If not, do polynomial long division first.
- A repeated factor $(x-a)^2$ needs two terms, $\frac{A}{x-a} + \frac{B}{(x-a)^2}$, and an irreducible quadratic needs a linear numerator $\frac{Bx + C}{x^2 + bx + c}$.
- The cover-up method finds the constant over each distinct linear factor in one line: cover that factor and plug in its root.

You can add $\frac{3}{x-2} + \frac{2}{x+1}$ to get $\frac{5x-1}{x^2-x-2}$ in a few lines. But if an integral hands you $\int \frac{5x-1}{x^2-x-2}\,dx$, no basic rule applies. **Partial fractions** runs that addition backward, breaking one hard fraction into simple pieces you can integrate on sight.

## What is partial fraction decomposition?

A **rational function** is one polynomial divided by another. **Partial fraction decomposition** rewrites a rational function as a sum of simpler fractions whose denominators are the factors of the original denominator. For example:

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

Each piece on the right integrates to a natural log, so the integral becomes routine:

$$\int \frac{A}{x-a}\,dx = A\ln|x-a| + C$$

## Step 0: is the fraction proper?

Partial fractions only works when the numerator's degree is **less than** the denominator's degree. If not, use polynomial long division first.

For example, $\frac{x^2+1}{x^2-1}$ has equal degrees. Dividing gives

$$\frac{x^2+1}{x^2-1} = 1 + \frac{2}{x^2-1},$$

and only $\frac{2}{x^2-1}$ needs to be decomposed.

## The partial fraction forms

Factor the denominator completely. Each kind of factor contributes its own kind of term:

| Factor in the denominator          | Terms in the decomposition                                           |
| ---------------------------------- | -------------------------------------------------------------------- |
| Distinct linear $(x-a)$            | $\frac{A}{x-a}$                                                      |
| Repeated linear $(x-a)^2$          | $\frac{A}{x-a} + \frac{B}{(x-a)^2}$                                  |
| Repeated linear $(x-a)^3$          | $\frac{A}{x-a} + \frac{B}{(x-a)^2} + \frac{C}{(x-a)^3}$              |
| Irreducible quadratic $x^2+bx+c$   | $\frac{Bx + C}{x^2 + bx + c}$                                        |

A quadratic is **irreducible** when it does not factor over the real numbers, which happens when $b^2 - 4c < 0$. Examples are $x^2 + 1$ and $x^2 + 2x + 5$.

## Case 1: distinct linear factors

### Worked example 1

Evaluate $\int \frac{5x-1}{x^2-x-2}\,dx$.

**Step 1. Check it is proper.** Degree 1 over degree 2. Good.

**Step 2. Factor the denominator.** $x^2 - x - 2 = (x-2)(x+1)$.

**Step 3. Write the form.**

$$\frac{5x-1}{(x-2)(x+1)} = \frac{A}{x-2} + \frac{B}{x+1}$$

**Step 4. Clear denominators.** Multiply both sides by $(x-2)(x+1)$:

$$5x - 1 = A(x+1) + B(x-2)$$

**Step 5. Plug in convenient values.** At $x = 2$ the $B$ term vanishes: $9 = 3A$, so $A = 3$. At $x = -1$ the $A$ term vanishes: $-6 = -3B$, so $B = 2$.

**Step 6. Integrate.**

$$\int \left(\frac{3}{x-2} + \frac{2}{x+1}\right)dx = 3\ln|x-2| + 2\ln|x+1| + C$$

```graph
title: 'Graph of y = (5x − 1)/((x − 2)(x + 1)) with vertical asymptotes at x = 2 and x = −1'
caption: 'Each factor of the denominator gives a vertical asymptote, and each one becomes its own simple fraction: $\frac{3}{x-2} + \frac{2}{x+1}$.'
x: [-6, 5]
y: [-10, 10]
functions:
  - expr: (5x-1)/((x-2)(x+1))
    label: y = (5x − 1)/((x − 2)(x + 1))
vertical:
  - {x: -1, label: 'x = −1'}
  - {x: 2, label: 'x = 2'}
```

## The cover-up method: a shortcut for linear factors

For a **distinct linear factor** $(x-a)$, there is a one-line shortcut. Cover up that factor in the original fraction, then plug $x = a$ into what is left.

For $\frac{5x-1}{(x-2)(x+1)}$:

- To find $A$ over $(x-2)$: cover $(x-2)$, leaving $\frac{5x-1}{x+1}$. At $x = 2$: $\frac{9}{3} = 3$.
- To find $B$ over $(x+1)$: cover $(x+1)$, leaving $\frac{5x-1}{x-2}$. At $x = -1$: $\frac{-6}{-3} = 2$.

Same answers, almost no algebra. It is exactly Step 5 done in your head.

### Worked example 2: cover-up and long division together

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

- Cover $(x-1)$, evaluate $\frac{2}{x+1}$ at $x = 1$: $A = 1$.
- Cover $(x+1)$, evaluate $\frac{2}{x-1}$ at $x = -1$: $B = -1$.

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

Combined with the long division from Step 0:

$$\int \frac{x^2+1}{x^2-1}\,dx = x + \ln|x-1| - \ln|x+1| + C = x + \ln\left|\frac{x-1}{x+1}\right| + C$$

> **Tip:** the cover-up method gives the coefficient for any distinct linear factor, and for the **highest** power of a repeated factor. For the lower powers of a repeated factor and for quadratic factors, use another method.

### Worked example 3: three distinct linear factors

Evaluate $\int \frac{2x^2+6x-2}{x^3+x^2-2x}\,dx$.

**Step 1. Factor the denominator.** Pull out $x$, then factor the quadratic:

$$x^3 + x^2 - 2x = x(x^2 + x - 2) = x(x-1)(x+2)$$

**Step 2. Write the form.**

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

**Step 3. Cover up each factor.**

- Cover $x$, evaluate $\frac{2x^2+6x-2}{(x-1)(x+2)}$ at $x = 0$: $\frac{-2}{(-1)(2)} = 1$, so $A = 1$.
- Cover $(x-1)$, evaluate $\frac{2x^2+6x-2}{x(x+2)}$ at $x = 1$: $\frac{6}{3} = 2$, so $B = 2$.
- Cover $(x+2)$, evaluate $\frac{2x^2+6x-2}{x(x-1)}$ at $x = -2$: $\frac{-6}{6} = -1$, so $C = -1$.

**Step 4. Integrate.**

$$\int \left(\frac1x + \frac{2}{x-1} - \frac{1}{x+2}\right)dx = \ln|x| + 2\ln|x-1| - \ln|x+2| + C$$

With three linear factors, solving a system of equations would take several lines. The cover-up method takes three quick evaluations.

### Worked example 4: a definite integral

Evaluate $\int_2^3 \frac{2}{x^2-1}\,dx$.

From example 2, $\frac{2}{x^2-1} = \frac{1}{x-1} - \frac{1}{x+1}$, so

$$\int_2^3 \frac{2}{x^2-1}\,dx = \Big[\ln|x-1| - \ln|x+1|\Big]_2^3 = (\ln 2 - \ln 4) - (\ln 1 - \ln 3)$$

Simplify with log rules: $\ln 2 - \ln 4 = -\ln 2$ and $\ln 1 - \ln 3 = -\ln 3$, so the value is $-\ln 2 + \ln 3 = \ln\frac32 \approx 0.405$.

Notice the interval $[2, 3]$ stays away from the asymptotes at $x = \pm 1$. If a bound sat on an asymptote, this would be an [improper integral](/blog/improper-integrals) and would need a limit.

## Two ways to find the constants

You have now seen both standard methods. It helps to know when each one is faster.

- **Plugging in roots (or cover-up).** Substitute the root of each linear factor into the cleared equation. Each substitution kills every term but one, so you read off a constant immediately. This is the fastest method for distinct linear factors.
- **Matching coefficients.** Expand the right side, collect powers of $x$, and set each coefficient equal to the matching one on the left. This always works, and it is the only option for quadratic factors and for the lower powers of a repeated factor.

In practice, most students combine them: plug in roots to get as many constants as possible, then match one or two coefficients to finish.

## Case 2: repeated linear factors

### Worked example 5

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

**Step 1. Write the form.** The factor $(x+1)$ is squared, so it gets two terms:

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

**Step 2. Clear denominators.**

$$4x = A(x+1)^2 + B(x-1)(x+1) + C(x-1)$$

**Step 3. Plug in the roots.** At $x = 1$: $4 = 4A$, so $A = 1$. At $x = -1$: $-4 = -2C$, so $C = 2$.

**Step 4. Match a coefficient for the last constant.** The $x^2$ terms on the right are $Ax^2 + Bx^2$, and the left side has no $x^2$ term, so $A + B = 0$ and $B = -1$.

**Step 5. Integrate each piece.** The last term is a power, not a log:

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

The $(x+1)^{-2}$ term integrates to $\frac{(x+1)^{-1}}{-1}$, which is where $-\frac{2}{x+1}$ comes from.

## Case 3: irreducible quadratic factors

### Worked example 6

Evaluate $\int \frac{2x^2+2x+1}{x(x^2+1)}\,dx$.

**Step 1. Write the form.** $x^2 + 1$ cannot be factored, so it gets a linear numerator:

$$\frac{2x^2+2x+1}{x(x^2+1)} = \frac{A}{x} + \frac{Bx + C}{x^2+1}$$

**Step 2. Clear denominators and expand.**

$$2x^2 + 2x + 1 = A(x^2+1) + (Bx+C)x = (A+B)x^2 + Cx + A$$

**Step 3. Match coefficients.** Constant: $A = 1$. $x$ term: $C = 2$. $x^2$ term: $A + B = 2$, so $B = 1$.

**Step 4. Split the quadratic piece.**

$$\int \left(\frac{1}{x} + \frac{x}{x^2+1} + \frac{2}{x^2+1}\right)dx$$

The middle piece is a [u-substitution](/blog/u-substitution) with $u = x^2+1$, giving $\tfrac12\ln(x^2+1)$. The last piece is a standard arctangent.

**Step 5. Combine.**

$$\int \frac{2x^2+2x+1}{x(x^2+1)}\,dx = \ln|x| + \tfrac12\ln(x^2+1) + 2\arctan x + C$$

> **Tip:** if the quadratic is something like $x^2 + 2x + 5$, complete the square to get $(x+1)^2 + 4$, then use $\int \frac{du}{u^2 + a^2} = \frac1a\arctan\frac{u}{a} + C$.

## Common partial fraction mistakes

1. **Skipping long division.** If the fraction is improper, the decomposition form is wrong and the constants will not solve consistently.
2. **Giving a repeated factor only one term.** $(x+1)^2$ needs both $\frac{B}{x+1}$ and $\frac{C}{(x+1)^2}$.
3. **Using a constant over a quadratic.** An irreducible quadratic needs $Bx + C$ on top, not just $B$.
4. **Integrating $\frac{1}{(x+1)^2}$ as a log.** It is a power: $-\frac{1}{x+1}$.
5. **Not factoring completely.** $x^3 - x = x(x-1)(x+1)$ has three linear factors, not one linear and one quadratic.
6. **Dropping absolute values** inside the logarithms.

## Quick reference: integrating each piece

| Piece                      | Integral                                         |
| -------------------------- | ------------------------------------------------ |
| $\frac{A}{x-a}$            | $A\ln\lvert x-a\rvert + C$                       |
| $\frac{A}{(x-a)^n}$, $n\ge 2$ | $\frac{-A}{(n-1)(x-a)^{n-1}} + C$             |
| $\frac{x}{x^2+a^2}$        | $\tfrac12\ln(x^2+a^2) + C$                       |
| $\frac{1}{x^2+a^2}$        | $\frac1a\arctan\frac{x}{a} + C$                  |

## Make decomposition second nature

Partial fractions is a procedure, and procedures stick through repetition. Once you have set up a dozen decompositions, choosing the right form and using the cover-up shortcut will feel automatic. Try the interactive lesson below: it checks each constant as you go and shows exactly where a setup went wrong.

## Frequently asked questions

### What is partial fraction decomposition?

It is the reverse of adding fractions. A single rational function like $\frac{5x-1}{(x-2)(x+1)}$ is rewritten as a sum of simpler fractions, here $\frac{3}{x-2} + \frac{2}{x+1}$, each of which is easy to integrate.

### When do you use partial fractions to integrate?

Use partial fractions for a rational function (a polynomial divided by a polynomial) whose denominator factors and where u-substitution does not work directly. If the numerator is already the derivative of the denominator, a simple substitution is faster.

### What do you do if the degree of the numerator is too high?

If the numerator degree is greater than or equal to the denominator degree, divide first using polynomial long division. You get a polynomial plus a proper fraction, and only the proper fraction needs partial fractions.

### How does the cover-up method work?

For a distinct linear factor $(x-a)$, cover it up in the original fraction and evaluate what remains at $x = a$. The result is the constant $A$ over $(x-a)$. It works only for linear factors that are not repeated, or for the highest power of a repeated factor.

### How do you handle an irreducible quadratic factor?

Give it a linear numerator: $\frac{Bx+C}{x^2+bx+c}$. When integrating, split it into a piece that integrates to a logarithm via u-substitution and a piece that integrates to an arctangent, completing the square if needed.
