Primitives of Rational Functions (Partial Fraction Decomposition)

This part deals with only one subject: How to find primitives of rational functions, i.e. of functions of the type $f=\frac{r}{s}$ with polynomials r and s. Without restriction we assume s to be non constant and normalized.

On intervals, for example between two adjacent zeros of s, f has a primitive as it is continuous. There is a concept to calculate these primitives which is essentially related to two basic theorems on polynomials:

• Fundamental Theorem of Algebra

Each non constant normalized polynomial s on $ℝ$ completely decomposes into a product of linear and indecomposable quadratic polynomials:

$s={\left(\mathrm{X}-{a}_{1}\right)}^{{l}_{1}}\cdot \dots \cdot {\left(\mathrm{X}-{a}_{j}\right)}^{{l}_{j}}\cdot \left({\mathrm{X}}^{2}+{p}_{1}\mathrm{X}+{q}_{1}{\right)}^{{n}_{1}}\cdot \dots \cdot \left({\mathrm{X}}^{2}+{p}_{k}\mathrm{X}+{q}_{k}{\right)}^{{n}_{k}}$[1]

where the discriminant of a quadratic polynomial controls its decomposability:

${\mathrm{X}}^{2}+{p}_{i}\mathrm{X}+{q}_{i}$ is indecomposable$\text{ }⇔\text{ }{D}_{i}=\frac{{p}_{i}^{2}}{4}-{q}_{i}<0$

So we know that ${\mathrm{X}}^{2}+{p}_{i}\mathrm{X}+{q}_{i}\left(0\right)={q}_{i}>0$ and that, consequently, all values of ${\mathrm{X}}^{2}+{p}_{i}\mathrm{X}+{q}_{i}$ are positive. (Continuous functions with no zeros do not vary their algebraic sign on intervals!)

• Partial Fraction Theorem

Based on the decomposition [1] each rational function with a non constant mormalized denominator s is representable as a sum:

$\begin{array}{ll}\frac{r}{s}=t\hfill & +\frac{{c}_{11}}{\mathrm{X}-{a}_{1}}+\frac{{c}_{12}}{{\left(\mathrm{X}-{a}_{1}\right)}^{2}}+\dots +\frac{{c}_{1{l}_{1}}}{{\left(\mathrm{X}-{a}_{1}\right)}^{{l}_{1}}}\hfill \\ \hfill & +\dots \hfill \\ \hfill & +\frac{{c}_{j1}}{\mathrm{X}-{a}_{j}}+\frac{{c}_{j2}}{{\left(\mathrm{X}-{a}_{j}\right)}^{2}}+\dots +\frac{{c}_{j{l}_{j}}}{{\left(\mathrm{X}-{a}_{j}\right)}^{{l}_{j}}}\hfill \\ \hfill & +\frac{{m}_{11}\mathrm{X}+{b}_{11}}{{\mathrm{X}}^{2}+{p}_{1}\mathrm{X}+{q}_{1}}+\frac{{m}_{12}\mathrm{X}+{b}_{12}}{\left({\mathrm{X}}^{2}+{p}_{1}\mathrm{X}+{q}_{1}{\right)}^{2}}+\dots +\frac{{m}_{1{n}_{1}}\mathrm{X}+{b}_{1{n}_{1}}}{\left({\mathrm{X}}^{2}+{p}_{1}\mathrm{X}+{q}_{1}{\right)}^{{n}_{1}}}\hfill \\ \hfill & +\dots \hfill \\ \hfill & +\frac{{m}_{k1}\mathrm{X}+{b}_{k1}}{{\mathrm{X}}^{2}+{p}_{k}\mathrm{X}+{q}_{k}}+\frac{{m}_{k2}\mathrm{X}+{b}_{k2}}{\left({\mathrm{X}}^{2}+{p}_{k}\mathrm{X}+{q}_{k}{\right)}^{2}}+\dots +\frac{{m}_{k{n}_{k}}\mathrm{X}+{b}_{k{n}_{k}}}{\left({\mathrm{X}}^{2}+{p}_{k}\mathrm{X}+{q}_{k}{\right)}^{{n}_{k}}}\hfill \end{array}$

