Skip to main content

Section 3.4 Integrals of Rational Functions

We apply earlier techniques to integrals of rational functions over the real numbers. The key new tool is partial fraction decomposition, which writes \(P/Q\) (with \(P,Q\) co-prime) as a polynomial plus a sum of simpler rational functions with denominators that are powers of irreducible factors of \(Q\text{.}\)

Subsection 3.4.1 Partial Fraction Decomposition

We recall a few 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 positive-degree polynomials. Two polynomials are co-prime if they share no positive-degree factor.
A linear polynomial is irreducible. A quadratic is reducible over \(\mathbb{R}\) exactly when it has a real root. Dividing \(p(x)\) by \((x-a)\) gives
\begin{equation*} p(x) = q(x)(x-a) + r, \end{equation*}
so \(a\) is a root of \(p(x)\) iff \(x-a\) divides \(p(x)\text{.}\) Thus \(ax^2+bx+c\) is reducible over \(\mathbb{R}\) iff its discriminant \(b^2-4ac\) is non-negative.

Example 3.36.

\(x^2+1\) is irreducible over \(\mathbb{R}\) since it has no real roots, but it factors as \((x-i)(x+i)\) over \(\mathbb{C}\text{.}\)
\(x^2-2=(x-\sqrt{2})(x+\sqrt{2})\) is reducible over \(\mathbb{R}\) but irreducible over \(\mathbb{Q}\) since its roots are irrational.
These examples show that irreducibility depends on the coefficient field.
The following statement gives existence and uniqueness of partial fraction decomposition.
The hypotheses are not restrictive: dividing the leading coefficient of \(Q\) into \(P\) makes \(Q\) monic, and canceling common factors makes \(P\) and \(Q\) co-prime. This may remove finitely many points from the domain, but it does not change the antiderivative of the rational function.
The page sketches a proof of TheoremΒ 3.37 and gives more details.
We illustrate the computation with examples. From the discussion above we can assume \(F(x)=P(x)/Q(x)\) with \(P\) and \(Q\) co-prime and \(\deg P \lt \deg Q\text{.}\) In this case \(Q\) is the denominator of \(F\text{,}\) determined only up to a non-zero constant multiple.

Example 3.38.

Find the partial fraction decomposition of \(F(x) = \dfrac{x-1}{2x^2 -x -3}\text{.}\) The denominator \(Q(x)=2x^2-x-3\) has discriminant \((-1)^2-4(2)(-3)=25\text{,}\) so it factors as \((x+1)(2x-3)\text{.}\)
Table 3.39. Table for the partial fractions decomposition of F(x)
factor degree multiplicity
\(x+1\) \(1\) \(1\)
\(2x-3\) \(1\) \(1\)
By TheoremΒ 3.37, each linear factor contributes a constant numerator:
\begin{equation*} \frac{x-1}{2x^2 - x -3} \equiv \frac{A_{11}}{x+1} + \frac{A_{21}}{2x-3} \end{equation*}
Relabel \(A_{11},A_{21}\) as \(A_1,A_2\text{.}\) Then
\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*}
Comparing numerators gives
\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.9} \end{equation}
\begin{equation} 2A_1 + A_2 = 1 \quad \text{and} \quad -3A_1 + A_2 = -1.\tag{3.10} \end{equation}
Solving yields \(A_1=2/5\text{,}\) \(A_2=1/5\text{,}\) so
\begin{equation*} \frac{x-1}{2x^2 - x -3} = \frac{2}{5(x+1)}+\frac{1}{5(2x-3)}. \end{equation*}

