Unit 5, lesson 56

Integration of Rational Functions

How to integrate any quotient of polynomials by dividing first when needed, splitting into partial fractions, and integrating each simple piece on intervals where the denominator is not zero.

  • Theory part 111
  • Practice part 112
  • Integration Techniques

Theory, part 111

Practice, part 112

A fraction like 5x−3x2−2x−3\frac{5x - 3}{x^2 - 2x - 3} looks hard to integrate. Yet it splits as

5x−3x2−2x−3=2x+1+3x−3,\frac{5x - 3}{x^2 - 2x - 3} = \frac{2}{x + 1} + \frac{3}{x - 3},

and each of those integrates to a logarithm at once. The method of partial fractions finds such splittings for every rational function, so every rational function can be integrated with polynomials, rational functions, logarithms and arctangents.

Key terms

Proper and improper rational functions

Definition A rational function is a quotient P(x)Q(x)\frac{P(x)}{Q(x)} of polynomials with QQ not the zero polynomial. It is proper if deg⁡P<deg⁡Q\deg P < \deg Q and improper if deg⁡P≥deg⁡Q\deg P \ge \deg Q.

In plain words A proper rational function has a top of lower degree than its bottom, like a proper fraction such as 27\frac{2}{7}. Partial fractions only work on proper ones.

Example The function x+4x2+1\frac{x + 4}{x^2 + 1} is proper. The function x3+xx−1\frac{x^3 + x}{x - 1} is improper, with degrees 33 and 11, and so is x2x2+1\frac{x^2}{x^2 + 1}.

Polynomial division

Definition For polynomials PP and QQ with QQ not zero, there are unique polynomials SS and RR with

P(x)=S(x) Q(x)+R(x),R=0 or deg⁡R<deg⁡Q.P(x) = S(x) \, Q(x) + R(x), \qquad R = 0 \ \text{or} \ \deg R < \deg Q.

Then PQ=S+RQ\frac{P}{Q} = S + \frac{R}{Q} at every xx with Q(x)≠0Q(x) \neq 0, where SS is a polynomial and RQ\frac{R}{Q} is proper.

In plain words Long division splits an improper fraction into a polynomial, which is easy to integrate, plus a proper remainder fraction.

Example Dividing x3+xx^3 + x by x−1x - 1 gives

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

So on each interval where x≠1x \neq 1

∫x3+xx−1 dx=∫(x2+x+2+2x−1)dx=x33+x22+2x+2ln⁡∣x−1∣+C.\int \frac{x^3 + x}{x - 1} \, dx = \int \left( x^2 + x + 2 + \frac{2}{x - 1} \right) dx = \frac{x^3}{3} + \frac{x^2}{2} + 2x + 2 \ln \lvert x - 1 \rvert + C.

Partial fraction decomposition

Definition Every nonconstant polynomial QQ with real coefficients factors into a constant times linear factors (ax+b)(ax + b) with a≠0a \neq 0 and irreducible quadratic factors (ax2+bx+c)(ax^2 + bx + c) with a≠0a \neq 0 and b2−4ac<0b^2 - 4ac < 0. If PQ\frac{P}{Q} is proper, it equals a sum of partial fractions, uniquely determined, made of the following terms. Each linear factor (ax+b)(ax + b) appearing exactly to the power rr contributes

A1ax+b+A2(ax+b)2+⋯+Ar(ax+b)r.\frac{A_1}{ax + b} + \frac{A_2}{(ax + b)^2} + \cdots + \frac{A_r}{(ax + b)^r}.

Each irreducible quadratic factor (ax2+bx+c)(ax^2 + bx + c) appearing exactly to the power ss contributes

B1x+C1ax2+bx+c+⋯+Bsx+Cs(ax2+bx+c)s.\frac{B_1 x + C_1}{ax^2 + bx + c} + \cdots + \frac{B_s x + C_s}{(ax^2 + bx + c)^s}.

The AiA_i, BjB_j and CjC_j are real constants.

In plain words Factor the denominator, write one simple fraction for each factor (and for each of its powers), then find the unknown numerators.

