Integrals

Partial Fraction Decomposition: Steps and Examples

Partial Fraction Decomposition: Steps and Examples

Partial fraction decomposition splits a complicated rational function into a sum of simple fractions that you already know how to integrate, mostly into logs and arctangents.

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

It is the standard method for integrating any rational function, that is, any polynomial divided by another polynomial. Once you know it, every such integral becomes routine.

Why it works

Partial fractions is ordinary fraction addition run in reverse. If you add \( \frac{1}{x+1} + \frac{2}{x+3} \) over the common denominator \( (x+1)(x+3) \), the numerator is \( (x+3) + 2(x+1) = 3x + 5 \). Decomposition asks the opposite question: given the combined fraction, which simple pieces produced it?

Partial fraction decomposition: Hands holding a smartphone over a blue puzzle with a missing piece

A theorem from algebra guarantees the answer always exists and is unique. Every real polynomial factors into linear factors and irreducible quadratics, and every proper rational function can be written as a sum of simple fractions over those factors using partial fraction decomposition. The number of unknown constants always equals the degree of the denominator, so you get exactly as many equations as unknowns.

The payoff for integration is that each simple piece, obtained through partial fraction decomposition, has a known antiderivative: \( \frac{A}{x-a} \) integrates to a logarithm (see integral of 1/x), \( \frac{A}{(x-a)^k} \) with \( k \ge 2 \) integrates to a power, and quadratic pieces give a log plus an arctangent.

Before you start: two checks

  1. Is the fraction proper? The degree of the top must be less than the degree of the bottom. If not, do polynomial long division first.
  2. Factor the denominator completely into linear factors and irreducible quadratics.

The method in five steps

  1. Divide if the fraction is improper, and set the polynomial part aside.
  2. Factor the denominator completely.
  3. Write the form: one term per linear factor, one term per power of a repeated factor, and a linear numerator over each irreducible quadratic.
  4. Solve for the constants by multiplying through by the denominator, then plugging in roots and comparing coefficients.
  5. Integrate each piece and add the results.

Before integrating, it pays to check the constants. Pick any convenient \( x \) that is not a root, such as \( x = 1 \) or \( x = 2 \), and confirm that the original fraction and your sum of pieces give the same number. It takes ten seconds and catches almost every arithmetic slip.

An open math textbook, pen, and grid notebook

Case 1: distinct linear factors

Each factor \( (x - a) \) gets a term \( \frac{A}{x - a} \).

Wooden puzzle with one piece lifted from its matching spot

\( \int\frac{3x+5}{(x+1)(x+3)}\,dx \).

$$\frac{3x+5}{(x+1)(x+3)} = \frac{A}{x+1} + \frac{B}{x+3} quadLongrightarrowquad 3x + 5 = A(x+3) + B(x+1)$$

Cover-up trick: set \( x = -1 \): \( 2 = 2A \), so \( A = 1 \). Set \( x = -3 \): \( -4 = -2B \), so \( B = 2 \). Then

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

Quick check at \( x = 1 \): the original fraction is \( \frac{8}{2\cdot4} = 1 \), and the pieces give \( \frac12 + \frac24 = 1 \). The constants are right.

Why plug in \( x = -1 \)? The original fraction is undefined there. But after clearing denominators, \( 3x + 5 = A(x+3) + B(x+1) \) is a polynomial identity. Two polynomials agreeing for all \( x \) except \( -1 \) and \( -3 \) must agree everywhere. This applies to partial fraction decomposition.

Classic: \( \frac{1}{x^2 - 1} = \frac{1/2}{x-1} - \frac{1/2}{x+1} \), so

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

Example: factor first. For \( \int\frac{3\,dx}{x^2 + x - 2} \), first factor the denominator as \( (x-1)(x+2) \). Cover-up at \( x = 1 \) gives \( A = \frac{3}{3} = 1 \), and at \( x = -2 \) gives \( B = \frac{3}{-3} = -1 \). So the integral is \( \ln|x-1| - \ln|x+2| + C \).

Case 2: repeated linear factors

A factor \( (x - a)^k \) needs \( k \) terms: \( \frac{A_1}{x-a} + \frac{A_2}{(x-a)^2} + \dots + \frac{A_k}{(x-a)^k} \).

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

