Skip to main content

Section 3.4 Integrals of Rational Functions

In this section we apply techniques from previous sections to compute integrals of rational functions over the real numbers. The new ingredient is partial fraction decomposition. This method enables us to express a rational function, \(P/Q\) (\(P,Q\) co-prime polynomials) as the sum of a polynomial and rational functions whose denominators are powers of irreducible factors of \(Q\text{.}\)

Subsection 3.4.1 Partial Fraction Decomposition

We first recall a few definitions and facts about polynomials.
A non-zero polynomial is monic if its leading coefficient is \(1\text{.}\) A non-constant polynomial is irreducible if it is not a product of two polynomials of positive degree. Two polynomials are co-prime if they do not have any positive degree factor in common.
A linear (degree \(1\)) polynomial is clearly irreducible. A quadratic polynomial is reducible if and only if it has a linear factor. Dividing a polynomial \(p(x)\) by a linear polynomial \((x-a)\) (\(a \in \mathbb{R}\)), we get
\begin{equation*} p(x) = q(x)(x-a) + r \end{equation*}
Therefore, \(a\) is a root of \(p(x)\) if and only if \(x-a\) divides \(p(x)\text{.}\) As a result, a quadratic polynomial \(ax^2 + bx +c\) is reducible over the real numbers if and only if it has a real root if and only if its discriminant, \(b^2 - 4ac\text{,}\) is non-negative.

Example 3.36.

The polynomial \(x^2+1\) is irreducible over the real numbers since it has no real roots. However, it is reducible, factored as \((x-i)(x+i)\text{,}\) over the complex numbers.
The polynomial \(x^2-2 =(x-\sqrt{2})(x+\sqrt{2})\) is reducible over the real numbers but it is irreducible over the rational numbers, since neither of its roots (\(\pm \sqrt{2}\)) is rational.
These simple examples demonstrate that irreducibility of polynomials is sensitive to the type of coefficients that are allowed.
The follow statement asserts the existence and uniqueness of partial fraction decomposition for rational functions.
The assumptions on \(P\) and \(Q\) in the theorem above can always be achieved: by dividing the leading coefficient of \(Q\) into \(P\text{,}\) we can assume \(Q\) is monic. We should point out that requiring \(Q\) to be monic only makes the statement simpler but not essential. By canceling common non-constants factors of \(P\) and \(Q\text{,}\) we can assume they are co-prime. Doing this potentially extends the domain of the rational function \(P/Q\) by finitely many points. With them taken out, the indefinite integral of \(P/Q\) and that for the reduced fraction are the same.
The page
 1 
en.wikipedia.org/wiki/Partial_fraction_decomposition
contains a sketch of proof of Theorem 3.37 and more information about partial fraction decomposition.
We illustrate how to compute partial fraction decomposition by a few examples. From the discussion above, we only need to focus on the case where the rational function \(F(x)\) is written as \(P(x)/Q(x)\) where \(P(x)\) and \(Q(x)\) are co-prime polynomials and that \(\deg P(x) \lt \deg Q(x)\text{.}\) In this case, we call \(Q(x)\) the denominator of \(F(x)\text{.}\) Note that \(Q(x)\) is determined by \(F(x)\) only up to a non-zero multiplicative constant.

Example 3.38.