Example The denominator x2−1=(x−1)(x+1)x^2 - 1 = (x - 1)(x + 1) has two distinct linear factors, and

1x2−1=1/2x−1−1/2x+1,∫dxx2−1=12ln⁡∣x−1x+1∣+C.\frac{1}{x^2 - 1} = \frac{1/2}{x - 1} - \frac{1/2}{x + 1}, \qquad \int \frac{dx}{x^2 - 1} = \frac{1}{2} \ln \left\lvert \frac{x - 1}{x + 1} \right\rvert + C.

Coefficient matching

Definition To find the constants, multiply both sides of the decomposition by Q(x)Q(x). This gives an identity between two polynomials that holds for all xx (first for xx with Q(x)≠0Q(x) \neq 0, then for all xx by continuity). Two polynomials are equal for all xx exactly when the coefficients of each power of xx agree. Equating coefficients, or substituting convenient values of xx such as the roots of QQ, gives linear equations for the constants.

In plain words Clear the denominators, then either compare the coefficients on both sides or plug in numbers that make terms vanish.

Example Write

5x−3(x+1)(x−3)=Ax+1+Bx−3.\frac{5x - 3}{(x + 1)(x - 3)} = \frac{A}{x + 1} + \frac{B}{x - 3}.

Clearing denominators gives

5x−3=A(x−3)+B(x+1).5x - 3 = A(x - 3) + B(x + 1).

Matching the xx coefficients gives A+B=5A + B = 5 and matching constants gives −3A+B=−3-3A + B = -3. Subtracting, 4A=84A = 8, so A=2A = 2 and B=3B = 3. As a check, x=3x = 3 gives 12=4B12 = 4B and x=−1x = -1 gives −8=−4A-8 = -4A. So

∫5x−3(x+1)(x−3) dx=2ln⁡∣x+1∣+3ln⁡∣x−3∣+C.\int \frac{5x - 3}{(x + 1)(x - 3)} \, dx = 2 \ln \lvert x + 1 \rvert + 3 \ln \lvert x - 3 \rvert + C.

Repeated linear factors

Definition A linear factor (ax+b)(ax + b) that appears to the power r≥2r \ge 2 needs all rr terms Ak(ax+b)k\frac{A_k}{(ax + b)^k} for k=1,…,rk = 1, \ldots, r. For k≥2k \ge 2 they integrate to powers,

∫dx(ax+b)k=−1a(k−1)(ax+b)k−1+C,a≠0.\int \frac{dx}{(ax + b)^k} = -\frac{1}{a(k - 1)(ax + b)^{k - 1}} + C, \qquad a \neq 0.

In plain words A squared factor needs two fractions, one over the factor and one over its square. Leaving out the lower power usually makes the coefficients impossible to match.

Example For 4x2(x−2)\frac{4}{x^2(x - 2)} write

4x2(x−2)=Ax+Bx2+Cx−2,\frac{4}{x^2(x - 2)} = \frac{A}{x} + \frac{B}{x^2} + \frac{C}{x - 2},

so 4=Ax(x−2)+B(x−2)+Cx24 = Ax(x - 2) + B(x - 2) + Cx^2. Setting x=0x = 0 gives B=−2B = -2, setting x=2x = 2 gives C=1C = 1, and the x2x^2 coefficients give A+C=0A + C = 0, so A=−1A = -1.

∫4x2(x−2) dx=−ln⁡∣x∣+2x+ln⁡∣x−2∣+C.\int \frac{4}{x^2(x - 2)} \, dx = -\ln \lvert x \rvert + \frac{2}{x} + \ln \lvert x - 2 \rvert + C.

Irreducible quadratic factors

Definition A quadratic ax2+bx+cax^2 + bx + c with real coefficients is irreducible over the reals when b2−4ac<0b^2 - 4ac < 0, so it has no real roots. Its partial fractions have linear numerators Bx+CBx + C. A term over the first power of the quadratic is integrated by splitting off a multiple of the derivative of the quadratic, which gives a logarithm, and completing the square in the rest, which gives an arctangent by

∫dxx2+k2=1karctan⁡xk+C,k>0.\int \frac{dx}{x^2 + k^2} = \frac{1}{k} \arctan \frac{x}{k} + C, \qquad k > 0.

