Rational Functions take on many forms and some are ever more harder than others, but in this page, we will try to uncover the common ways of finding their antiderivatives.

Warning

This is a specialized topic in Calculus.
Before beginning to read this text, you are expected to be familiar with:

  • Basic Integration Techniques
  • The Fundamental Theorem of Calculus (Antiderivatives)
  • Integration by Substitution
  • Division of Polynomials via Long Division
  • Solving Systems of Linear Equations

Integration by Substitution

When integrating a rational polynomial function, our first instinct is to tell whether or not our rational function takes on the form:

This way, we can integrate the function by setting an another variable , then setting it equal to . By implicit differentiation, we see that
, and therefore .

This way, instead of integrating with respect to , we integrate with respect with .
By substituting our variable, we see that the integration process become simpler.

In this form, we can easily integrate it as . And since , our final answer would be .

Worked Example #1
Integrating Functions in the Form 

Evaluate

Using this technique, we can easily integrate linear factors in the denominator.
Consider the integral in the form:

Using substitution, we let and consequently, .
Since
is just a constant, we can use the constant multiple rule to rewrite the integral as:

Now, we can perform the substitution.

Worked Example #2
Integrating Rational Functions with a Linear Divisor

Evaluate

In general, integrating any function in the form simply becomes.

Worked Example #3
Deriving the General Formula for Integrating Rational Functions with a Linear Divisor

Evaluate

This results in a general formula:

But what if we have linear factors raised to some exponent, such as the form below?

This is much easier as we can use substitution, then integrate it using the power rule.
To integrate, we let , then consequently .

Worked Example #4
Integrating Functions in the form

Evaluate

Integration by Completing the Square

This technique applies when you are integrating a function in the form:

However, it is important that to apply this method, must be an **irreducible factor.

This simply means that we cannot express our denominator as a product of two linear factors.
This would also imply that the quadratic equation has
no real-valued roots.

Definition

Irreducible Factor

An irreducible polynomial is any polynomial where it cannot be expressed as a product of linear, or quadratic factors. This also means that there are no real solutions to the polynomial equation .This means that it does not intersect -axis.

But how can we differentiate this?

By knowing that , our goal in this method is to rewrite our integral in that form, then we use -substitution to integrate it as .

We can accomplish this by completing the square and performing some algebraic manipulations.

Worked Example #5
Integrating Rational Functions in the Form where

Evaluate

\int\frac{3}{x^2-2x+2}dx
&=3\int\frac{dx}{(x-1)^2+1}\
&=3\int\frac{du}{u^2+1}\
&=3\tan^{-1}u +C\
&=\boxed{3\tan^{-1}(x-1)+C}
\end{align*}$$

The above example was a special case scenario.
However, we might often integrate functions in the form .
In that case, we can divide the numerator and the denominator by .

Then we use -sub and set to integrate the resulting function.

Worked Example #6
Integrating Rational Functions in the Form where

Integrate

\int\frac{1}{3x^2-36x-120},dx &= \int\frac{dx}{3(x^2-12x+40)}\
&=\frac{1}{3}\int\frac{dx}{x^2-12x+40}
\end{align*}$$​​Then, complete the square on the polynomial in the denominator.

\int\frac{1}{3x^2-36x+120},dx
&=\frac{1}{3}\int\frac{dx}{x^2-12x+40}\
&=\frac{1}{3}\int\frac{dx}{x^2-12x+36-36+40}\
&=\frac{1}{3}\int\frac{dx}{(x-6)^2+4}\
\end{align*}$$

We then now rewrite the integrand in the form

\int\frac{1}{3x^2-36x+120},dx
&=\frac{1}{3}\int\frac{dx}{(x-6)^2+4}\
&=\frac{1}{3}\left(\frac{1}{4}\right){\large\int}\frac{dx}{\frac{(x-6)^2}{4}+1}\
&=\frac{1}{12}{\large\int}\frac{dx}{\left(\frac{x-6}{2}\right)^2+1}
\end{align*}$$

Lastly, we perform the substitution. Let ​, then .

\int\frac{1}{3x^2-36x+120},dx
&=\frac{1}{12}{\large\int}\frac{dx}{\left(\frac{x-6}{2}\right)^2+1}\
&=\frac{2}{12}\int\frac{du}{u^2+1}\
&=\frac{1}{6}\tan^{-1}u+C\
&=\boxed{\frac{1}6\tan^{-1}\left(x-6\over2\right)+C}
\end{align*}​​$$

Worked Example #7
Integrating Rational Functions in the Form ​ where

Integrate

