CHAPTER 1 Techniques of Integration III: Rational Functions

In this section we treat integration of rational functions. A “rational function” is a fraction with polynomials in the numerator and denominator. For example,

\frac{x^{3}}{x^{2} + x − 6},  \frac{1}{(x − 3)^{2}} ,  \frac{x^{2} + 1}{x^{2} − 1}

are all rational functions of x. There is a general technique called “ partial fractions” for integrating a rational function. The algebraic steps in that technique are rather cumbersome if the polynomial in the denominator has degree more than 2 (except in the case when the denominator has the form (ax + b)^{n}, a case we shall treat below). However, in practice one does not often run across rational functions with high degree polynomials in the denominator for which one has to find the antiderivative function. So we shall explain how to find the antiderivative of a rational function only in the two cases which are most frequently encountered: (a) the denominator has the form (ax+b)^{n}; (b) the denominator is a quadratic polynomial ax^{2} + bx + c.

In the case when the denominator has the form (ax + b)^{n}, the u-substitution u = ax + b will always work. Just replace the denominator by u^{n}, replace x in the numerator by (u − b)/a, and replace dx by \frac{1}{a}du.

Example 1.1. Find

∫_{0}^{1} \frac{t^{3}dt}{(3 − 2t)^{2}} .

We set u = 3 − 2t, so that t = (3 − u)/2, dt = −\frac{1}{2}du. The limits of integration change: t = 0 ⟹ u = 3, and t = 1 ⟹ u = 1. So we obtain:

−\frac{1}{2} ∫_{3}^{1} (\frac{3 − u}{2})^{3} \frac{du}{u^{2}} = −\frac{1}{16} ∫_{3}^{1} \frac{(3 − u)^{3}}{u^{2}} du = \frac{1}{16} ∫_{1}^{3} \frac{27 − 27u + 9u^{2} − u^{3}}{u^{2}} du

= \frac{1}{16} ∫_{1}^{3} (\frac{27}{u^{2}} − \frac{27}{u} + 9 − u) du

= \frac{1}{16} (−\frac{27}{u} − 27 ln u + 9u − \frac{1}{2}u^{2}) |_{1}^{3}= 2 − \frac{27}{16} ln 3.

We now proceed to the case when the denominator is a quadratic polynomial. We can always factor out the coefficient of x^{2} and put it outside the integral. This will lead to a denominator in which x^{2} has coefficient 1, i.e., a denominator of the form x^{2} + bx + c. There are three possible cases, depending on how many real roots the quadratic has. Recall the quadratic formula used to solve ax^{2} + bx + c = 0, which when a = 1 takes the form r_{1}, r_{2} = (−b±\sqrt{b^{2} − 4c})/2. The sign of the discriminant b^{2} −4c tells us whether there is (a) 1 double root (when the discriminant is 0), (b) two distinct roots (when the discriminant is positive), or (c) no real roots (when the discriminant is negative). In the first case, the denominator takes the form (x − r)^{2}, and we can integrate the rational function by the method explained above (substituting u = x − r). The remainder of this section is concerned with the other two possibilities.

1. Quadratic Denominator That Factors

We first make an algebraic observation about what happens when we subtract as follows:

\frac{1}{x − r_{1}} − \frac{1}{x − r_{2}} = \frac{1}{x − r_{1}} · \frac{x − r_{2}}{x − r_{2}} − \frac{1}{x − r_{2}} · \frac{x − r_{1}}{x − r_{1}} = \frac{r_{1} − r_{2}}{(x − r_{1})(x − r_{2})}.

We shall use this in the reverse order: instead of combining 1/(x − r_{1}) and 1/(x − r_{2}) into a single fraction, we shall split up 1/(x−r_{1})(x−r_{2}) into a difference of two fractions. Namely, we divide through by r_{1} − r_{2} in the above equality:

\frac{1}{(x − r_{1})(x − r_{2})} = \frac{1}{r_{1} − r_{2}} (\frac{1}{x − r_{1}} − \frac{1}{x − r_{2}} ) .

This basic algebraic identity will allow us to split up our integral into two separate integrals, in each of which the denominator has the simpler form x − r. Here are some examples.

Example 1.2. Find

∫_{1}^{∞} \frac{dx}{2x^{2} + x}.

Since 2x^{2} + x = 2(x^{2} + 0.5) = 2(x − 0)(x − (−0.5)), we take r_{1} = 0, r_{2} = −0.5. Then

\frac{1}{2x^{2} + x} = \frac{1}{2} · \frac{1}{x^{2} + 0.5} = \frac{1}{2} · \frac{1}{0 − (−0.5)} (\frac{1}{x − 0} − \frac{1}{x − (−0.5)}) = (\frac{1}{x} − \frac{1}{x + 0.5}) .

Thus, our integral is