In plain words A quadratic that cannot be factored gets a numerator of the form Bx+CBx + C. Its integral is a logarithm part plus an arctangent part.

Example Write

1x(x2+1)=Ax+Bx+Cx2+1.\frac{1}{x(x^2 + 1)} = \frac{A}{x} + \frac{Bx + C}{x^2 + 1}.

Clearing denominators gives 1=A(x2+1)+(Bx+C)x1 = A(x^2 + 1) + (Bx + C)x. Then x=0x = 0 gives A=1A = 1, the x2x^2 coefficients give A+B=0A + B = 0, so B=−1B = -1, and the xx coefficients give C=0C = 0.

∫dxx(x2+1)=∫(1x−xx2+1)dx=ln⁡∣x∣−12ln⁡(x2+1)+C.\int \frac{dx}{x(x^2 + 1)} = \int \left( \frac{1}{x} - \frac{x}{x^2 + 1} \right) dx = \ln \lvert x \rvert - \frac{1}{2} \ln(x^2 + 1) + C.

Real-domain intervals

Definition An antiderivative of PQ\frac{P}{Q} found this way is valid on each open interval on which QQ has no zero. On different such intervals the constants of integration may differ. Suppose PQ\frac{P}{Q} is in lowest terms, so PP and QQ have no common factor. A definite integral ∫abP(x)Q(x) dx\int_a^b \frac{P(x)}{Q(x)} \, dx can be evaluated with the fundamental theorem only if QQ has no zero in [a,b][a, b]. Otherwise the integral is improper and needs separate treatment.

In plain words The logarithms carry absolute values so the answer works on both sides of each zero of the denominator. But you may never integrate across a zero of the denominator by plugging in.

Example On [2,3][2, 3] the function 1x2−1\frac{1}{x^2 - 1} is continuous, so

∫23dxx2−1=12(ln⁡24−ln⁡13)=12ln⁡32≈0.203.\int_2^3 \frac{dx}{x^2 - 1} = \frac{1}{2} \left( \ln \frac{2}{4} - \ln \frac{1}{3} \right) = \frac{1}{2} \ln \frac{3}{2} \approx 0.203.

The same formula cannot be used on [0,2][0, 2], which contains the zero x=1x = 1 of the denominator.

Check yourself

  1. Find ∫dxx2+2x+5\int \frac{dx}{x^2 + 2x + 5}.
Show the answer

Completing the square gives x2+2x+5=(x+1)2+4x^2 + 2x + 5 = (x + 1)^2 + 4, which has no real roots. With u=x+1u = x + 1 and k=2k = 2 the result is

∫dxx2+2x+5=12arctan⁡x+12+C.\int \frac{dx}{x^2 + 2x + 5} = \frac{1}{2} \arctan \frac{x + 1}{2} + C.
  1. Find ∫x2x+1 dx\int \frac{x^2}{x + 1} \, dx.
Show the answer

Division gives x2=(x+1)(x−1)+1x^2 = (x + 1)(x - 1) + 1, so the integrand is x−1+1x+1x - 1 + \frac{1}{x + 1} and

∫x2x+1 dx=x22−x+ln⁡∣x+1∣+C.\int \frac{x^2}{x + 1} \, dx = \frac{x^2}{2} - x + \ln \lvert x + 1 \rvert + C.
  1. Evaluate ∫015x−3(x+1)(x−3) dx\int_0^1 \frac{5x - 3}{(x + 1)(x - 3)} \, dx.
Show the answer

The denominator has no zero in [0,1][0, 1]. Using the decomposition from above, the value is

[2ln⁡∣x+1∣+3ln⁡∣x−3∣]01=2ln⁡2+3ln⁡2−3ln⁡3=5ln⁡2−3ln⁡3≈0.170.\Big[ 2 \ln \lvert x + 1 \rvert + 3 \ln \lvert x - 3 \rvert \Big]_0^1 = 2\ln 2 + 3 \ln 2 - 3 \ln 3 = 5 \ln 2 - 3 \ln 3 \approx 0.170.

How this lesson connects

It also uses partial fractions and logarithms.