In this section we investigate the antiderivatives of rational functions. Recall that rational functions are functions of the form \(f(x)= \frac{p(x)}{q(x)}\text{,}\) where \(p(x)\) and \(q(x)\) are polynomials and \(q(x)\neq 0\text{.}\) Such functions arise in many contexts, one of which is the solving of certain fundamental differential equations.

We begin with an example that demonstrates the motivation behind this section. Consider the integral \(\ds\int \frac{1}{x^2-1}\ dx\text{.}\) We do not have a simple formula for this (if the denominator were \(x^2+1\text{,}\) we would recognize the antiderivative as being the arctangent function). It can be solved using Trigonometric Substitution, but note how the integral is easy to evaluate once we realize:
\begin{equation*}
\frac{1}{x^2-1} = \frac{1/2}{x-1} - \frac{1/2}{x+1}.
\end{equation*}

Thus
\begin{align*}
\int\frac{1}{x^2-1}\ dx \amp = \int\frac{1/2}{x-1}\ dx - \int\frac{1/2}{x+1}\ dx\\
\amp = \frac12\ln\abs{x-1} - \frac12\ln\abs{x+1} + C.
\end{align*}

This section teaches how to *decompose*
\begin{equation*}
\frac{1}{x^2-1} \text{ into } \frac{1/2}{x-1}-\frac{1/2}{x+1}.
\end{equation*}

We start with a rational function \(f(x)=\frac{p(x)}{q(x)}\text{,}\) where \(p\) and \(q\) do not have any common factors and the degree of \(p\) is less than the degree of \(q\text{.}\) It can be shown that any polynomial, and hence \(q\text{,}\) can be factored into a product of linear and irreducible quadratic terms. The following Key Idea states how to decompose a rational function into a sum of rational functions whose denominators are all of lower degree than \(q\text{.}\)

An irreducible quadratic is a quadratic that has no real solutions. Solving \(ax^2+bx+c=0\) using the quadratic equation will determine if a quadratic is irreducible. Completing the square (which is a common integration technique) will also tell you if a quadratic is irreducible.

The following examples will demonstrate how to put this Key Idea into practice. Example 6.5.2 stresses the decomposition aspect of the Key Idea.

#####
Example6.5.2Decomposing into partial fractions

Decompose \(\ds f(x)=\frac{1}{(x+5)(x-2)^3(x^2+x+2)(x^2+x+7)^2}\) without solving for the resulting coefficients.

SolutionThe denominator is already factored, as both \(x^2+x+2\) and \(x^2+x+7\) cannot be factored further. We need to decompose \(f(x)\) properly. Since \((x+5)\) is a linear term that divides the denominator, there will be a
\begin{equation*}
\frac{A}{x+5}
\end{equation*}
term in the decomposition.

As \((x-2)^3\) divides the denominator, we will have the following terms in the decomposition:
\begin{equation*}
\frac{B}{x-2}, \frac{C}{(x-2)^2} \text{ and } \frac{D}{(x-2)^3}.
\end{equation*}

The \(x^2+x+2\) term in the denominator results in a \(\ds\frac{Ex+F}{x^2+x+2}\) term.

Finally, the \((x^2+x+7)^2\) term results in the terms
\begin{equation*}
\frac{Gx+H}{x^2+x+7} \text{ and } \frac{Ix+J}{(x^2+x+7)^2}.
\end{equation*}

All together, we have
\begin{align*}
\amp\frac{1}{(x+5)(x-2)^3(x^2+x+2)(x^2+x+7)^2}\\
\amp = \frac{A}{x+5} + \frac{B}{x-2}+ \frac{C}{(x-2)^2}+\frac{D}{(x-2)^3}+\\
\amp \frac{Ex+F}{x^2+x+2}+\frac{Gx+H}{x^2+x+7}+\frac{Ix+J}{(x^2+x+7)^2}
\end{align*}

Solving for the coefficients \(A\text{,}\) \(B \ldots J\) would be a bit tedious but not “hard.”

#####
Example6.5.3Decomposing into partial fractions

Perform the partial fraction decomposition of \(\ds \frac{1}{x^2-1}\text{.}\)

SolutionThe denominator factors into two linear terms: \(x^2-1 = (x-1)(x+1)\text{.}\) Thus
\begin{equation*}
\frac{1}{x^2-1} = \frac{A}{x-1} + \frac{B}{x+1}.
\end{equation*}