t being a suitable polynomial such that $t=0$ if $\text{grad}\text{\hspace{0.28em}}r<\text{grad}\text{\hspace{0.28em}}s$ and $\text{grad}\text{\hspace{0.28em}}t=\text{grad}\text{\hspace{0.28em}}r-\text{grad}\text{\hspace{0.28em}}s$ otherweise.

Both theorems, especially the fundamental theorem, are pure existence theorems! And it is this fact that causes actual problems when it comes to application: Apart from simple and clear cut cases it is nearly impossible to get the necessary denominator's decomposition.

 Example:  We find a partial decomposition for $f=\frac{2{\mathrm{X}}^{5}-4{\mathrm{X}}^{4}+10{\mathrm{X}}^{3}-17{\mathrm{X}}^{2}+6\mathrm{X}-3}{{\mathrm{X}}^{4}-2{\mathrm{X}}^{3}+3{\mathrm{X}}^{2}-4\mathrm{X}+2}$  First we (sequentially) discover that 1 is a double zero of the denominator so that a twofold polynomial division yields the decomposition ${\mathrm{X}}^{4}-2{\mathrm{X}}^{3}+3{\mathrm{X}}^{2}-4\mathrm{X}+2={\left(\mathrm{X}-1\right)}^{2}\cdot \left({\mathrm{X}}^{2}+2\right)$  and a further polynomial division then provides the identity $f=2\mathrm{X}+\frac{4{\mathrm{X}}^{3}-9{\mathrm{X}}^{2}+2\mathrm{X}-3}{{\left(\mathrm{X}-1\right)}^{2}\cdot \left({\mathrm{X}}^{2}+2\right)}$ Finally, comparing the coefficients in the ansatz $\begin{array}{ll}\hfill & \frac{4{\mathrm{X}}^{3}-9{\mathrm{X}}^{2}+2\mathrm{X}-3}{{\left(\mathrm{X}-1\right)}^{2}\cdot \left({\mathrm{X}}^{2}+2\right)}\hfill \\ =\hfill & \frac{{c}_{11}}{\mathrm{X}-1}+\frac{{c}_{12}}{{\left(\mathrm{X}-1\right)}^{2}}+\frac{{m}_{11}\mathrm{X}+{b}_{11}}{{\mathrm{X}}^{2}+2}\hfill \\ =\hfill & \frac{{c}_{11}\left(\mathrm{X}-1\right)\left({\mathrm{X}}^{2}+2\right)+{c}_{12}\left({\mathrm{X}}^{2}+2\right)+\left({m}_{11}\mathrm{X}+{b}_{11}\right){\left(\mathrm{X}-1\right)}^{2}}{{\left(\mathrm{X}-1\right)}^{2}\left({\mathrm{X}}^{2}+2\right)}\hfill \\ =\hfill & \frac{\left({c}_{11}+{m}_{11}\right){\mathrm{X}}^{3}+\left(-{c}_{11}+{c}_{12}-2{m}_{11}+{b}_{11}\right){\mathrm{X}}^{2}+\left(2{c}_{11}+{m}_{11}-2{b}_{11}\right)\mathrm{X}-2{c}_{11}+2{c}_{12}+{b}_{11}}{{\left(\mathrm{X}-1\right)}^{2}\left({\mathrm{X}}^{2}+2\right)}\hfill \end{array}$ yields the following linear system of equations $\begin{array}{lllll}\hfill {c}_{11}+{m}_{11}& =4\hfill & \text{ }⇔\text{ }\hfill & \hfill {c}_{11}& =0\hfill \\ \hfill -{c}_{11}+{c}_{12}-2{m}_{11}+{b}_{11}& =-9\hfill & \hfill {c}_{12}& =-2\hfill \\ \hfill 2{c}_{11}+{m}_{11}-2{b}_{11}& =2\hfill & \hfill {m}_{11}& =4\hfill \\ \hfill -2{c}_{11}+2{c}_{12}+{b}_{11}& =-3\hfill & \hfill {b}_{11}& =1\hfill \end{array}$ f thus decomposes like this $f=2\mathrm{X}-\frac{2}{{\left(\mathrm{X}-1\right)}^{2}}+\frac{4\mathrm{X}+1}{{\mathrm{X}}^{2}+2}$[2]