Clearing denominators: \( 1 = A(x+1)^2 + Bx(x+1) + Cx \). With \( x = 0 \): \( A = 1 \). With \( x = -1 \): \( C = -1 \). Comparing \( x^2 \) coefficients: \( A + B = 0 \), so \( B = -1 \).

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

Notice that the plug-in trick found two of the three constants, and comparing one coefficient found the last. Mixing the two methods is usually the fastest route.

Case 3: irreducible quadratic factors

A factor like \( x^2 + 1 \) gets a linear numerator: \( \frac{Bx + C}{x^2+1} \).

A man pointing at a blank green chalkboard

\( \frac{1}{x(x^2+1)} = \frac{A}{x} + \frac{Bx + C}{x^2+1} \). Clearing denominators gives \( 1 = A(x^2+1) + (Bx + C)x \). Setting \( x = 0 \) kills the second term. This leaves \( A = 1 \). There is no other real root to plug in for partial fraction decomposition. So, compare coefficients instead. The \( x^2 \) terms give \( 0 = A + B \), so \( B = -1 \). The \( x \) terms give \( 0 = C \). With \( A = 1, B = -1, C = 0 \):

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

Quadratic pieces integrate to a log (via u-substitution) plus an arctangent (see derivative of arctan x).

Example with an arctangent. Decompose \( \frac{2x^2 + 2x + 2}{(x+1)(x^2+1)} = \frac{A}{x+1} + \frac{Bx + C}{x^2+1} \). Clearing denominators,

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

At \( x = -1 \): \( 2 = 2A \), so \( A = 1 \). Comparing \( x^2 \) coefficients, \( 2 = A + B \), so \( B = 1 \). Comparing constants, \( 2 = A + C \), so \( C = 1 \). The quadratic piece \( \frac{x + 1}{x^2+1} \) splits into \( \frac{x}{x^2+1} \), which gives a log, and \( \frac{1}{x^2+1} \), which gives an arctangent:

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

Completing the square. If the irreducible quadratic is not of the form \( x^2 + a^2 \), complete the square first. For example \( x^2 + 2x + 5 = (x+1)^2 + 4 \), so

$$\int\frac{dx}{x^2+2x+5} = \frac12\arctan\frac{x+1}{2} + C$$

Improper fractions require partial fraction decomposition

For \( \int\frac{x^2}{x^2-1}\,dx \), the degrees are equal, so divide: \( \frac{x^2}{x^2-1} = 1 + \frac{1}{x^2-1} \). The polynomial part integrates directly and the remainder is the classic example above:

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

Sometimes the remainder is simpler than you expect. Dividing \( x^3 + x \) by \( x^2 - 1 \) gives \( x + \frac{2x}{x^2-1} \), and the remainder’s numerator is exactly the derivative of its denominator, so \( \int\frac{x^3+x}{x^2-1}dx = \frac{x^2}{2} + \ln|x^2-1| + C \) with no decomposition needed at all.

Summary table

Denominator factor Partial fraction terms
\( (x - a) \) \( \frac{A}{x-a} \)
\( (x - a)^2 \) \( \frac{A}{x-a} + \frac{B}{(x-a)^2} \)
\( x^2 + bx + c \) (irreducible) \( \frac{Bx + C}{x^2 + bx + c} \)

Common mistakes

  • Skipping the division step. Decomposing \( \frac{x^2}{x^2-1} \) as \( \frac{A}{x-1} + \frac{B}{x+1} \) cannot work, because the right side is always proper. Divide first.
  • Using one term for a repeated factor. \( (x+1)^2 \) needs both \( \frac{B}{x+1} \) and \( \frac{C}{(x+1)^2} \), not just one of them.
  • A constant numerator over a quadratic. Over \( x^2 + 1 \) you need \( Bx + C \), not just \( C \). Using too few unknowns makes the system unsolvable.
  • Treating a reducible quadratic as irreducible. \( x^2 - 4 = (x-2)(x+2) \) factors, so it gets two linear terms. Check the discriminant: \( x^2 + bx + c \) is irreducible only when \( b^2 - 4c < 0 \).
  • Losing absolute values. \( \int\frac{dx}{x-a} = \ln|x - a| + C \), with the bars.