\int\frac{2}{x^2+3x+4}dx&=2\int\frac{dx}{x^2+3x+4}\
&= 2\int\frac{dx}{x^2+3x+\frac{9}{4}-\frac{9}{4}+4}\
&= 2\int\frac{dx}{\left(x+\frac{3}{2}\right)^2+4-\frac{9}{4}}\
&=2\int\frac{dx}{\left(\frac{2x+3}2\right)^2+\frac{7}{4}}
\end{align*}$$
​Then, we divide the numerator and denominator by ​.

This is the same thing as multiplying the numerator and denominator by .​

\int\frac{2}{x^2+3x+4}dx&=2\int\frac{dx}{\left(\frac{2x+3}2\right)^2+\frac{7}{4}}\
&=2\int\frac{\frac{4}7}{\frac{4}{7}\left(\left(\frac{2x+3}2\right)^2+\frac{7}{4}\right)}dx\
&=\frac{8}{7}\int\frac{1}{\frac{4}{7}\left(\frac{2x+3}2\right)^2+1}
\end{align*}$$

​​We then take the square root of ​ so that we can merge it inside the squared term. Simplifying the squared term gives us:

\int\frac{2}{x^2+3x+4}dx&=\frac{8}{7}{\Large\int}\frac{dx}{\frac{4}{7}\left(\frac{2x+3}2\right)^2+1}\
&=\frac{8}{7}{\Large\int}\frac{dx}{1+\left(\frac{2x+3}{\sqrt{7}}\right)^2}
\end{align*}$$

Now, we use substitution. Let

\int\frac{2}{x^2+3x+4}dx
&=\frac{8}{7}{\Large\int}\frac{dx}{1+\left(\frac{2x
+3}{\sqrt{7}}\right)^2}\
&=\frac{8\sqrt{7}}{14}\int\frac{du}{1+u^2}\
&=\boxed{\frac{8\sqrt{7}}{14}\tan^{-1}\left(\frac{2x+3}{\sqrt7}\right)+C}
\end{align*}$$

But why do we need that is an irreducible factor?
There is a very good reason why this is the case, but first we establish that:

We imply here that

  • for any or , we can rewrite our quadratic in this form.
  • is never zero as we can instead integrate it as .

Recall that this is the vertex form of a quadratic function because it easily shows us that the vertex (the lowest point or the highest point) of this quadratic function is .
Using this form, we can make some interesting observations:

  • When are both positive:
    • The graph of would be an upward opening parabola, moreover, the vertex, or the lowest point is at .
    • This means that the graph never crosses the -axis as the parabola opens upward and the vertex is above the -axis.
  • When are both negative:
    • The graph of would be a downward opening parabola. Moreover, the vertex, or the highest point is at .
    • This means that the graph never crosses the -axis as the parabola opens downward and the vertex is below the -axis.

We can tell by these two cases that if and have the same sign, it means that the resulting quadratic expression is irreducible. But what if either one of them is positive but not both?

The problem arises when we rewrite our integral as .

Here, we start on the assumption that can be rewritten as . This should imply that the graph has real-valued roots, or it crosses the -axis.

Then, we divide the numerator and the denominator by .

But now, we have to take the square root of as we want to merge the constants inside the squared term. But this would not be possible as we would make an imaginary divisor, which might introduce extraneous solutions.

In this case, we would outline a method

Integrals with the Natural Logarithm and the Inverse Tangent

This method simply combines the previous two techniques.
When you are integrating a function in the form:

We can use the property of sum/difference property of integrals

So that we may be able to rewrite the integral as:

In theory, by splitting the integral like this, we can use the following strategy:

  • Due to the presence of the linear term, the first integral can be integrated via substitution.
    • Therefore, by assigning , then , we can integrate this as .
    • When substituting for , the numerator may lack or have an insufficient constant term.
    • We can account for this by subtracting or adding from as required.
  • The second one can be rewritten by completing the square so that we can integrate it as .
    • This is on the assumption that is irreducible.
    • Instead, we use a technique that we will outline on the next section.

With that in mind, let us try to see these techniques in action.

Worked Example #8
Integrating Functions in the Form ​ where

Integrate

Worked Example #9
Integrating Functions in the Form ​ where

Integrate

\begin{align*}
\int\frac{x-30}{5x^2-15x+25},dx &=\frac{1}{5}\int\frac{x-30}{x^2-3x+5},dx\
&=\frac{1}{5}\left(\int\frac{x}{x^2-3x+5},dx-\int\frac{30}{x^2-3x+5},dx\right)\
&=\frac{1}{5}\left(\int\frac{x}{x^2-3x+5},dx-\int\frac{30}{x^2-3x+5},dx\right)
\end{align*}$$

