Integration of Rational Functions

If $f(x)$ and $g(x)$ are polynomials, then the integral of quotient of $f(x)$ and $g(x)$, which is $\displaystyle{\int \frac{f(x)}{g(x)}dx}$, can be obtained by the following method.

Partial Fractions If $\deg f(x) > \deg g(x)$, then let $q(x)$ be the quotient of $f(x)$ and $g(x)$ and the remainder be $r(x)$. Thus

$\displaystyle \frac{f(x)}{g(x)} = q(x) + \frac{r(x)}{g(x)},  {\rm where} \deg r(x) < \deg g(x). $

Note that $q(x)$ is a polynomial. It is easy to integrate.

Check 1. If the degree of a numerator is larger than the degree of a denominator, then divide.
2. Factor the denominator. The number of multiplicity becomes the number of partial fractions.
3. Prodeed partial fraction expansion.

Factoring Denominator Fundamental Theorem of Algebra states that every polynomial can be factored into the product of linear and quadratic polynomials.

Partial Fraction Decomposition A partial fraction decomposition is the operation that consists in expressing the fraction as a sum of a polynomial and one or several fractions whose degree of numerator is one less than the degree of denominator.

Example 3..5   Decompose the following function by partial fraction expansion,

$\displaystyle \frac{3x}{(x-2)^3}$

NOTE The foctors of the denominator is $x-2, (x-2)^2, (x-2)^3$. Thus we need 3 partial fractions. Now inside of parenthesis, we have linear polynomial. Thus, the numerators must be constant.

$\displaystyle \frac{3x}{(x-2)^3} = \frac{A}{x - 2} + \frac{B}{(x - 2)^{2}} +\frac{C}{(x - 2)^{3}}\ensuremath{ \blacksquare}$

Exercise 3..5   Decompose the following function by partial fraction expansion,

$\displaystyle \frac{3x}{(x^2 + 1)^3}$

SOLUTION The factors of denominator are, $x^2+1, (x^2+1)^2, (x^2+1)^3$. Thus we need three partial fractions. Now inside of parenthesis, we have quadratic polynomial. Thus, the numerators must be linear.

$\displaystyle \frac{3x}{(x^2+1)^3} = \frac{Ax+B}{x^2+1} + \frac{Cx+D}{(x^2+1)^{2}} +\frac{Ex+F}{(x^2+1)^{3}}\ensuremath{ \blacksquare}$

Solving Partial Fraction by System of Linear Equations Clear the denominator. Then we a polynomials in both sides of equation. Since the equation must be satisfied by all $x$, the coefficients of two polynomials of the same degree are equal. From this, we get a system of linear equations. Finally solve the system to get $A,B,C,D,\ldots$.

Shortcoming
The method we introduced has some shortcoming. When the degree of denominato gets large. the number of equation in the system gets large, and almost impossible to calculate. Then we introduce other technique called Heaviside Mrthodto solve a patial fraction.

Example 3..6   Find the partial fraction of the following function.

$\displaystyle \frac{3x}{(x-2)^3}$

$\frac{3x}{(x-2)^3} = \frac{A}{x - 2} + \frac{B}{(x - 2)^{2}} +\frac{C}{(x - 2)^{3}}$. Clear the denominator and let $x \to 2$. Then $\lim_{x \to 2}3x = \lim_{x \to 2} (A(x-2)^2 + B(x-2) + C)$. Then $C = 6$. This is a part of Heaviside method.. SOLUTION By Example3.5, $\frac{3x}{(x-2)^3} = \frac{A}{x - 2} + \frac{B}{(x - 2)^{2}} +\frac{C}{(x - 2)^{3}}$. Now clear the denominator and simplify to get

$\displaystyle 3x$ $\displaystyle =$ $\displaystyle A(x-2)^2 + B(x-2) + C = Ax^2 - 4Ax + 4A + Bx - 2B + C$  
  $\displaystyle =$ $\displaystyle Ax^2 + (-4A + B)x + (4A-2B+C).$  

Now the coefficients of two polynomials of the same degree are equal.

$\displaystyle A = 0, -4A + B = 3, 4A-2B+C = 0.$

Solving this to get $A = 0,  B = 3,  C = 6$,

$\displaystyle \frac{3x}{(x-2)^3} = \frac{3}{(x - 2)^{2}} +\frac{6}{(x - 2)^{3}}.$

Exercise 3..6   Find the partial fraction of the following function.

$\displaystyle \frac{3x}{(x^2 + 1)^3}$

The degree of the polynomial inside a parenthesis is two and the degree of the numerator is one. Then no more partial fraction decomposition. SOLUTION $\frac{3x}{(x^2+1)^3} = \frac{Ax+B}{x^2+1} + \frac{Cx+D}{(x^2+1)^{2}} +\frac{Ex+F}{(x^2+1)^{3}}$. Clear the denominator,