Let us find the partial fraction decomposition of the rational function \(F(x) = \dfrac{x-1}{2x^2 -x -3}\text{.}\) The denominator \(Q(x) = 2x^2 -x -3\) of \(F(x)\) is reducible since its discriminant \((-1)^2 - 4(2)(-3) = 25\text{,}\) is positive. Indeed, \(Q(x)\) factors as \((x+1)(2x-3)\text{.}\) Let us put this in the form of a table:
Table 3.39. Table for the partial fractions decomposition of F(x)
factor degree multiplicity
\(x+1\) \(1\) \(1\)
\(2x-3\) \(1\) \(1\)
According to Theorem 3.37, each irreducible factor of \(Q(x)\) corresponding to a group of summands. The multiplicity of that factor is the number of summands in that group (one for each power). And the degree of that factor determines the form of the numerator in each of the summand in that group. If the degree is 1 then the corresponding numerator is simply a constant. If the degree is 2, then the corresponding numerator is of a linear form.
\begin{equation*} \frac{x-1}{2x^2 - x -3} \equiv \frac{A_{11}}{x+1} + \frac{A_{21}}{2x-3} \end{equation*}
We can find \(A_{11}\) and \(A_{21}\) by comparing coefficients which transfers the problem into one about solving a system of linear equations (and hence can be handled by linear algebra in general). For simplicity, we relabel the coefficients \(A_{11}\) and \(A_{21}\) as \(A_1\) and \(A_2\text{,}\) respectively.
\begin{equation*} \frac{A_1}{x+1} + \frac{A_2}{2x-3} \equiv \frac{A_1(2x-3)+A_2(x+1)}{(x+1)(2x-3)}. \end{equation*}
By comparing of the numerators, we get
\begin{equation} x - 1 \equiv A_1(2x-3) + A_2(x+1) \equiv (2A_1+A_2)x + (-3A_1 + A_2).\tag{3.8} \end{equation}
and so,
\begin{equation} 2A_1 + A_2 = 1 \quad \text{and} \quad -3A_1 + A_2 = -1.\tag{3.9} \end{equation}
Solving this system of linear equations yields \(A_1 = 2/5, A_2 = 1/5\text{,}\) therefore the partial fractions decomposition of \(F(x)\) is
\begin{equation*} \frac{2/5}{x+1} + \frac{1/5}{2x-3} = \frac{2}{5(x+1)}+\frac{1}{5(2x-3)}. \end{equation*}

Example 3.40.

Let us compute the partial fraction decomposition of
\begin{equation*} F(x) = \frac{P(x)}{Q(x)} = \frac{2x^5 -x^4 +3x^3 -x +1}{(x-1)(x^2+1)^2}. \end{equation*}
This time \(\deg P\) is not smaller than the degree of \(\deg Q\) (both are of degree \(5\)). So, the polynomial part of the decomposition is not zero. We can find that out by dividing \(P\) by \(Q\text{,}\) say using long division. We find that\(P(x) = 2Q(x) +(x^4 -x^3 +4x^2 -3x+3)\text{.}\) Thus,
\begin{equation*} \frac{P(x)}{Q(x)} = 2 + \frac{x^4 -x^3 +4x^2 -3x+3}{(x-1)(x^2+1)^2}. \end{equation*}
One checks that \(R(x):=x^4 -x^3 + 4x^2-3x+3\) and \(Q(x)\) have no irreducible factors in common. By uniqueness of partial fraction, it remains to compute the partial fraction decomposition of \(R/Q\text{.}\) Again we organize the information obtained from the factorization of \(Q(x)\) in a table:
Table 3.41. Table for the partial fractions decomposition of F(x)
factor degree multiplicity
\(x-1\) \(1\) \(1\)
\(x^2+1\) \(2\) \(2\)
Thus, the decomposition of \(R(x)/Q(x)\) has the form:
\begin{equation*} \frac{x^4 -x^3 +4x^2 -3x+3}{(x-1)(x^2+1)^2} \equiv \frac{A_{11}}{x-1} + \frac{B_{11}x + C_{11}}{x^2+1} + \frac{B_{12}x+C_{12}}{(x^2+1)^2}. \end{equation*}
By clearing the denominators, we arrive at
\begin{align*} x^4 -x^3 &+4x^2 -3x + 3 \equiv\\ & A_{11}(x^2+1)^2 + (B_{11}x + C_{11})(x-1)(x^2+1) + (B_{12}x+C_{12})(x-1). \end{align*}
The identity holds for all \(x\) so instead of comparing coefficients, one can also derive linear relations among the coefficients by setting \(x\) to various values. We aim at getting these relations as simple as possible, for instance, by setting \(x = 1\text{,}\) we arrive at
\begin{equation*} 1-1+4 -3 + 3 = A_{11}(1^2 + 1)^2. \end{equation*}
That is \(4 =4A_{11}\) and so \(A_{11} =1\text{.}\) Next by setting \(x=0\text{,}\) equivalently by comparing the constant terms on both sides, we get \(3 = A_{11}-C_{11} -C_{12} = 1-C_{11}-C_{12}\text{.}\) So, \(C_{11} + C_{12} =-2\text{.}\)
We can mix these techniques: at this point by comparing the leading coefficients on both sides, we get \(1 = A_{11}+B_{11} = 1+B_{11}\text{,}\) so \(B_{11}=0\text{.}\) Comparing the coefficients of the \(x\) term leads us to
\begin{align*} -3 &= -B_{11}+C_{11} -B_{12} +C_{12} \\ -3 &= 0 -B_{12} +(-2) \end{align*}
and so \(B_{12}=1\text{.}\) At this juncture, we need one more relation among \(C_{11}\) and \(C_{12}\text{.}\) We can do that by substituting another value for \(x\text{.}\) For example, we get \(-3 = 2C_{11}+C_{12}\) by setting \(x=-1\) (checks that yourself). And so together with \(C_{11}+C_{12} =-2\) we conclude that \(C_{11}=-1=C_{12}\text{.}\)
Putting all these together, the partial fraction decomposition of \(P/Q\) is
\begin{equation*} \frac{2x^5-x^4+3x^3-x+1}{(x-1)(x^2+1)^2} = 2+ \frac{1}{x-1} + \frac{-1}{x^2+1} + \frac{x-1}{(x^2+1)^2}. \end{equation*}