To solve for \(A\) and \(B\text{,}\) first multiply through by \(x^2-1 = (x-1)(x+1)\text{:}\)
\begin{align*}
1 \amp = \frac{A(x-1)(x+1)}{x-1}+\frac{B(x-1)(x+1)}{x+1}\\
\amp = A(x+1) + B(x-1)\\
\amp = Ax+A + Bx-B\\
\end{align*}
Now collect like terms.
\begin{align*}
\amp = (A+B)x + (A-B).
\end{align*}

The next step is key. Note the equality we have:
\begin{equation*}
1 = (A+B)x+(A-B).
\end{equation*}

For clarity's sake, rewrite the left hand side as
\begin{equation*}
0x+1 = (A+B)x+(A-B).
\end{equation*}

On the left, the coefficient of the \(x\) term is 0; on the right, it is \((A+B)\text{.}\) Since both sides are equal, we must have that \(0=A+B\text{.}\)

Likewise, on the left, we have a constant term of 1; on the right, the constant term is \((A-B)\text{.}\) Therefore we have \(1=A-B\text{.}\)

We have two linear equations with two unknowns. This one is easy to solve by hand, leading to
\begin{align*}
A+B \amp = 0\\
A-B \amp = 1
\end{align*}
If we add these two equations, we get \(2A=1 \Rightarrow A=1/2\text{.}\) Substitution into the first equation gives \(B=-1/2\text{.}\)

Thus
\begin{equation*}
\frac{1}{x^2-1} = \frac{1/2}{x-1}-\frac{1/2}{x+1}.
\end{equation*}

There is another method for finding the partial fraction decomposition called the “Heaviside” method, named after Oliver Heaviside. We show a variation of this process using the same example as in Example 6.5.2.

#####
Example6.5.4Decomposing into partial fractions using the Heaviside method

Perform the partial fraction decomposition of \(\ds \frac{1}{x^2-1}\text{.}\)

SolutionAs we saw in Example 6.5.3,
\begin{equation*}
\frac{1}{x^2-1} = \frac{A}{x-1} + \frac{B}{x+1}.
\end{equation*}

To solve for \(A\) and \(B\) using the Heaviside method, we will build to a common denominator:
\begin{align*}
\frac{1}{x^2-1} \amp = \frac{A(x+1)}{(x-1)(x+1)}+\frac{B(x-1)}{(x+1)(x-1)}\\
\amp = \frac{A(x+1)+B(x-1)}{(x-1)(x+1)}
\end{align*}

Now since the denomiators match, we will only consider the numerator equation (essentially if we multiply both sides of the equation by \((x-1)(x+1)\text{,}\) we will clear the denomiators):
\begin{equation*}
1=A(x+1)+B(x-1)
\end{equation*}
Now we substitute in “convenient” values of \(x\text{.}\) When \(x=1\text{,}\) we get \(1=2A \Rightarrow A=1/2\text{.}\) When \(x=-1\text{,}\) we get \(1=-2B \Rightarrow B=-1/2\text{.}\)

You may note that \(x=1\) and \(x=-1\) were not in the domain of the original fraction. However,
\begin{equation*}
\frac{1}{x^2-1}=\frac{A(x+1)+B(x-1)}{(x-1)(x+1)}
\end{equation*}
is an identity, meaning it is true for all values of \(x\text{,}\) even those for which the equation is undefined. We could have chosen any values of \(x\) to substitute. Whenever possible, we choose values of \(x\) that will make one of the factors zero. In this way, we can avoid solving a system of equations.

Thus as in Example 6.5.2, we get
\begin{equation*}
\frac{1}{x^2-1} = \frac{1/2}{x-1}-\frac{1/2}{x+1}
\text{.}
\end{equation*}

#####
Example6.5.5Integrating using partial fractions

Use partial fraction decomposition to integrate \(\ds\int\frac{1}{(x-1)(x+2)^2}\ dx\text{.}\)

SolutionWe decompose the integrand as follows, as described by Key Idea 6.5.1:
\begin{equation*}
\frac{1}{(x-1)(x+2)^2} = \frac{A}{x-1} + \frac{B}{x+2} + \frac{C}{(x+2)^2}.
\end{equation*}