We prepare the first integral for substitution.
Let , then .
For us to perform the substitution, however, we must perform some manipulations.

\begin{align*}
\int\frac{x-30}{5x^2-15x+25},dx &=\frac{1}{5}\left(\int\frac{x}{x^2-3x+5},dx-\int\frac{30}{x^2-3x+5},dx\right)\
&=\frac{1}{5}\left(\int\frac{x}{x^2-3x+5},dx-\int\frac{30}{x^2-3x+5},dx\right)\
&=\frac{1}{5}\left(\int\frac{x-1.5}{x^2-3x+5},dx-\int\frac{30+1.5}{x^2-3x+5},dx\right)\
&=\frac{1}{5}\left(\frac{1}{2}\int\frac{2x-3}{x^2-3x+5},dx-\int\frac{31.5}{x^2-3x+5},dx\right)\
&=\frac{1}{5}\left(\frac{1}{2}\int\frac{1}{u},du-\int\frac{31.5}{x^2-3x+5},dx\right)\
&=\frac{1}{5}\left(\frac{1}{2}\ln|x^2-3x+5|-\int\frac{31.5}{x^2-3x+5},dx\right)\
\end{align*}$$

Next. we prepare the last integral by completing the square.
Then we rewrite the integral as the derivative of the inverse tangent.

\int\frac{x-30}{5x^2-15x+25},dx &=\frac{1}{5}\left(\frac{1}{2}\ln|x^2-3x+5|-\frac{61}{2}\int\frac{1}{x^2-3x+\frac{9}{4}-\frac{9}{4}+5},dx\right)\
&=\frac{1}{5}\left(\frac{1}{2}\ln|x^2-3x+5|-\frac{61}{2}\int\frac{1}{(x-\frac{3}2)^2+\frac{11}{4}},dx\right)\
&=\frac{1}{5}\left(\frac{4}{11}\right)\left(\frac{1}{2}\ln|x^2-3x+5|-\frac{61}{2}\int\frac{1}{\frac{4}{11}(x-\frac{3}2)^2+1},dx\right)\
&=\frac{4}{55}\left(\frac{1}{2}\ln|x^2-3x+5|-\frac{61}{2}\int\frac{1}{\frac{4}{11}(x-\frac{3}2)^2+1},dx\right)\
&=\frac{4}{55}\left(\frac{1}{2}\ln|x^2-3x+5|-\frac{61}{2}{\LARGE\int}\frac{1}{\left(\frac{2x-3}{\sqrt{11}}\right)^2+1},dx\right)\
\end{align*}$$

Finally, we perform substitution.
We let , then .

\int\frac{x-30}{5x^2-15x+25},dx &=\frac{4}{55}\left(\frac{1}{2}\ln|x^2-3x+5|-\frac{61}{2}\left(\frac{\sqrt{11}}{2}\right){\LARGE\int}\frac{1}{u^2+1},dx\right)\
&=\boxed{\frac{4}{55}\left(\frac{1}{2}\ln|x^2-3x+5|-\frac{61\sqrt{11}}{4}\tan^{-1}\left(\frac{2x-3}{\sqrt{11}}\right)\right)+C}\
\end{align*}$$

Integrating using Long Division

When integrating a rational polynomial function , where the degree of the polynomial is greater than or equal to , we can use long division to simplify the fraction into its quotient plus the remainder over the divisor .

In general, for any where :

We can leverage this idea to express our integral as a sum of smaller integrals.

  • First, perform long division.
    Then, rewrite the ratio as .

    We can now begin to integrate.

  • Since the degree of the polynomial in the nominator is equal to the degree of the polynomial in the denominator, we can perform long division.
    Therefore:

    To integrate , we use -substitution by letting .

    To proceed however, we must use the property from earlier to break the fraction into two smaller fractions, so that only a linear term remains in the numerator.

Integration by Partial Fractions

So far, we have have tackled how to integrate rational functions with linear and irreducible quadratic divisors. But we have yet to tackle how to integrate products of linear divisors such as:

However, as we will learn through this section, we can rewrite this rational function as:

Expressing a product of linear divisors this way is what we call a partial fraction decomposition.

Definition
Partial Fraction Decomposition with Linear Factors

Suppose that a rational function with polynomials and is in the form:

Given that where the degree of the polynomial can be expressed as a product of linear factors , this rational function can be expressed as:

In the next few sections, we are going to explore more about how rational functions are decomposed, the different types of decompositions, as well as applying them to integrate rational functions.

Partial Fractions with Non-repeated Linear Factors

We established before that we can rewrite a rational function as a sum of smaller fractions.
In practicality, this is useful as we can break the integral down as a sum of smaller integrals instead, then we leverage the previous techniques we have seen so far.

However, if we start integrating something like the rational function:

Where do we even start? And how can we find the individual constants of each fractional term?

First of all, we create a partial fraction decomposition of our rational function.
By knowing that , we perform the following decomposition.

Adding the right-hand side by multiplying each term by their least common denominator, we get:

Misplaced &\align{\frac{2x-1}{x^2-x-6} &= \frac{A(x+3)}{(x-4)(x+3)} + \frac{B(x-4)}{(x-4)(x+3)}\\[2ex] \frac{2x-1}{x^2-x-6} &=\frac{A(x+3)+B(x-4)}{x^2-x-6}}

Since the denominators are equal, we can then equate the numerators.

From here on out, we can use techniques to determine the constants and .

Definition
Equating Coefficients

We can solve for and by expanding the term on the right-hand side.

Misplaced &2x-1 &= Ax+3A +Bx - 4B }$$ Then, we group together like terms. $$\align{ 2x-1 &= Ax+Bx +3A-4B\\ &=(A+B)x +(3A-4B) }$$ In this form, we see that $A+B$ is equal to the linear coefficient on the left side $2$. Furthermore, we also see that $3A-4B$ is equal to the constant term $-1$. By knowing these relationships, we now set a system of linear equations.

\left{
\begin{align*}
A+B &= 2\
3A-4B&=-1
\end{align*}
\right.

Misplaced &\align{A+B &= 2\\ A &= 2-B}

Then, we substitute into .

Misplaced &3(2-B) - 4B &= -1\\ 6 - 3B-4B &= -1\\ 6-7B&=-1\\ -7B &=-7\\ B&=1 }$$ After solving for $B$, we then solve back for $A$ using $(1)$.

\align{A &= 2-1\ A &= 1}

Therefore, the coefficients for our partial fraction decomposition are and .

Definition
Strategic Substitution

Knowing that both sides of the equation are polynomial expressions, this means that they are defined for any value of .

By substituting certain values may allow us to cancel some terms in our equation.
This is essential as we can then solve for the remaining terms.

If we consider:

  • , the term with the coefficient becomes ,
  • , the term with the coefficient becomes .

Using this fact, we can solve for and separately.

We can also conclude that the coefficients for our partial fraction decomposition is and

Now that we have solved for and , we can finally integrate.

Worked Example #12
Integrating Functions using a Partial Fraction Decomposition

Integrate

Here’s an another challenging example.

Worked Example #13
Integrating Functions that Results in a Partial Fraction Decomposition

Integrate

Partial Fractions with Non-repeated Irreducible Quadratic Factors

Previously, we have formulated a strategy for integrating functions with an irreducible quadratic denominator. Now, we take it up a notch if what happens if we have an irreducible quadratic as a factor of a polynomial function. We can decompose such functions as:

Definition
Partial Fraction Decomposition with Irreducible Quadratic Factors

Suppose that a rational function is in the form:

Extra close brace or missing open brace\frac{P(x)}{D(x)} }$$ Given that the degree of the polynomial $\deg(D)=n$ and that$D(x) = (ax^2+b_1x+c_1)(a_2x^2+b_2x+c_2)\cdots(a_nx^2+b_nx+c_n)$. This rational function can be expressed as:

\align{
\frac{P(x)}{D(x)} = \frac{A_1x+B_1}{a_1x^2+b_1x+c_1} +\frac{A_2x+B_2}{a_2x^2+b_2x+c_2} +\cdots+\frac{A_n+B_n}{a_nx^2+b_nx+c_n}
}

Worked Example #14
Integrating Functions Resulting in a
Partial Fraction Decomposition with an Irreducible Quadratic Factor

Integrate

Partial Fractions with Repeated Factors

An another case that we can examine is when a rational function with a denominator has a repeated factor or . To decompose this, we do the following:

Definition
Partial Fraction Decomposition with Repeated Factors

Given a rational function in the form:

If contains a repeated linear factor , then this rational function can be decomposed as:

Misplaced &\frac{P(x)}{(ux^2+vx+w)(ax+b)^n} &=\frac{Ax+B}{ux^2+vx+w}+\frac{C_1}{ax+b}+\frac{C_2}{(ax+b)^2}+\cdots+\frac{C_n}{(ax+b)^n} }