Example 3.42.

Let us compute the partial fraction decomposition of
\begin{equation*} \frac{P}{Q} = \frac{2x^2+7x-8}{x^3 - x^2 + 8x +10} \end{equation*}
Note that \(Q(x)\) has degree larger than \(2\) and so must be reducible over the real numbers. In fact, the intermediate value theorem guarantees a real root for a cubic polynomial over \(\mathbb{R}\) and hence a linear factor. For instance, in this particular case,
\begin{equation*} Q(-2) \lt 0 \lt Q(0) \end{equation*}
so \(Q(x)\) must of a root between \(-2\) and \(0\text{.}\) Keep in mind, sketching the graph of a function often give you some insights on where are the roots located.
In general, the roots of a cubic can be expressed in terms of its coefficients by arithmetic operations and taking surds. However, we can guess the "nice" roots if there are some. Suppose we have a factorization
\begin{equation*} x^3 - x^2 +8x + 10 = (x-r)(x^2 + bx + c) \end{equation*}
where \(r\) is an integer. Then \(-rc = 10\) and hence \(r\) must be a factor of \(10\text{.}\) And given we know that there is a root of \(Q(x)\) between \(-2\) and \(0\text{,}\) it is easy to check that \(r=-1\) is a root of \(Q(x)\text{.}\) Thus, by dividing \(Q(x)\) by \((x-(-1)) = (x+1)\text{,}\) we have
\begin{equation*} x^3 - x^2 + 8x + 10 = (x+1)(x^2 - 2x +10) \end{equation*}
Since \(x^2 -2x + 10 = (x-1)^2 +9\) has no real roots, it is irreducible. Therefore, the partial fraction decomposition of \(P/Q\) looks like
\begin{equation*} \frac{2x^2+7x-8}{x^3 - x^2 + 8x +10} =\frac{A}{x+1} + \frac{Bx +C}{(x-1)^2 + 9} \end{equation*}
By multiplying \(Q(x)\) on both sides, we get to
\begin{equation*} 2x^2+ 7x - 8 \equiv A ( (x-1)^2 + 9) + (Bx+C) (x+1). \end{equation*}
Setting \(x=-1\) yields \(- 13 = 13A\text{,}\) so \(A = -1\text{.}\) Then by setting \(x=0\text{,}\) we get
\begin{equation*} -8 = (-1)( (-1)^2 + 9) +C = -10 + C. \end{equation*}
Thus, \(C = 2\text{.}\) And by comparing the coefficients of \(x^2\) on both sides, we see that \(2 = A + B = -1 + B\text{,}\) so \(B=3\text{.}\)
Putting all these together, we get
\begin{equation*} \frac{2x^2+7x-8}{x^3 - x^2 + 8x +10} =\frac{-1}{x+1} + \frac{3x +2}{(x-1)^2 + 9} \end{equation*}
Figure 3.43.
The computations can get much messier for "random" rational functions and are best handle by computers programs.