With a partial decomposition of f at hand, a primitive of f is easily found if we know primitives for each addend. This reduces our problem to only two types of rational functions, namely ($k\in ℕ$)

1. $\frac{c}{{\left(\mathrm{X}-a\right)}^{k}}$

2. $\frac{m\mathrm{X}+b}{\left({\mathrm{X}}^{2}+p\mathrm{X}+q{\right)}^{k}}$  where  $D=\frac{{p}^{2}}{4}-q<0$

Quotients of the first kind are easy to deal with, except for the case $k=1$ which needs the natural logarithm ln
 i
from chapter 8.

Proposition:

 $c\cdot \mathrm{ln}|\mathrm{X}-a|$  is a primitive function of  $\frac{c}{\mathrm{X}-a}$. [8.0.1] If $k>1$ then  $\frac{1}{1-k}\cdot \frac{c}{{\left(\mathrm{X}-a\right)}^{k-1}}$  is a primitive function of  $\frac{c}{{\left(\mathrm{X}-a\right)}^{k}}$. [8.0.2]

Proof:

1. ►  In [8.7.1] we introduce ln as a primitive of the reciprocal function on ${ℝ}^{>0}$. ln is thus differentiable and

${\mathrm{ln}}^{\prime }\left(x\right)=\frac{1}{x}$  for all $x>0$

Using the chain rule [7.7.8] and the derivative of the absolute value function [7.4.3] we see that $c\cdot \mathrm{ln}|\mathrm{X}-a|$ is differentiable and that

$\left(c\cdot \mathrm{ln}|\mathrm{X}-a|{\right)}^{\prime }=c\cdot \frac{1}{|\mathrm{X}-a|}\cdot |\mathrm{X}-a|{\phantom{\right)}}^{\prime }=c\cdot \frac{1}{|\mathrm{X}-a|}\cdot \frac{|\mathrm{X}-a|}{\mathrm{X}-a}=\frac{c}{\mathrm{X}-a}$

is its derivative.

2. ►  $\frac{1}{1-k}\cdot \frac{c}{{\left(\mathrm{X}-a\right)}^{k-1}}$ is essentially a power of X, thus differentiable. We use the power rule
 i $\left({\mathrm{X}}^{n}{\right)}^{\prime }=n{\mathrm{X}}^{n-1}$ for all $n\in ℤ$
to calculate the derivative:

$\left(\frac{1}{1-k}\cdot \frac{c}{{\left(\mathrm{X}-a\right)}^{k-1}}{\right)}^{\prime }=\frac{1}{1-k}\cdot \left(-\left(k-1\right)\right)\cdot \frac{c}{{\left(\mathrm{X}-a\right)}^{k}}=\frac{c}{{\left(\mathrm{X}-a\right)}^{k}}$

Examples are quite straight usually:

• $4\cdot \mathrm{ln}|\mathrm{X}-7|$  is a primitive of  $\frac{4}{\mathrm{X}-7}$.

• $-\frac{2}{\mathrm{X}-1}$  is a primitive of  $\frac{2}{{\left(\mathrm{X}-1\right)}^{2}}$.

Dealing with quotients of the second kind is a bit catchier. But as we always have the decomposition

$\frac{m\mathrm{X}+b}{\left({\mathrm{X}}^{2}+p\mathrm{X}+q{\right)}^{k}}=\frac{m}{2}\cdot \frac{2\mathrm{X}+p}{\left({\mathrm{X}}^{2}+p\mathrm{X}+q{\right)}^{k}}+\frac{b-\frac{m}{2}p}{\left({\mathrm{X}}^{2}+p\mathrm{X}+q{\right)}^{k}}$[3]

we may confine ourselves only to the cases $\frac{2\mathrm{X}+p}{\left({\mathrm{X}}^{2}+p\mathrm{X}+q{\right)}^{k}}$ and $\frac{c}{\left({\mathrm{X}}^{2}+p\mathrm{X}+q{\right)}^{k}}$. The first one is easy.

