Integration of Rational Functions

Trigonometry

Trigonometry Logo

Integration of Rational Functions

Recall that a rational function is a ratio of two polynomials \(\frac{{P\left( x \right)}}{{Q\left( x \right)}}.\)

We will assume that we have a proper rational function in which the degree of the numerator is less than the degree of the denominator.

In order to convert improper rational function into a proper one, we can use long division:

\[\frac{{P\left( x \right)}}{{Q\left( x \right)}} = F\left( x \right) + \frac{{R\left( x \right)}}{{Q\left( x \right)}},\]

where \(F\left( x \right)\) is a polynomial, \(\frac{{R\left( x \right)}}{{Q\left( x \right)}}\) is a proper rational function.

To integrate a proper rational function, we can apply the method of partial fractions.

This method allows to turn the integral of a complicated rational function into the sum of integrals of simpler functions.

The denominators of the partial fractions can contain nonrepeated linear factors, repeated linear factors, nonrepeated irreducible quadratic factors, and repeated irreducible quadratic factors.

To evaluate integrals of partial fractions with linear or quadratic denominators, we use the following \(6\) formulas:

\[1.\;\int {\frac{Adx}{{ax + b}}} = A\ln \left| {ax + b} \right|\]
\[2.\;\int {\frac{Adx}{{{{\left( {ax + b} \right)}^k}}}} = \frac{A}{{a\left( {1 - k} \right){{\left( {ax + b} \right)}^{k - 1}}}}\]

For partial fractions with irreducible quadratic denominators, we first complete the square:

\[a{x^2} + bx + c = a\left[ {{{\left( {x + \frac{b}{{2a}}} \right)}^2} + \frac{{4ac - {b^2}}}{{4{a^2}}}} \right].\]

Hence, we can write:

\[\int {\frac{{Ax + B}}{{{{\left( {a{x^2} + bx + c} \right)}^k}}}dx} = \int {\frac{{At + B^\prime}}{{{{\left[ {a\left( {{t^2} + {m^2}} \right)} \right]}^k}}}dt} = \frac{1}{{{a^k}}}\int {\frac{{At + B^\prime}}{{{{\left( {{t^2} + {m^2}} \right)}^k}}}dt} ,\]

where

\[t = x + \frac{b}{{2a}},\;\;{m^2} = \frac{{4ac - {b^2}}}{{4{a^2}}},\;\;B^\prime = B - \frac{{Ab}}{{2a}}.\]

The possible cases for fractions with quadratic denominators are covered by the following integrals:

\[3.\;\int {\frac{{tdt}}{{{t^2} + {m^2}}}} = \frac{1}{2}\ln \left( {{t^2} + {m^2}} \right)\]
\[4.\;\int {\frac{{dt}}{{{t^2} + {m^2}}}} = \frac{1}{m}\arctan \frac{t}{m}\]
\[5.\;\int {\frac{{tdt}}{{{{\left( {{t^2} + {m^2}} \right)}^k}}}} = \frac{1}{{2\left( {1 - k} \right){{\left( {{t^2} + {m^2}} \right)}^{k - 1}}}}\]

Finally, the integral \(\int {\frac{{dt}}{{{{\left( {{t^2} + {m^2}} \right)}^k}}}} \) can be evaluated in \(k\) steps using the reduction formula

\[6.\;\int {\frac{{dt}}{{{{\left( {{t^2} + {m^2}} \right)}^k}}}} = \frac{t}{{2{m^2}\left( {k - 1} \right){{\left( {{t^2} + {m^2}} \right)}^{k - 1}}}} + \frac{{2k - 3}}{{2{m^2}\left( {k - 1} \right)}}\int {\frac{{dt}}{{{{\left( {{t^2} + {m^2}} \right)}^{k - 1}}}}}\]

Solved Problems

Click or tap a problem to see the solution.

Example 1

Find the integral \[\int {\frac{{x + 2}}{{x - 1}} dx}.\]

Example 2

Evaluate the integral \[\int {{\frac{{2x + 3}}{{{x^2} - 9}}} dx}.\]

Example 3

Find the integral \[\int {\frac{{2{x^2}}}{{x + 1}} dx}.\]

Example 4

Evaluate \[\int {{\frac{{{x^2} - 2}}{{x + 1}}} dx}.\]

Example 5

Find the integral \[\int {\frac{{dx}}{{\left( {2x - 1} \right)\left( {x + 3} \right)}}}.\]

Example 6

Find the integral \[\int {\frac{x}{{{x^2} - 9}} dx}.\]

Example 7

Evaluate the integral \[\int {\frac{{dx}}{{{x^2} + 4x + 8}}}.\]

Example 8

Evaluate the integral \[\int {\frac{{xdx}}{{{x^2} + 2x + 1}}}.\]

Example 1.

Find the integral \[\int {\frac{{x + 2}}{{x - 1}} dx}.\]