∫_{1}^{∞} (\frac{1}{x} − \frac{1}{x + 0.5}) dx = (ln x − ln(x + 0.5)) |_{1}^{∞} .

(We used the formula ∫ dx/(ax + b) = \frac{1}{a} ln |ax + b| + C, and we omitted the absolute value signs, because both x and x + 0.5 are positive between 1 and ∞.) To evaluate this antiderivative at ∞ means to take the limit of ln b − ln(b + 0.5) as b ⟶ ∞. Both ln b and ln(b + 0.5) approach ∞, so we have the indeterminate form ∞ − ∞. Write ln b − ln(b + 0.5) = ln (\frac{b}{b+0.5}). Notice that b/(b + 0.5) has limit 1 as b ⟶ ∞. Thus, its ln has limit ln 1 = 0. In other words, evaluating ln x − ln(x + 0.5) at ∞ gives 0. Thus, we conclude that ∫_{1}^{∞} dx/(2x^{2} + x) = −(ln 1 − ln 1.5) = ln 1.5.

Example 1.3. Find the x-coordinate of the center of mass of the uniform flat plate bounded by the x- and y-axes, the line x = 2, and the curve y = 1/(9 − x^{2}).

Here \overline{x} is the ratio of the integral ∫_{0}^{2} x dx/(9−x^{2}) to the integral ∫_{0}^{2} dx/(9−x^{2}). We first factor out the coefficient of x^{2}, which is −1, and write 9−x^{2} = −(x^{2} −9) = −(x+3)(x−3). Thus,

\frac{1}{9 − x^{2}} = −\frac{1}{(x − (−3))(x − 3)} = −\frac{1}{(−3) − 3} (\frac{1}{x − (−3)} − \frac{1}{x − 3})

= \frac{1}{6} (\frac{1}{x + 3} − \frac{1}{x − 3}) .

So the bottom integral is

\frac{1}{6} ∫_{0}^{2} (\frac{1}{x + 3} − \frac{1}{x − 3}) dx = \frac{1}{6} (ln(x + 3) − ln |x − 3|) |_{0}^{2} .

(We need absolute values because x − 3 is negative for x between 0 and 2.) The result is \frac{1}{6} ln 5.

The top integral is the same, except with an x, i.e.,

\frac{1}{6} ∫_{0}^{2} (\frac{x}{x + 3} − \frac{x}{x − 3}) dx,

and we could integrate each of these terms without difficulty. However, in this particular integral there happens to be an easier way: notice that in the original integral ∫_{0}^{2} x dx/(9 − x^{2}) the derivative of 9 − x^{2} is essentially what we have in the numerator. Hence, it is more efficient simply to substitute u = 9 − x^{2}, thereby transforming the top integral as follows (du = −2x dx, and the limits of integration become 9 − 0^{2} = 9 to 9 − 2^{2} = 5):

−\frac{1}{2} ∫_{9}^{5} \frac{du}{u} = −\frac{1}{2}(ln 5 − ln 9) = \frac{1}{2}(ln 9 − ln 5) = \frac{1}{2} ln 1.8.

Finally, \overline{x} = \frac{1}{2} ln 1.8 / \frac{1}{6} ln 5 = 3 ln 1.8/ ln 5 = 1.0956.

Example 1.4. Find the antiderivative of x^{4}/(x^{2} − x − 2).

If the numerator has degree 2 or more, then you can simplify the integral by first performing a long division of polynomials. In this case you get x^{4} divided by x^{2} − x − 2 is x^{2} + x + 3 with a remainder of 5x + 6. Thus, the integral is

∫ (x^{2} + x + 3 + \frac{5x + 6}{x^{2} − x − 2}) dx.

To handle the fraction, we factor x^{2}−x−2 = (x−2)(x+1). (If you can’t see the factorization by inspection, then use the quadratic formula to determine the roots, which in this case are 2 and −1.) Then

\frac{5x + 6}{x^{2} − x − 2} = (5x + 6) · \frac{1}{2 − (−1)} (\frac{1}{x − 2} − \frac{1}{x + 1}) = \frac{1}{3} (\frac{5x + 6}{x − 2} − \frac{5x + 6}{x + 1}) .

Thus, the problem boils down to integrating (5x + 6)/(x − 2) and (5x + 6)/(x + 1). These integrals are done by the method described at the beginning of this section. For example, substituting u = x − 2 in the first integral, we have:

∫ \frac{5x + 6}{x − 2} dx = ∫ \frac{5(u + 2) + 6}{u}du = ∫ (5 + \frac{16}{u}) du
= 5u + 16 ln |u| + C = 5(x − 2) + 16 ln |x − 2| + C.

The integral of (5x + 6)/(x + 1) is similar.

2. Quadratic Denominator That Does Not Factor

As a preliminary procedure, we first factor out the coefficient of x^{2}, so that the quadratic denominator has the form x^{2} + bx + c. If the numerator has degree 2 or greater, we then use long division of polynomials to write our rational function in the form