Proposition:

 $\mathrm{ln}\left({\mathrm{X}}^{2}+p\mathrm{X}+q\right)$  is a primitive function of  $\frac{2\mathrm{X}+p}{{\mathrm{X}}^{2}+p\mathrm{X}+q}$. [8.0.3] If $k>1$ then$\frac{1}{1-k}\cdot \frac{1}{\left({\mathrm{X}}^{2}+p\mathrm{X}+q{\right)}^{k-1}}$  is a primitive function of  $\frac{2\mathrm{X}+p}{\left({\mathrm{X}}^{2}+p\mathrm{X}+q{\right)}^{k}}$. [8.0.4]

Proof:  Both assertions are easily proved by using the chain rule. In 1. we note that, due to the premise, the values of ${\mathrm{X}}^{2}+p\mathrm{X}+q$ are always $>0$. The domain of $\mathrm{ln}\left({\mathrm{X}}^{2}+p\mathrm{X}+q\right)$ is thus the whole of $ℝ$.

As an example we see that

• $\mathrm{ln}\left({\mathrm{X}}^{2}+2\right)$  is a primitive function of  $\frac{2\mathrm{X}}{{\mathrm{X}}^{2}+2}$.

• $-\frac{1}{3}\cdot \frac{1}{\left({\mathrm{X}}^{2}-3\mathrm{X}+5{\right)}^{3}}$  is a primitive function of  $\frac{2\mathrm{X}-3}{\left({\mathrm{X}}^{2}-3\mathrm{X}+5{\right)}^{4}}$.

The remaining case is actually quite cumbersome. We recall that the discriminant $D=\frac{{p}^{2}}{4}-q$ is negative, thus $-D$ is positive. At first we show that it is sufficient to consider only denominators like $\left({\mathrm{X}}^{2}+1{\right)}^{k}$.

Proposition:  If g is a primitive of $\frac{c}{\left({\mathrm{X}}^{2}+1{\right)}^{k}}$ then

 $\sqrt{-{D}^{1-2k}}\cdot g\circ \frac{\mathrm{X}+\frac{p}{2}}{\sqrt{-D}}$ [8.0.5]

is a primitive function of $\frac{c}{\left({\mathrm{X}}^{2}+p\mathrm{X}+q{\right)}^{k}}$.

Proof:  The chain rule guarantees the differentiability of the function in [8.0.5] and provides the following derivative:

$\begin{array}{ll}\left(\sqrt{-{D}^{1-2k}}\cdot g\circ \frac{\mathrm{X}+\frac{p}{2}}{\sqrt{-D}}{\right)}^{\prime }\phantom{\rule{0.3em}{0ex}}\hfill & =\sqrt{{\left(-D\right)}^{1-2k}}\cdot \left({g}^{\prime }\circ \frac{\mathrm{X}+\frac{p}{2}}{\sqrt{-D}}\right)\cdot \frac{1}{\sqrt{-D}}\hfill \\ \hfill & =\sqrt{{\left(-D\right)}^{-2k}}\cdot \frac{c}{\left({\mathrm{X}}^{2}+1{\right)}^{k}}\circ \frac{\mathrm{X}+\frac{p}{2}}{\sqrt{-D}}\hfill \\ \hfill & ={\left(-D\right)}^{-k}\cdot \frac{c}{{\left(\frac{{\left(\mathrm{X}+\frac{p}{2}\right)}^{2}}{-D}+1\right)}^{k}}\hfill \\ \hfill & ={\left(-D\right)}^{-k}\cdot \frac{c\cdot {\left(-D\right)}^{k}}{{\left({\mathrm{X}}^{2}+p\mathrm{X}+\frac{{p}^{2}}{4}-D\right)}^{k}}\hfill \\ \hfill & =\frac{c}{\left({\mathrm{X}}^{2}+p\mathrm{X}+q{\right)}^{k}}\hfill \end{array}$

Primitives of $\left({\mathrm{X}}^{2}+1{\right)}^{k}$ are eventually constructed by recursion. For the base step we need the invers tangent,