Checkpoint 3.44.

Find the partial fraction decomposition of
\begin{equation*} \frac{x^{6}+5x^5-3x^4+15x^3-14x^2+35x-10}{(x-2)(x^2+1)^2(x^2-4)}. \end{equation*}
Answer.
The decomposition has the form:
\begin{equation*} \frac{A_{11}}{x+2} + \frac{A_{21}}{x-2} + \frac{A_{22}}{(x-2)^2} + \frac{B_{11}x +C_{11}}{x^2+1} + \frac{B_{12}x + C_{12}}{(x^2+1)^2}. \end{equation*}
And the partial fraction decomposition is
\begin{equation*} \frac{-1}{x+2} +\frac{1}{x-2} + \frac{3}{(x-2)^2} + \frac{x}{x^2 + 1} +\frac{2x-1}{(x^2+1)^2}. \end{equation*}

Subsection 3.4.2 The reduced cases

With partial fraction decomposition the problem of integrating rational functions over the real numbers reduces to the one of finding integrals of the form
\begin{equation*} \int \frac{A}{(x-a)^k} dx \ \text{and}\ \int \frac{Bx+C}{(x^2 +bx+c)^k}dx \quad (k \ge 1). \end{equation*}
The first case is straightforward:
\begin{equation} \int \dfrac{A}{(x-a)^k} dx = \begin{cases} A\ln|x-a| +C & k =1 \\ \dfrac{-A}{(k-1)(x-a)^{k-1}}+C & k >1. \end{cases}\tag{3.10} \end{equation}
In the second case, \(x^2+bx+c\) is irreducible. So by completing square and a linear change in variable, the problem boils down to finding integrals of the following two kinds
\begin{equation*} \int \frac{Bx}{(x^2+a^2)^k}dx, \qquad \int \frac{C}{(x^2+a^2)^k} dx \end{equation*}
The first kind can be handled by the substitution \(u = x^2 + a^2\) and the second kind is handled by the trigonometric substitution \(x = a\tan\theta\text{.}\) Let us illustrate these strategy by an example.

Example 3.45.

Let us find the integral \(\ds \int \frac{x+8}{x^2+6x+34} dx\text{.}\) Completing square we have, \(x^2 +6x +34 = (x+3)^2+25\text{.}\) So the substitution \(u = x+3\) turns to integral to
\begin{equation*} \int \frac{u+5}{u^2 +25}du = \int \frac{u}{u^2 + 25}du + 5\int\frac{du}{u^2+25}. \end{equation*}
Using the substitution \(u = 5\tan\theta\text{,}\) we find
\begin{align*} 5\int\frac{du}{u^2+25} &= \theta +C = \arctan\left(\frac{u}{5}\right) +C \\\\ &= \arctan\left(\frac{x+3}{5}\right)+C. \end{align*}
Letting \(w = u^2+25\text{,}\) we get
\begin{align*} \int \frac{u}{u^2 + 25}du &= \int \frac{dw}{2w} = \frac{1}{2}\ln|w| +C\\ \\ &= \frac{1}{2}\ln(u^2 +5)+C = \ln(\sqrt{x^2 + 6x+34}) + C \end{align*}
Putting these together, we conclude that
\begin{equation*} \int \frac{x+8}{x^2+6x+34}dx = \ln(\sqrt{x^2 + 6x+34}) + \arctan\left(\frac{x+3}{5}\right) + C \end{equation*}