If contains a repeated irreducible quadratic factor , then this rational function can be decomposed as:

Misplaced &\align{ \frac{P(x)}{(ux+v)(ax^2+bx+c)^n} &= \frac{A}{ux+v}+\frac{B_1x+C_1}{ax^2+bx+c}+\frac{B_2x+C_2}{ax^2+bx+c} +\cdots+\frac{B_nx+C_n}{ax^2+bx+c}\\ \frac{P(x)}{(ux^2+vx+w)(ax^2+bx+c)^n}&= \frac{Ax+B}{ux^2+vx+w}+\frac{C_1x+D_1}{ax^2+bx+c}+\frac{C_2x+D_2}{(ax^2+bx+c)^2}+\cdots+\frac{C_nx+D_n}{(ax^2+bx+c)^n} }

When it comes to integrating rational functions with higher-degree polynomial denominators, factoring the polynomial alone becomes more and more convoluted. To help us with this process, we use two special theorems in Algebra called Factor Theorem and Rational Root Theorem.

We will then use it to find the factors of any polynomial containing a rational root. This way, we can easily construct partial fraction decompositions of a rational function.

Definition
Rational Root Theorem

The Rational Root Theorem states that given any polynomial in the form

where is the leading coefficient and is the constant term, there exists a set of values where each element of the set is a possible rational root of .
The elements of is determined by:

In simple terms, by just looking at the factors of the leading coefficient and the constant term, we can already determine a set of possible values for the roots of the polynomial. However, we aren’t still so sure as they are only a list of possible roots, not actual roots of the polynomial itself.

Luckily, the Factor Theorem can help us out.

Definition
Factor Theorem

The Factor Theorem states that given any polynomial , is a factor of if .

Since we have a list of possible roots , one strategy is to substitute each one of them into the polynomial. If it equals , then by Factor Theorem, it is a factor of our polynomial.

Worked Example 15
Finding Roots of a Polynomial using Rational Root Theorem

Find the rational roots of the polynomial .

While this may be an extreme case, it can work for any polynomial function. However, take note that this theorem also has its limitations.

  • We can only find rational roots so we won’t be able to find irrational roots or irreducible factors.
  • Some functions may contain multiple repeated factors, and rational root theorem will not be able to account for that.

To resolve this dilemma, we use polynomial division to extract all factors of our polynomial, regardless of whether it has irrational roots or irreducible factors.
We can see this in action as we apply our knowledge in integrating rational functions.

Worked Example #16
Using Rational Root Theorem in Rewriting Integrals

Rewrite the integral below as its partial fraction decomposition.
Do not evaluate the integral.

\begin{array}{r}
x^3+\phantom{0}x^2+\phantom{0}x-3\[-3pt]
x-1\enclose{longdiv}{x^4+0x^3+0x^2-4x+3}\[-3pt]
\underline{-x^4+1x^3\phantom{+0x^2+0x+00}}\[-3pt]
x^3+0x^2\phantom{+0x+00}\[-3pt]
\underline{-x^3+1x^2\phantom{+0x+00}}\[-3pt]
x^2-4x\phantom{+00}\[-3pt]
\underline{-x^2+1x\phantom{+00}}\[-3pt]
-3x+3\[-3pt]
\underline{3x-3}\[-3pt]
0
\end{array}

\begin{array}{r}
x^2+2x+3\[-3pt]
x-1\enclose{longdiv}{x^3+\phantom{1}x^2+\phantom{1}x-3}\[-3pt]
\underline{-x^3+1x^2\phantom{+0x+00}}\[-3pt]
2x^2+1x\phantom{+00}\[-3pt]
\underline{-2x^2+2x\phantom{+00}}\[-3pt]
3x-3\[-3pt]
\underline{-3x+3}\[-3pt]
0
\end{array}

\int\frac{1-2x-2x^2}{x^5-x^4-4x^2+7x-3},dx = \int\frac{1-2x-2x^2}{(x-1)^3(x^2+2x+3)},dx

\int\frac{1-2x-2x^2}{x^5-x^4-4x^2+7x-3},dx= \int\par{\frac{A}{x-1}+\frac{B}{(x-1)^2}+\frac{C}{(x-1)^3}+\frac{Dx+E}{x^2+2x+3}},dx

Now that we took that aside, it’s time to focus on how can we exactly integrate functions with a repeated factor on the denominator.

Worked Example #17
Integrating Functions Resulting in a
Partial Fraction Decomposition with Repeated Factors

Integrate

Further Study

Here’s some extra resources to aid your study!