Solution.

As the rational fraction in the integrand is improper we perform a long division to get

\[\frac{{x + 2}}{{x - 1}} = 1 + \frac{3}{{x - 1}}.\]

Now we can easily evaluate the integral:

\[\int {\frac{{x + 2}}{{x - 1}}dx} = \int {\left( {1 + \frac{3}{{x - 1}}} \right)dx} = \int {dx} + 3\int {\frac{{dx}}{{x - 1}}} = x + 3\ln \left| {x - 1} \right| + C.\]

Example 2.

Evaluate the integral \[\int {{\frac{{2x + 3}}{{{x^2} - 9}}} dx}.\]

Solution.

We decompose the integrand into partial functions:

\[\frac{{2x + 3}}{{{x^2} - 9}} = \frac{{2x + 3}}{{\left( {x - 3} \right)\left( {x + 3} \right)}} = \frac{A}{{x - 3}} + \frac{B}{{x + 3}}.\]

Equate the coefficients:

\[A\left( {x + 3} \right) + B\left( {x - 3} \right) = 2x + 3,\;\; \Rightarrow Ax + 3A + Bx - 3B = 2x + 3,\;\; \Rightarrow \left( {A + B} \right)x + 3A - 3B = 2x + 3.\]

Hence,

\[ \left\{ \begin{array}{l} A + B = 2\\ 3A - 3B = 3 \end{array} \right.,\;\; \Rightarrow \left\{ \begin{array}{l} A = \frac{3}{2}\\ B = \frac{1}{2} \end{array} \right..\]

Then

\[\frac{{2x + 3}}{{{x^2} - 9}} = \frac{{\frac{3}{2}}}{{x - 3}} + \frac{{\frac{1}{2}}}{{x + 3}}.\]

The integral is equal to

\[\int {\frac{{2x + 3}}{{{x^2} - 9}}dx} = \frac{3}{2}\int {\frac{{dx}}{{x - 3}}} + \frac{1}{2}\int {\frac{{dx}}{{x + 3}}} = \frac{3}{2}\ln \left| {x - 3} \right| + \frac{1}{2}\ln \left| {x + 3} \right| + C = \frac{1}{2}\ln \left| {{{\left( {x - 3} \right)}^3}\left( {x + 3} \right)} \right| + C.\]

Example 3.

Find the integral \[\int {\frac{{2{x^2}}}{{x + 1}} dx}.\]

Solution.

Since the rational fraction in the integrand is improper we perform a long division to obtain

\[\frac{{{x^2}}}{{x + 1}} = x - 1 + \frac{1}{{x + 1}}.\]

Hence

\[\int {\frac{{2{x^2}}}{{x + 1}}dx} = 2\int {\frac{{{x^2}}}{{x + 1}}dx} = 2\int {\left( {x - 1 + \frac{1}{{x + 1}}} \right)dx} = 2\left[ {\int {xdx} - \int {dx} + \int {\frac{{dx}}{{x + 1}}} } \right] = 2\left( {\frac{{{x^2}}}{2} - x + \ln \left| {x + 1} \right|} \right) + C = {x^2} - 2x + 2\ln \left| {x + 1} \right| + C.\]

Example 4.

Evaluate \[\int {{\frac{{{x^2} - 2}}{{x + 1}}} dx}.\]

Solution.

First we divide the numerator by the denominator, obtaining

\[\frac{{{x^2} - 2}}{{x + 1}} = x - 1 - \frac{1}{{x + 1}}.\]

Then

\[\int {\frac{{{x^2} - 2}}{{x + 1}}dx} = \int {\left( {x - 1 - \frac{1}{{x + 1}}} \right)dx} = \int {xdx} - \int {dx} - \int {\frac{{dx}}{{x + 1}}} = \frac{{{x^2}}}{2} - x - \ln \left| {x + 1} \right| + C.\]

Example 5.

Find the integral \[\int {\frac{{dx}}{{\left( {2x - 1} \right)\left( {x + 3} \right)}}}.\]

Solution.

First we decompose the integrand:

\[\frac{1}{{\left( {2x - 1} \right)\left( {x + 3} \right)}} = \frac{A}{{2x - 1}} + \frac{B}{{x + 3}}.\]

Determine the coefficients \(A\) and \(B:\)

\[1 = A\left( {x + 3} \right) + B\left( {2x - 1} \right),\]
\[1 = Ax + 3A + 2Bx - B,\]
\[1 = \left( {A + 2B} \right)x + \left( {3A - B} \right).\]

We get the following system:

\[\left\{ \begin{array}{l} A + 2B = 0\\ 3A - B = 1 \end{array} \right.,\;\; \Rightarrow \left\{ \begin{array}{l} A + 2\left( {3A - 1} \right) = 0\\ B = 3A - 1 \end{array} \right.,\;\; \Rightarrow \left\{ \begin{array}{l} 7A - 2 = 0\\ B = 3A - 1 \end{array} \right.,\;\; \Rightarrow \left\{ \begin{array}{l} A = \frac{2}{7}\\ B = - \frac{1}{7} \end{array} \right..\]

So the partial fraction decomposition has the form

\[\frac{1}{{\left( {2x - 1} \right)\left( {x + 3} \right)}} = \frac{2}{{7\left( {2x - 1} \right)}} - \frac{1}{{7\left( {x + 3} \right)}}.\]

The initial integral is written as the sum of two simpler integrals:

\[I = \int {\frac{{dx}}{{\left( {2x - 1} \right)\left( {x + 3} \right)}}} = \frac{2}{7}\int {\frac{{dx}}{{2x - 1}}} - \frac{1}{7}\int {\frac{{dx}}{{x + 3}}} .\]

Integrating yields:

\[I = \frac{2}{7} \cdot \frac{1}{2}\ln \left| {2x - 1} \right| - \frac{1}{7}\ln \left| {x + 3} \right| + C = \frac{1}{7}\left( {\ln \left| {2x - 1} \right| - \ln \left| {x + 3} \right|} \right) + C = \frac{1}{7}\ln \left| {\frac{{2x - 1}}{{x + 3}}} \right| + C.\]

Example 6.

Find the integral \[\int {\frac{x}{{{x^2} - 9}} dx}.\]

Solution.

We decompose the rational function:

\[\frac{x}{{{x^2} - 9}} = \frac{x}{{\left( {x - 3} \right)\left( {x + 3} \right)}} = \frac{A}{{x - 3}} + \frac{B}{{x + 3}}.\]

Calculate the unknown coefficients:

\[x = A\left( {x + 3} \right) + B\left( {x - 3} \right),\]
\[x = Ax + 3A + Bx - 3B,\]
\[x = \left( {A + B} \right)x + \left( {3A - 3B} \right).\]

Hence

\[\left\{ \begin{array}{l} A + B = 1\\ 3A - 3B = 0 \end{array} \right.,\;\; \Rightarrow \left\{ \begin{array}{l} A + B = 1\\ A - B = 0 \end{array} \right.,\;\; \Rightarrow \left\{ \begin{array}{l} A = \frac{1}{2}\\ B = \frac{1}{2} \end{array} \right..\]

The partial fraction decomposition has the form

\[\frac{x}{{{x^2} - 9}} = \frac{1}{2}\left( {\frac{1}{{x - 3}} + \frac{1}{{x + 3}}} \right).\]

Now we can easily evaluate the integral:

\[\int {\frac{x}{{{x^2} - 9}}dx} = \frac{1}{2}\int {\frac{{dx}}{{x - 3}}} + \frac{1}{2}\int {\frac{{dx}}{{x + 3}}} = \frac{1}{2}\ln \left| {x - 3} \right| + \frac{1}{2}\ln \left| {x + 3} \right| + C = \frac{1}{2}\ln \left| {\left( {x - 3} \right)\left( {x + 3} \right)} \right| + C = \frac{1}{2}\ln \left| {{x^2} - 9} \right| + C.\]

Example 7.

Evaluate the integral \[\int {\frac{{dx}}{{{x^2} + 4x + 8}}}.\]

Solution.

We can write:

\[\int {\frac{{dx}}{{{x^2} + 4x + 8}}} = \int {\frac{{dx}}{{{x^2} + 4x + 4 + 4}}} = \int {\frac{{dx}}{{{{\left( {x + 2} \right)}^2} + 4}}} = \int {\frac{{d\left( {x + 2} \right)}}{{{{\left( {x + 2} \right)}^2} + {2^2}}}} = \frac{1}{2}\arctan \frac{{x + 2}}{2} + C.\]

Example 8.

Evaluate the integral \[\int {\frac{{xdx}}{{{x^2} + 2x + 1}}}.\]

Solution.

We notice the perfect square in the denominator, so we can simplify the integral and write it as follows:

\[I = \int {\frac{{xdx}}{{{x^2} + 2x + 1}}} = \int {\frac{{xdx}}{{{{\left( {x + 1} \right)}^2}}}} = \int {\frac{{x + 1 - 1}}{{{{\left( {x + 1} \right)}^2}}}dx} = \int {\frac{{x + 1}}{{{{\left( {x + 1} \right)}^2}}}dx} - \int {\frac{{dx}}{{{{\left( {x + 1} \right)}^2}}}} = \int {\frac{{dx}}{{x + 1}}} - \int {\frac{{dx}}{{{{\left( {x + 1} \right)}^2}}}} .\]

The last two integral can be found in standard integration tables. Hence

\[I = \int {\frac{{dx}}{{x + 1}}} - \int {\frac{{dx}}{{{{\left( {x + 1} \right)}^2}}}} = \ln \left| {x + 1} \right| + \frac{1}{{x + 1}} + C.\]