To solve for \(A\text{,}\) \(B\) and \(C\text{,}\) we multiply both sides by \((x-1)(x+2)^2\text{:}\)
\begin{equation}
1 = A(x+2)^2 + B(x-1)(x+2) + C(x-1)\label{eq_pf3}\tag{6.5.1}
\end{equation}
Now we collect like terms:
\begin{align*}
1 \amp = A(x+2)^2 + B(x-1)(x+2) + C(x-1)\\
\amp = Ax^2+4Ax+4A + Bx^2 + Bx-2B + Cx-C\\
\amp = (A+B)x^2 + (4A+B+C)x + (4A-2B-C)
\end{align*}

Equation (6.5.1) offers a direct route to finding the values of \(A\text{,}\) \(B\) and \(C\text{.}\) Since the equation holds for all values of \(x\text{,}\) it holds in particular when \(x=1\text{.}\) However, when \(x=1\text{,}\) the right hand side simplifies to \(A(1+2)^2 = 9A\text{.}\) Since the left hand side is still 1, we have \(1 = 9A\text{.}\) Hence \(A = 1/9\text{.}\)

Likewise, the equality holds when \(x=-2\text{;}\) this leads to the equation \(1=-3C\text{.}\) Thus \(C = -1/3\text{.}\)

Knowing \(A\) and \(C\text{,}\) we can find the value of \(B\) by choosing yet another value of \(x\text{,}\) such as \(x=0\text{,}\) and solving for \(B\text{.}\)

We have
\begin{equation*}
0x^2+0x+ 1 = (A+B)x^2 + (4A+B+C)x + (4A-2B-C)
\end{equation*}
leading to the equations
\begin{equation*}
A+B = 0, 4A+B+C = 0 \text{ and } 4A-2B-C = 1.
\end{equation*}

These three equations of three unknowns lead to a unique solution:
\begin{equation*}
A = 1/9, B = -1/9 \text{ and } C = -1/3.
\end{equation*}

Thus
\begin{equation*}
\int\frac{1}{(x-1)(x+2)^2}\ dx = \int \frac{1/9}{x-1}\ dx + \int \frac{-1/9}{x+2}\ dx + \int \frac{-1/3}{(x+2)^2}\ dx.
\end{equation*}

Each can be integrated with a simple substitution with \(u=x-1\) or \(u=x+2\) (or by directly applying Key Idea 6.1.4 as the denominators are linear functions). The end result is
\begin{equation*}
\int\frac{1}{(x-1)(x+2)^2}\ dx = \frac19\ln\abs{x-1} -\frac19\ln\abs{x+2} +\frac1{3(x+2)}+C.
\end{equation*}

#####
Example6.5.6Integrating using partial fractions

Use partial fraction decomposition to integrate \(\ds \int \frac{x^3}{(x-5)(x+3)}\ dx\text{.}\)

SolutionKey Idea 6.5.1 presumes that the degree of the numerator is less than the degree of the denominator. Since this is not the case here, we begin by using polynomial division to reduce the degree of the numerator. We omit the steps, but encourage the reader to verify that
\begin{equation*}
\frac{x^3}{(x-5)(x+3)} = x+2+\frac{19x+30}{(x-5)(x+3)}.
\end{equation*}

Using Key Idea 6.5.1, we can rewrite the new rational function as:
\begin{equation*}
\frac{19x+30}{(x-5)(x+3)} = \frac{A}{x-5} + \frac{B}{x+3}
\end{equation*}
for appropriate values of \(A\) and \(B\text{.}\) Clearing denominators, we have

The values of \(A\) and \(B\) can be quickly found using the technique described in Example 6.5.5, or they can be found by equating coefficients (which we show below).

\begin{align*}
19x+30 \amp = A(x+3) + B(x-5)\\
\amp = (A+B)x + (3A-5B).\\
\end{align*}
This implies that:
\begin{align*}
19\amp = A+B\\
30\amp = 3A-5B.\\
\end{align*}
Solving this system of linear equations gives
\begin{align*}
125/8 \amp =A\\
27/8 \amp =B.
\end{align*}
We can now integrate.
\begin{align*}
\int \frac{x^3}{(x-5)(x+3)}\ dx \amp = \int\left(x+2+\frac{125/8}{x-5}+\frac{27/8}{x+3}\right)\ dx\\
\amp = \frac{x^2}2 + 2x + \frac{125}{8}\ln\abs{x-5} + \frac{27}8\ln\abs{x+3} + C.
\end{align*}