$\displaystyle 3x$ $\displaystyle =$ $\displaystyle (Ax+B)(x^2 + 1)^2 + (Cx + D)(x^2 + 1) + Ex + F$  
  $\displaystyle =$ $\displaystyle Ax^5 + Bx^4 + 2Ax^3 + 2Bx^2 + Ax + B + Cx^3 + Dx^2 + Cx + D + Ex + F$  
  $\displaystyle =$ $\displaystyle Ax^5 + Bx^4 + (2A + C)x^3 + (2B+ D)x^2 + (A + C + E)x + (B + D + F).$  

Now $A = 0, B = 0, 2A + C = 0, 2B + D = 0, A + C+ E = 3, B + D+ F = 0$. Then $C = 0, D = 0$, Since $A + C +E = 3$, $E = 3$, $F = 0$. Therefore,

$\displaystyle \frac{3x}{(x^2+1)^3} = \frac{0}{x^2+1} + \frac{0}{(x^2+1)^{2}} +\frac{3x}{(x^2+1)^{3}}$

which is the same as the original fraction. If we let $t = x^2 + 1$, then we can solve this problem. $ \blacksquare$

Partial Fraction of Rational Function Every rational function $\displaystyle{\frac{f(x)}{g(x)}}$ can be decomposed by partial fraction to get a sum of the following functions..

$\displaystyle \frac{A}{(x - a)^{n}},   \frac{Bx+C}{\{(x-a)^{2}+b^{2}\}^{n}} $

Let $t = x^2 + 1$. Then $dt = 2xdx$ and

    $\displaystyle \int \frac{3x}{(x^2 + 1)^3}dx$  
  $\displaystyle =$ $\displaystyle \int \frac{3/2}{t^3}dt$  
  $\displaystyle =$ $\displaystyle \frac{3}{2}\int t^{-3}\:dx$  
  $\displaystyle =$ $\displaystyle \frac{3}{2}(-\frac{1}{2})t^{-2} + c$  
  $\displaystyle =$ $\displaystyle -\frac{3}{4(x^2 + 1)^2} + c$  

If we let $t = x - a$. Then it is given in one of the following forms.

$\displaystyle \frac{1}{t^n},  \frac{1}{(t^{2} + b^{2})^{n}},   \frac{t}{(t^{2} + b^{2})^{n}}. $

Put together, every integration of rational function can be solved by solving the following integrals. Integration of Rational Function

Theorem 3..6  