Example 3.40.

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*}
Here \(\deg P = \deg Q = 5\text{,}\) so the polynomial part is not zero. Long division gives \(P(x)=2Q(x)+(x^4-x^3+4x^2-3x+3)\text{,}\) so
\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*}
Let \(R(x)=x^4-x^3+4x^2-3x+3\text{.}\) Then \(R\) and \(Q\) are co-prime, so it remains to decompose \(R/Q\text{.}\)
Table 3.41. Table for the partial fractions decomposition of F(x)
factor degree multiplicity
\(x-1\) \(1\) \(1\)
\(x^2+1\) \(2\) \(2\)
\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*}
Clearing denominators gives
\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*}
Set \(x=1\) to get \(4=4A_{11}\text{,}\) so \(A_{11}=1\text{.}\) Setting \(x=0\) gives \(3=1-C_{11}-C_{12}\text{,}\) so \(C_{11}+C_{12}=-2\text{.}\)
Comparing leading coefficients gives \(1=A_{11}+B_{11}=1+B_{11}\text{,}\) so \(B_{11}=0\text{.}\) Comparing the \(x\) coefficients yields
\begin{align*} -3 &= -B_{11}+C_{11} -B_{12} +C_{12} \\ -3 &= 0 -B_{12} +(-2) \end{align*}
so \(B_{12}=1\text{.}\) Finally, setting \(x=-1\) gives \(-3 = 2C_{11}+C_{12}\text{.}\) Together with \(C_{11}+C_{12}=-2\text{,}\) we get \(C_{11}=C_{12}=-1\text{.}\)
Therefore
\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.

Compute the partial fraction decomposition of
\begin{equation*} \frac{P}{Q} = \frac{2x^2+7x-8}{x^3 - x^2 + 8x +10}. \end{equation*}
Since \(\deg Q=3\text{,}\) \(Q\) has a real root. Here
\begin{equation*} Q(-2) \lt 0 \lt Q(0) \end{equation*}
so a root lies in \((-2,0)\text{.}\) Factoring
\begin{equation*} x^3 - x^2 +8x + 10 = (x-r)(x^2 + bx + c) \end{equation*}
with integer \(r\text{,}\) we need \(-rc=10\text{,}\) so \(r\) is a factor of \(10\text{.}\) Checking gives \(r=-1\text{.}\) Thus
\begin{equation*} x^3 - x^2 + 8x + 10 = (x+1)(x^2 - 2x +10) \end{equation*}
and \(x^2-2x+10=(x-1)^2+9\) is irreducible. Therefore
\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*}
Multiplying by \(Q(x)\) yields
\begin{equation*} 2x^2+ 7x - 8 \equiv A ( (x-1)^2 + 9) + (Bx+C) (x+1). \end{equation*}
Setting \(x=-1\) gives \(-13=13A\text{,}\) so \(A=-1\text{.}\) Setting \(x=0\) gives
\begin{equation*} -8 = (-1)( (-1)^2 + 9) +C = -10 + C, \end{equation*}
so \(C=2\text{.}\) Comparing \(x^2\) coefficients gives \(2=A+B=-1+B\text{,}\) so \(B=3\text{.}\)
Therefore
\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*}
The graph of f of x equals two x square plus seven x minus eight and the graph of g of x equals x cube minus x square plus eight x plus ten. The variable x ranges from negative 5 to 2.
Figure 3.43.
Computations can get messy for arbitrary rational functions, so computer algebra systems are often used.

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

Partial fraction decomposition reduces rational integrals to
\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.11} \end{equation}
In the second case, \(x^2+bx+c\) is irreducible. Completing the square and a linear change of variable reduce the problem to integrals of the form
\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 uses \(u=x^2+a^2\text{.}\) The second uses the trigonometric substitution \(x=a\tan\theta\text{.}\) We illustrate this next.

Example 3.45.

Evaluate \(\ds \int \frac{x+8}{x^2+6x+34} dx\text{.}\) Completing the square gives \(x^2+6x+34=(x+3)^2+25\text{.}\) With \(u=x+3\text{,}\) the integral becomes
\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 \(u=5\tan\theta\text{,}\)
\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{,}\)
\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*}
Therefore
\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*}