polynomial + \frac{αx + β}{x^{2} + bx + c}.

Next, we “complete the square” in the denominator: x^{2} + bx + c = (x + \frac{1}{2}b)^{2} + (c − \frac{1}{4}b^{2}),

and we set r = \sqrt{c − \frac{1}{4}b^{2}}, so that x^{2} + bx + c = (x + \frac{1}{2}b)^{2} + r^{2}. After a u-substitution of the form u = x + \frac{1}{2}b, we can transform the integral to a sum of two integrals of the form

∫ \frac{u du}{u^{2} + r^{2}} = \frac{1}{2} ln(u^{2} + r^{2}) + C,  and  ∫ \frac{du}{u^{2} + r^{2}} = \frac{1}{r}Arctan (\frac{u}{r}) + C.

We illustrate with two examples. In Example 14.5 we will already have the denominator in the form x^{2} + 1, so we do not make a u-substitution. In Example 14.6 we will have to do some algebra to get the integral in the two standard forms ∫ u du/(u^{2} + r^{2}) and ∫ du/(u^{2} + r^{2}).

Example 1.5. Integrating x^{n}Arctan x.

Applying integration by parts in accordance with the table in the last section (setting v′(x) = x^{n} and u(x) = Arctan x), we obtain

∫ x^{n}Arctan x dx = \frac{x^{n+1}}{n + 1}Arctan x − \frac{1}{n + 1} ∫ \frac{x^{n+1}}{1 + x^{2}} dx.

To evaluate the last integral, divide x^{2} + 1 into x^{n+1}, obtaining a polynomial quotient and a remainder. It turns out that the remainder will be x or −x if n is an even number, and 1 or −1 if n is an odd number. Thus, after integrating the polynomial quotient, you will be left with either ∫ x dx/(x^{2} + 1) = \frac{1}{2} ln(x^{2} + 1) + C, or else ∫ dx/(x^{2} + 1) =Arctan x + C.

Example 1.6. Find the antiderivative of x^{3}/(x^{2} + 2x + 5).

First, x^{3} divided by x^{2} + 2x + 5 is x − 2 with a remainder of −x + 10. Next, completing the square gives x^{2} + 2x + 5 = (x + 1)^{2} + 4 = (x + 1)^{2} + 2^{2}, and so we substitute u = x + 1 (then x = u − 1, dx = du). Thus,

∫ \frac{x^{3}dx}{x^{2} + 2x + 5} = ∫ (x − 2 + \frac{−x + 10}{x^{2} + 2x + 5}) dx

= \frac{1}{2}x^{2} − 2x + ∫ \frac{−x + 10}{(x + 1)^{2} + 4} dx

= \frac{1}{2}x^{2} − 2x + ∫ \frac{−(u − 1) + 10}{u^{2} + 4} du

= \frac{1}{2}x^{2} − 2x − ∫ \frac{u du}{u^{2} + 4} + 11 ∫ \frac{du}{u^{2} + 4}

= \frac{1}{2}x^{2} − 2x − \frac{1}{2} ln(u^{2} + 4) + \frac{11}{2}Arctan (\frac{u}{2}) + C

= \frac{1}{2}x^{2} − 2x − \frac{1}{2} ln(x^{2} + 2x + 5) + \frac{11}{2}Arctan (\frac{x + 1}{2}) + C.

Homework 1.

1. Find

(a) ∫_{0}^{1} dx/(4 − x^{2}); (e) ∫_{0}^{1} x^{4}dx/(4 − x^{2});  (h) ∫_{0}^{∞} dx/(x^{2} + 10x + 25);
(b) ∫_{0}^{1} x^{2}dx/(4 − x^{2}); (f) ∫_{0}^{1} x^{4}dx/(4 + x^{2});  (i) ∫_{0}^{∞} dx/(x^{2} + 10x + 29);
(c) ∫_{0}^{1} x^{3}dx/(4 + x^{2}); (g) ∫_{0}^{∞} dx/(x^{2} + 10x + 21); (j) ∫_{0}^{1} dx/(2x^{2} − x − 3).

(d) ∫_{1}^{∞} dx/(x^{2} + 3x);

2. Find the center of mass of a uniform flat plate bounded by:

(a) the lines x = 0 and x = 2 and the curves y = 1/(x^{2} + 3x + 2) and y = −1/(x^{2} + 3x + 2);

(b) the line x = 1, the curve y = x^{2}Arctan x, and the curve y = −x^{2} arctan x.

3. Find the anti-derivative of sec x = (cos x)^{−1} by the method used before for odd powers of cos x. That is, write (cos x)^{−1} = (cos x)^{−2} cos x = cos x/(1 − sin^{2} x). After making the appropriate u-substitution, you will have a rational function to integrate.