Ma · Mathematics

How to Integrate a Complicated Rational Function

Published By the 9to5Science editorial team

At a glance

  1. 1. Check the degrees

    If the numerator’s degree is at least the denominator’s, use polynomial long division first.

  2. 2. Factor the denominator

    Factor it into linear factors and irreducible quadratic factors over the real numbers.

  3. 3. Set up fractions

    Use partial fractions, including every power of each repeated factor.

  4. 4. Integrate each term

    Apply logarithms, powers, and inverse tangent formulas, then add the constant.

An integral of a polynomial divided by another polynomial is called a rational-function integral. The expression may look complicated, but a reliable method breaks it into simpler pieces that have standard antiderivatives.

The main steps are to check the degrees, divide if necessary, factor the denominator, and use partial fractions. The exact decomposition depends on the denominator’s factors, so there is no single formula that fits every rational function.

1. Make the fraction proper

A rational function is proper when the degree of its numerator is less than the degree of its denominator. If it is not proper, use polynomial long division:

P(x)Q(x)=S(x)+R(x)Q(x),\frac{P(x)}{Q(x)}=S(x)+\frac{R(x)}{Q(x)},

where S(x)S(x) is a polynomial and deg⁡R<deg⁡Q\deg R<\deg Q. Integrate S(x)S(x) directly, then work on the proper fraction.

For example, the degree of x3+2x2+3x+4x^3+2x^2+3x+4 equals the degree of (x−1)(x+2)2(x-1)(x+2)^2, so division is needed before partial fractions.

2. Factor the denominator and choose a decomposition

Factor the denominator over the real numbers. The factors determine the partial-fraction terms:

  • For a linear factor x−ax-a appearing once, include A/(x−a)A/(x-a).
  • For a repeated factor (x−a)n(x-a)^n, include every power: A1/(x−a)+A2/(x−a)2+⋯+An/(x−a)nA_1/(x-a)+A_2/(x-a)^2+\cdots+A_n/(x-a)^n.
  • For an irreducible quadratic x2+px+qx^2+px+q, include a numerator of the form Bx+CBx+C. If it is repeated, include such a term over every power of the quadratic.

The numerator over an irreducible quadratic must be linear so the decomposition has enough flexibility to match the original numerator. After writing the terms, find their constants by combining the fractions and matching coefficients, or by substituting convenient values of xx when possible.

3. Work through an example

Evaluate

∫x3+2x2+3x+4(x−1)(x+2)2 dx.\int \frac{x^3+2x^2+3x+4}{(x-1)(x+2)^2}\,dx.

First expand the denominator:

(x−1)(x+2)2=x3+3x2−4.(x-1)(x+2)^2=x^3+3x^2-4.

Long division gives

x3+2x2+3x+4(x−1)(x+2)2=1+−x2+3x+8(x−1)(x+2)2.\frac{x^3+2x^2+3x+4}{(x-1)(x+2)^2} =1+\frac{-x^2+3x+8}{(x-1)(x+2)^2}.

The denominator has a linear factor and a repeated linear factor. Set up the partial fractions as

−x2+3x+8(x−1)(x+2)2=Ax−1+Bx+2+C(x+2)2.\frac{-x^2+3x+8}{(x-1)(x+2)^2} =\frac{A}{x-1}+\frac{B}{x+2}+\frac{C}{(x+2)^2}.

Multiplying by (x−1)(x+2)2(x-1)(x+2)^2 gives

−x2+3x+8=A(x+2)2+B(x−1)(x+2)+C(x−1).-x^2+3x+8=A(x+2)^2+B(x-1)(x+2)+C(x-1).

Substituting x=1x=1 gives 10=9A10=9A, so A=10/9A=10/9. Substituting x=−2x=-2 gives −2=−3C-2=-3C, so C=2/3C=2/3. Comparing the coefficient of x2x^2 gives A+B=−1A+B=-1, so B=−19/9B=-19/9.

Thus

x3+2x2+3x+4(x−1)(x+2)2=1+109(x−1)−199(x+2)+23(x+2)2.\frac{x^3+2x^2+3x+4}{(x-1)(x+2)^2} =1+\frac{10}{9(x-1)}-\frac{19}{9(x+2)}+\frac{2}{3(x+2)^2}.

Integrate term by term:

∫x3+2x2+3x+4(x−1)(x+2)2 dx=x+109ln⁡∣x−1∣−199ln⁡∣x+2∣−23(x+2)+C.\begin{aligned} \int \frac{x^3+2x^2+3x+4}{(x-1)(x+2)^2}\,dx &=x+\frac{10}{9}\ln|x-1|-\frac{19}{9}\ln|x+2|-\frac{2}{3(x+2)}+C. \end{aligned}

The last term follows from ∫(x+2)−2 dx=−(x+2)−1\int (x+2)^{-2}\,dx=-(x+2)^{-1}. The logarithms use absolute values because their arguments may be negative.

4. Recognize the standard antiderivatives

Once the decomposition is correct, the individual terms are usually straightforward:

∫1x−a dx=ln⁡∣x−a∣+C,∫1(x−a)n dx=(x−a)1−n1−n+C(n≠1).\int \frac{1}{x-a}\,dx=\ln|x-a|+C, \qquad \int \frac{1}{(x-a)^n}\,dx=\frac{(x-a)^{1-n}}{1-n}+C \quad (n\ne 1).

For an irreducible quadratic, split a linear numerator into a multiple of the derivative of the denominator plus a constant. For instance,

∫2x+3x2+2x+5 dx=ln⁡(x2+2x+5)+12arctan⁡ ⁣(x+12)+C.\int \frac{2x+3}{x^2+2x+5}\,dx =\ln(x^2+2x+5)+\frac{1}{2}\arctan\!\left(\frac{x+1}{2}\right)+C.

Here 2x+3=(2x+2)+12x+3=(2x+2)+1, and completing the square gives x2+2x+5=(x+1)2+4x^2+2x+5=(x+1)^2+4. The first part integrates to a logarithm; the second becomes an inverse tangent after scaling.

Common mistakes

  • Skipping long division: Partial fractions in the usual form apply to a proper fraction. Divide first when the numerator’s degree is not smaller.
  • Omitting repeated-factor terms: A denominator containing (x+2)2(x+2)^2 needs terms over both x+2x+2 and (x+2)2(x+2)^2.
  • Using a constant over a quadratic: An irreducible quadratic generally needs a linear numerator, such as (Bx+C)/(x2+px+q)(Bx+C)/(x^2+px+q).
  • Losing a sign or coefficient: Verify the decomposition by recombining it, or differentiate the final antiderivative and compare with the integrand.
  • Forgetting the domain: The antiderivative is valid on intervals that do not cross points where the original denominator is zero. Include absolute values in logarithms of linear factors.

If the denominator has factors that do not split into real linear factors, complete the square in irreducible quadratics and use the logarithm and inverse-tangent forms. For some rational functions, a substitution can simplify the expression first, but long division followed by partial fractions is the standard general approach.

References

  1. OpenStax, Calculus Volume 2, Section 3.4: Partial Fractions

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.