$\mathrm{arctan}:ℝ\to \right]-\frac{\pi }{2},\frac{\pi }{2}\left[$,

the inverse of $\mathrm{tan}|\right]-\frac{\pi }{2},\frac{\pi }{2}\left[$
 i The restriction $\mathrm{tan}|\right]-\frac{\pi }{2},\frac{\pi }{2}\left[$ is bijective as it is injective due to [7.9.6] because ${\mathrm{tan}}^{\prime }\left(x\right)=\frac{1}{{\mathrm{cos}}^{2}\left(x\right)}\ne 0$ for all $x\in \right]-\frac{\pi }{2},\frac{\pi }{2}\left[$.  surjective according to a consequence of the intermediate value theorem [6.6.2] based on the limits $\underset{\begin{array}{c}x\to ±\frac{\pi }{2}\\ x\in \right]-\frac{\pi }{2},\frac{\pi }{2}\left[\end{array}}{\mathrm{lim}}\mathrm{tan}x=±\infty$
.

Proposition:

 $c\cdot \mathrm{arctan}$  is a primitive function of  $\frac{c}{{\mathrm{X}}^{2}+1}$. [8.0.6] If g is a primitive of  $\frac{c}{\left({\mathrm{X}}^{2}+1{\right)}^{k}}$ then $\frac{1}{2k}\cdot \left(\frac{c\mathrm{X}}{\left({\mathrm{X}}^{2}+1{\right)}^{k}}+\left(2k-1\right)\cdot g\right)$ [8.0.7]

is a primitive function of  $\frac{c}{\left({\mathrm{X}}^{2}+1{\right)}^{k+1}}$.

Proof:

1. ►  As ${\mathrm{tan}}^{\prime }\left(x\right)=\frac{1}{{\mathrm{cos}}^{2}\left(x\right)}\ne 0$ for all $x\in \right]-\frac{\pi }{2},\frac{\pi }{2}\left[$, arctan is differentiable due to [7.5.4] with

${\mathrm{arctan}}^{\prime }\left(x\right)=\frac{1}{{\mathrm{tan}}^{\prime }\left(\mathrm{arctan}x\right)}={\mathrm{cos}}^{2}\left(\mathrm{arctan}x\right)\underset{{\left[+\right]}}{=}\frac{1}{{\mathrm{tan}}^{2}\left(\mathrm{arctan}x\right)+1}=\frac{1}{{x}^{2}+1}$

Note that [+] is valid according to the identity ${\mathrm{cos}}^{2}=\frac{1}{{\mathrm{tan}}^{2}+1}$.

2. ►  The function in [8.0.7] is differentiable due to the quotient rule [7.7.7]. Its derivative calculates to:

$\begin{array}{ll}\frac{1}{2k}\cdot \left(\frac{c\mathrm{X}}{\left({\mathrm{X}}^{2}+1{\right)}^{k}}+\left(2k-1\right)\cdot g{\right)}^{\prime }\phantom{\rule{0.3em}{0ex}}\hfill & =\frac{1}{2k}\cdot \left(\frac{c\left({\mathrm{X}}^{2}+1{\right)}^{k}-c\mathrm{X}\cdot k\left({\mathrm{X}}^{2}+1{\right)}^{k-1}\cdot 2\mathrm{X}}{\left({\mathrm{X}}^{2}+1{\right)}^{2k}}+\left(2k-1\right)\cdot \frac{c}{\left({\mathrm{X}}^{2}+1{\right)}^{k}}\hfill \\ \hfill & =\frac{c}{2k}\cdot \frac{{\mathrm{X}}^{2}+1-2k{\mathrm{X}}^{2}+\left(2k-1\right)\cdot \left({\mathrm{X}}^{2}+1\right)}{\left({\mathrm{X}}^{2}+1{\right)}^{k+1}}\hfill \\ \hfill & =\frac{c}{2k}\cdot \frac{2k}{\left({\mathrm{X}}^{2}+1{\right)}^{k+1}}\hfill \\ \hfill & =\frac{c}{\left({\mathrm{X}}^{2}+1{\right)}^{k+1}}\hfill \end{array}$

An example will show how this procedure works.

 Example:   It takes three steps to construct a primitive function of $\frac{2}{\left({\mathrm{X}}^{2}+1{\right)}^{3}}$ recursively by [8.0.7]: $\text{1}$ is a primitive of $\frac{2}{\left({\mathrm{X}}^{2}+1\right)}$. $\underset{k=1}{\text{2}\text{.)}}$ is a primitive of $\frac{2}{\left({\mathrm{X}}^{2}+1{\right)}^{2}}$. $\underset{k=2}{\text{3}\text{.)}}$is a primitive of $\frac{2}{\left({\mathrm{X}}^{2}+1{\right)}^{3}}$.  To get a primitive of $\frac{2}{\left({\mathrm{X}}^{2}+6\mathrm{X}+13{\right)}^{2}}$ we start by calculating the discriminant $D=-4$ from the data $p=6$ and $q=13$. With step two of the example above and with [8.0.5] we then find $\begin{array}{ll}\sqrt{-{D}^{1-2k}}\cdot g\circ \frac{\mathrm{X}+\frac{p}{2}}{\sqrt{-D}}\phantom{\rule{0.3em}{0ex}}\hfill & =\frac{1}{\sqrt{64}}\cdot \left(\frac{\mathrm{X}}{{\mathrm{X}}^{2}+1}+\mathrm{arctan}\right)\circ \frac{\mathrm{X}+3}{2}\hfill \\ \hfill & =\frac{1}{8}\cdot \left(\frac{\frac{\mathrm{X}+3}{2}}{\frac{{\left(\mathrm{X}+3\right)}^{2}+4}{4}}+\mathrm{arctan}\frac{\mathrm{X}+3}{2}\right)\hfill \\ \hfill & =\frac{1}{4}\cdot \frac{\mathrm{X}+3}{{\mathrm{X}}^{2}+6\mathrm{X}+13}+\frac{1}{8}\cdot \mathrm{arctan}\frac{\mathrm{X}+3}{2}\hfill \end{array}$ as a primitive function.  Finally, to get a primitive of $\frac{3\mathrm{X}+11}{\left({\mathrm{X}}^{2}+6\mathrm{X}+13{\right)}^{2}}$ we first consider the decomposition $\frac{3\mathrm{X}+11}{\left({\mathrm{X}}^{2}+6\mathrm{X}+13{\right)}^{2}}=\frac{3}{2}\cdot \frac{2\mathrm{X}+6}{\left({\mathrm{X}}^{2}+6\mathrm{X}+13{\right)}^{2}}+\frac{2}{\left({\mathrm{X}}^{2}+6\mathrm{X}+13{\right)}^{2}}$ according to [3]. From the previous result and from [8.0.4] we now find $\begin{array}{ll}\hfill & -\frac{3}{2}\cdot \frac{1}{{\mathrm{X}}^{2}+6\mathrm{X}+13}+\frac{1}{4}\cdot \frac{\mathrm{X}+3}{{\mathrm{X}}^{2}+6\mathrm{X}+13}+\frac{1}{8}\cdot \mathrm{arctan}\frac{\mathrm{X}+3}{2}\hfill \\ =\hfill & \frac{1}{4}\cdot \frac{\mathrm{X}-3}{{\mathrm{X}}^{2}+6\mathrm{X}+13}+\frac{1}{8}\cdot \mathrm{arctan}\frac{\mathrm{X}+3}{2}\hfill \end{array}$ as a primitive.

$f=\frac{2{\mathrm{X}}^{5}-4{\mathrm{X}}^{4}+10{\mathrm{X}}^{3}-17{\mathrm{X}}^{2}+6\mathrm{X}-3}{{\mathrm{X}}^{4}-2{\mathrm{X}}^{3}+3{\mathrm{X}}^{2}-4\mathrm{X}+2}$
$2\mathrm{X}-\frac{2}{{\left(\mathrm{X}-1\right)}^{2}}+\frac{4\mathrm{X}+1}{{\mathrm{X}}^{2}+2}=2\mathrm{X}-\frac{2}{{\left(\mathrm{X}-1\right)}^{2}}+2\cdot \frac{2\mathrm{X}}{{\mathrm{X}}^{2}+2}+\frac{1}{{\mathrm{X}}^{2}+2}$
${\mathrm{X}}^{2}+\frac{2}{\mathrm{X}-1}+2\cdot \mathrm{ln}\left({\mathrm{X}}^{2}+2\right)+\frac{1}{\sqrt{2}}\cdot \mathrm{arctan}\frac{\mathrm{X}}{\sqrt{2}}$