$\displaystyle{1.  \int \frac{dx}{(x-a)^{n}} = \left\{\begin{array}{ll}
\frac{-...
...c & (n = 2,3,4,\ldots)\\
\log{\vert x-a\vert} + c & (n=1)
\end{array}\right. }$

$\displaystyle{2.  \int \frac{x}{(x^{2} +b^{2})^{n}}dx = \left\{\begin{array}{l...
...,3,4,\ldots)\\
\frac{1}{2}\log{( x^{2}+b^{2})} + c & (n=1)
\end{array}\right.}$

$\displaystyle{3.  {\rm Let} I_{n} = \int \frac{dx}{(x^{2} + A)^{n}}}$. Then the following recurrence relation holds.

$\displaystyle I_{n+1} = \frac{1}{2nA} \{\frac{x}{(x^{2}+A)^{n}} + (2n-1)I_{n}\}  (n \geq 1)$

Proof 1. Let $t = x - a$. Then $dt = dx$ and

$\displaystyle \int \frac{dx}{(x-a)^n}$ $\displaystyle =$ $\displaystyle \int \frac{dt}{t^n} = \int t^{-n}dt$  

For $n=1$, we have
$\displaystyle \int t^{-1}dt$ $\displaystyle =$ $\displaystyle \int \frac{1}{t}dt = \log\vert t\vert + c = \log\vert x-a\vert + c.$  

For $n \neq 1$,
$\displaystyle \int t^{-n}dt$ $\displaystyle =$ $\displaystyle \frac{1}{-n+1}t^{-n+1} + c = \frac{1}{-n+1}(x-a)^{-n+1} + c.$  

2. Let $t = x^2 + b^2$. Then $dt = 2xdx$ and

$\displaystyle \int \frac{x dx}{(x^2 + b^2)^{n}}$ $\displaystyle =$ $\displaystyle \frac{1}{2}\int \frac{dt}{t^{n}} = \frac{1}{2}\int t^{-n} dt$  

For $n=1$, we have

$\displaystyle \int \frac{1}{2}t^{-1}dt$ $\displaystyle =$ $\displaystyle \frac{1}{2} \int \frac{1}{t}dt = \frac{1}{2}\log\vert t\vert + c = \frac{1}{2}\log(x^2 + b^2) + c.$  

For $n \neq 1$,
$\displaystyle \int \frac{1}{2}t^{-n}dt$ $\displaystyle =$ $\displaystyle \frac{1}{2} \big(\frac{1}{-n+1}\big)t^{-n+1} + c = \frac{1}{2} \big(\frac{1}{-n+1}\big)(x^2 + b^2)^{-n+1} + c.$  

Check
\begin{displaymath}\begin{array}{ll}
& (\frac{1}{(x^2 + A)^n})' \\
& = \frac{-(...
...\
& = \frac{-n(x^2 + A)^{n-1}(2x)}{(x^2 + A)^{2n}}
\end{array}\end{displaymath}.

3. Integration by parts, we have

$\left\{\begin{array}{lcl}
f = \frac{1}{(x^2 + A)^n} && g' = 1\\
&\searrow&\\
...
... \frac{-2nx(x^2+A)^{n-1}}{(x^2 + A)^{2n}} &\leftarrow& g = x
\end{array}\right.$. Then

$\displaystyle I_{n} = \int \frac{dx}{(x^{2} + A)^{n}}$ $\displaystyle =$ $\displaystyle \frac{x}{(x^{2}+A)^{n}} + 2n\int\frac{x^{2}dx}{(x^{2}+A)^{n+1}}$  
  $\displaystyle =$ $\displaystyle \frac{x}{(x^{2}+A)^{n}} + 2n\int \frac{x^{2}+A-A}{(x^{2}+A)^{n+1}}dx$  
  $\displaystyle =$ $\displaystyle \frac{x}{(x^{2}+A)^{n}} + 2nI_{n} - 2nAI_{n+1}
\ensuremath{ \blacksquare}$  

Check
Express $\frac{x^2}{(x^2 + A)^{n+1}}$ as $\frac{x^2 +A - A}{(x^2 + A)^{n+1}}$ $= \frac{1}{(x^2 + A)^n} - \frac{A}{(x^2 + A)^{n+1}}$.

Example 3..7   Find the following integral

$\displaystyle \int \frac{x^{4}}{x^{3} - 1} dx$

Instead of dividing $x^4$ by $x^3 - 1$, write $x^4 = x(x^3 - 1) + x$ to get the same result. SOLUTION $\deg(x^4) > \deg(x^3 -1)$. Thus divide the numerator by the denominator.

$\displaystyle \frac{x^4}{x^3 -1} = \frac{x(x^3 -1) + x}{x^3 - 1} = x + \frac{x}{x^3 - 1}.$

Now factor the denominator.

$\displaystyle \frac{x^4}{x^3 -1} = x + \frac{x}{(x-1)(x^2 + x + 1)}.$

Then by partial fraction decomposition.
Check
Since the denominator is $x^2+x+1$, the numerator must be a linear polynomial.


$\displaystyle \frac{x}{(x-1)(x^2 + x + 1)} = \frac{A}{x-1} + \frac{Bx + C}{x^2 + x + 1}.$      

Clear the denominator and simplify,

$\displaystyle x = A(x^2 + x + 1) + (x-1)(Bx + C) = (A + B)x^2 + (A - B +C)x + (A - C). $

Setting the coefficient of the same degree is equal.

$\displaystyle A+B = 0, A - B + C = 1, A- C = 0$

Solving $\displaystyle{A = \frac{1}{3},  B = -\frac{1}{3},  C = \frac{1}{3}}$. Thus
$\displaystyle \int \frac{x^{4}}{x^3 -1} dx$ $\displaystyle =$ $\displaystyle \int (x + \frac{1/3}{x -1} + \frac{-x/3 + 1/3}{x^2 + x + 1})dx$  
  $\displaystyle =$ $\displaystyle \frac{1}{2}x^{2} + \frac{1}{3}\log{\vert x-1\vert} - \frac{1}{3}[\int \frac{x-1}{x^2 + x+ 1} dx]$  


$\displaystyle \int \frac{x^{4}}{x^3 -1}$ $\displaystyle =$ $\displaystyle \frac{1}{2}x^{2} + \frac{1}{3}\log{\vert x-1\vert} - \frac{1}{3}[\int \frac{x-1}{(x +\frac{1}{2})^{2} + \frac{3}{4}} dx]$  

Let $\displaystyle{x + \frac{1}{2} = t}$. Then $dx = dt, x = t - \frac{1}{2}$.
$\displaystyle \int \frac{x-1}{(x +\frac{1}{2})^{2} + \frac{3}{4}} dx$ $\displaystyle =$ $\displaystyle \int \frac{t - 3/2}{t^2 + (\frac{\sqrt{3}}{2})^{2}} dt$  
  $\displaystyle =$ $\displaystyle \int \frac{t}{t^2 + (\frac{\sqrt{3}}{2})^{2}} dt - \frac{3}{2} \int \frac{1}{t^2 + (\frac{\sqrt{3}}{2})^{2}} dt$  
  $\displaystyle =$ $\displaystyle \frac{1}{2}\log{(t^2 + (\frac{\sqrt{3}}{2})^{2})} - \frac{3}{2}\frac{2}{\sqrt{3}}\tan^{-1}{\left(\frac{2t}{\sqrt{3}}\right)} + c$  
  $\displaystyle =$ $\displaystyle \frac{1}{2} \log{(x^2 + x+ 1)} - \sqrt{3}\tan^{-1}{\left(\frac{2x + 1}{\sqrt{3}}\right)} + c.$  

Check
The degree of the denominator of $\frac{x-1}{x^2 + x+ 1}$ is two. Complete the square.
$x^2 + x + 1 = (x + \frac{1}{2})^2 + \frac{3}{4}$.

Check
$\int \frac{t}{t^2 + (\frac{\sqrt{3}}{2})^{2}} dt$. Let $u = t^2 + (\frac{\sqrt{3}}{2})^2$ and $du = 2t\:dt$. $\int \frac{t}{t^2 + (\frac{\sqrt{3}}{2})^{2}} dt = \int \frac{1}{2}\frac{du}{u}...
...rac{1}{2}\log\vert u\vert +c = \frac{1}{2}\log(t^2 + (\frac{\sqrt{3}}{2})^2) +c$.

Exercise 3..7   Find the integral of the following.

$\displaystyle \int{\frac{dx}{(x^2 + 16)^2}}$

SOLUTION Let $I_n = \int \frac{1}{(x^2 + 16)^n}\: dx$. Then $\left\{\begin{array}{lcl}
f = \frac{1}{(x^2 + 16)}, && g' = 1\\
&\searrow& \\
f' = -\frac{2x}{(x^2 + 16)^2}, &\leftarrow& g = x
\end{array}\right.$

$\displaystyle I_{1}$ $\displaystyle =$ $\displaystyle \int{\frac{dx}{(x^2 + 16)}} = \frac{x}{(x^2 + 16)} + 2\int{\frac{x^2}{(x^2 + 16)^2}}dx$  
  $\displaystyle =$ $\displaystyle \frac{x}{(x^2 + 16)} + 2\int{\frac{x^2+16 -16}{(x^2 + 16)^2}}dx$  
  $\displaystyle =$ $\displaystyle \frac{x}{(x^2 + 16)} + 2\int{\frac{1}{(x^2 + 16)}}dx -32 \int{\frac{1}{(x^2 + 16)^2}}dx$  
  $\displaystyle =$ $\displaystyle \frac{x}{(x^2 + 16)} + 2I_{1} - 32I_{2}$  

Thus,
Check
$\int \frac{1}{x^2 + 16}dx = \int \frac{1}{x^2 + 4^2}dx = \frac{1}{4}\tan^{-1}{\frac{x}{4}} + c$.

$\displaystyle I_{2} = \frac{1}{32}[\frac{x}{(x^2 + 16)} + I_{1}] = \frac{1}{128}[\frac{4x}{(x^2 + 16)} + \tan^{-1}(\frac{x}{4})] + c$

Exercise A

1.
Find the partial fraction expansion of the following functions

(a) $\displaystyle{f(x) = \frac{7}{(x-2)(x+5)} }$ (b) $\displaystyle{f(x) = \frac{x^2 + 1}{x(x^2 - 1)}}$ (c) $\displaystyle{f(x) = \frac{x^2 + 3}{x^2 - 3x + 2}}$ (d) $\displaystyle{f(x) = \frac{x^2}{(x - 1)^2(x + 1)}}$ (e) $\displaystyle{f(x) = \frac{x^{5}}{(x-2)^2}}$ (f) $\displaystyle{f(x) = \frac{x+1}{x(x^{2} + 1)}}$

Exercise B

1.
Work out the following integrals

(a) $\displaystyle{\int{\frac{7}{(x-2)(x+5)}} dx}$ (b) $\displaystyle{\int{\frac{x^2 + 1}{x(x^2 - 1)}} dx}$ (c) $\displaystyle{\int{\frac{x^2 + 3}{x^2 - 3x + 2}} dx}$

(d) $\displaystyle{\int{\frac{x^2}{(x - 1)^2(x + 1)}} dx}$ (e) $\displaystyle{\int{\frac{dx}{(x^2 + 16)^2}}}$ (f) $\displaystyle{\int{\frac{x^{5}}{(x-2)^2}} dx}$

(g) $\displaystyle{\int{\frac{x^5}{x^9 - 1}} dx   (x^3 = t)}$ (h) $\displaystyle{\int{\frac{dx}{x(x^4 + 1)}}   (x^4 = t)}$