#####
Example6.5.7Integrating using partial fractions

Use partial fraction decomposition to evaluate \(\ds \int\frac{7x^2+31x+54}{(x+1)(x^2+6x+11)}\ dx\text{.}\)

SolutionThe degree of the numerator is less than the degree of the denominator so we begin by applying Key Idea 6.5.1. We have:
\begin{align*}
\frac{7x^2+31x+54}{(x+1)(x^2+6x+11)} \amp = \frac{A}{x+1} + \frac{Bx+C}{x^2+6x+11}.\\
\end{align*}
Now clear the denominators.
\begin{align*}
7x^2+31x+54 \amp = A(x^2+6x+11) + (Bx+C)(x+1)
\end{align*}
Now, letting \(x=-1\) we have \(30 = 6A \Rightarrow A=5\text{.}\) When \(x=0\text{,}\) \(54 = 11A+C\text{.}\) But we know that \(A=1\text{,}\) so \(54 =55+C \Rightarrow C=-1\) Finally, we choose \(x=1\) (with \(A=5, C=-1\)) we have \(92=90+(B-1)(2)\Rightarrow B=2\text{.}\)

Thus
\begin{equation*}
\int\frac{7x^2+31x+54}{(x+1)(x^2+6x+11)}\ dx = \int\left(\frac{5}{x+1} + \frac{2x-1}{x^2+6x+11}\right)\ dx.
\end{equation*}

The first term of this new integrand is easy to evaluate; it leads to a \(5\ln\abs{x+1}\) term. The second term is not hard, but takes several steps and uses substitution techniques.

The integrand \(\ds \frac{2x-1}{x^2+6x+11}\) has a quadratic in the denominator and a linear term in the numerator. This leads us to try substitution. Let \(u = x^2+6x+11\text{,}\) so \(du = (2x+6)\ dx\text{.}\) The numerator is \(2x-1\text{,}\) not \(2x+6\text{,}\) but we can get a \(2x+6\) term in the numerator by adding 0 in the form of “\(7-7\text{.}\)”
\begin{align*}
\frac{2x-1}{x^2+6x+11} \amp = \frac{2x-1+7-7}{x^2+6x+11}\\
\amp = \frac{2x+6}{x^2+6x+11} - \frac{7}{x^2+6x+11}.
\end{align*}

We can now integrate the first term with substitution, leading to a \(\ln\abs{x^2+6x+11}\) term. The final term can be integrated using arctangent. (We can tell there is no further factoring for this quadratic since the denominator has no real solutions). First, complete the square in the denominator:
\begin{equation*}
\frac{7}{x^2+6x+11} = \frac{7}{(x+3)^2+2}.
\end{equation*}

An antiderivative of the latter term can be found using Theorem 6.1.16 and substitution:
\begin{equation*}
\int \frac{7}{x^2+6x+11}\ dx = \frac{7}{\sqrt{2}}\tan^{-1}\left(\frac{x+3}{\sqrt{2}}\right)+C.
\end{equation*}

Let's start at the beginning and put all of the steps together.
\begin{align*}
\amp \int\frac{7x^2+31x+54}{(x+1)(x^2+6x+11)}\ dx \\
\amp = \int\left(\frac{5}{x+1} + \frac{2x-1}{x^2+6x+11}\right)\ dx\\
\amp = \int\frac{5}{x+1}\ dx + \int\frac{2x+6}{x^2+6x+11}\ dx -\int\frac{7}{(x+3)^2+2}\ dx\\
\amp = 5\ln\abs{x+1}+ \ln\abs{x^2+6x+11} -\frac{7}{\sqrt{2}}\tan^{-1}\left(\frac{x+3}{\sqrt{2}}\right)+C.
\end{align*}

As with many other problems in calculus, it is important to remember that one is not expected to “see” the final answer immediately after seeing the problem. Rather, given the initial problem, we break it down into smaller problems that are easier to solve. The final answer is a combination of the answers of the smaller problems.

Partial Fraction Decomposition is an important tool when dealing with rational functions. Note that at its heart, it is a technique of algebra, not calculus, as we are rewriting a fraction in a new form. Regardless, it is very useful in the realm of calculus as it lets us evaluate a certain set of “complicated” integrals.

Section 6.6introduces new functions, called the Hyperbolic Functions. They will allow us to make substitutions similar to those found when studying Trigonometric Substitution, allowing us to approach even more integration problems.