Where it’s used

Partial fractions is the reason the integral of sec x can be derived from scratch, since one approach rewrites it as \( \int\frac{\cos x}{1 - \sin^2 x}dx \). It appears in improper integrals of rational functions, in solving the logistic differential equation, and in telescoping series: because \( \frac{1}{n(n+1)} = \frac1n - \frac{1}{n+1} \), the sum \( \frac{1}{1\cdot2} + \frac{1}{2\cdot3} + \frac{1}{3\cdot4} + \frac{1}{4\cdot5} \) collapses to \( 1 - \frac15 \). Engineers use the same decomposition to invert Laplace transforms.

Check a definite integral

Step-by-step solverExact symbolic engine

Interactive Calculus Problem Solver

Derivatives, antiderivatives, definite and improper integrals, and limits. Every answer comes with the rules used, and antiderivatives are verified by differentiating them back.

Try:
Input syntax
  • Powers x^2, roots sqrt(x), cbrt(x), absolute value |x|
  • Implicit multiplication works: 3x sin(2x)
  • sin cos tan sec csc cot, asin acos atan, sinh cosh tanh
  • e^x or exp(x); ln(x) is the natural log. In this solver log(x) also means the natural log (the usual calculus convention); type log10(x) for base 10
  • Constants pi and e; bounds accept inf and -inf
Enter a function and press Solve to see a full worked solution.

The integral calculator shows the full decomposition for indefinite integrals, and the definite integral calculator evaluates them between limits.

A hand typing on a laptop beside a notebook and phone

Practice problems

Try these before checking the answers.

A hand holding a pencil next to colored pencils on black paper
  1. \( \int\frac{dx}{x(x - 2)} \)
  2. \( \int\frac{5x - 1}{(x-1)(x+1)}\,dx \)
  3. \( \int_0^1\frac{dx}{(x+1)(x+2)} \)
  4. \( \int\frac{x + 1}{x^2(x-1)}\,dx \)
  5. \( \int\frac{dx}{x^2 + 2x + 5} \)

Answers: (1) \( \frac12\ln\left|\frac{x-2}{x}\right| + C \); (2) \( 2\ln|x-1| + 3\ln|x+1| + C \); (3) \( \ln\frac43 \); (4) \( -2\ln|x| + \frac1x + 2\ln|x-1| + C \); (5) \( \frac12\arctan\frac{x+1}{2} + C \).

For (4), the form is \( \frac{A}{x} + \frac{B}{x^2} + \frac{C}{x-1} \). Cover-up gives \( B = -1 \) and \( C = 2 \), and matching the \( x^2 \) coefficients gives \( A + C = 0 \), so \( A = -2 \).

FAQ

What if the numerator’s degree is too high?

Divide first. For example, \( \frac{x^2}{x^2 - 1} = 1 + \frac{1}{x^2 - 1} \).

Is there a faster way to find the constants?

The cover-up method handles distinct linear factors instantly. For the rest, substitute convenient \( x \)-values or compare coefficients.

How do I know if a quadratic factor is irreducible?

Compute its discriminant. If \( b^2 - 4ac < 0 \), it has no real roots and cannot be factored over the reals, so it gets a linear numerator. If the discriminant is zero or positive, factor it into linear pieces.

When should I not use partial fractions?

A simpler method may work. If the numerator is a multiple of the denominator’s derivative, use a single substitution. This finishes the job. If the integrand is not a rational function, partial fraction decomposition does not apply directly. It may contain roots, logs or trig functions. Try integration by parts or a substitution first.

Can I use partial fractions on a definite integral?

Yes. Decompose and integrate. Use partial fraction decomposition for this. Evaluate the antiderivative at the two limits. Combine logarithms at the end. For example, \( \ln\frac43 \) gives the neatest answer. Make sure the interval has no denominator root. If it does, the integral is improper. It then needs a limit.

Further reading

Calculators for this topic

Get new calculus guides by email

Free worked examples and new calculators, at most once a day. Unsubscribe with one click.

Leave a comment

Your email address will not be published. Required fields are marked *