Integral of Rational Fractions

In this page, we show how to integrate any rational function ( a ratio of polynomials ) by expressing it as a sum of partial fractions.

Let \(f(x)\) be a rational function such that

$$f(x)=\frac{P(x)}{Q(x)}=\frac{a_{n}x^{n}+a_{n-1}x^{n-1}+\cdots +a_{0}}{b_{m}x^{m}+b_{m-1}x^{m-1}+\cdots +b_{0}}$$

where \(P(x)\) and \(Q(x)\) are polynomials. If \(a_{n}\not=0\), the degree of P is n and we denote \(\text{deg}\ (P) =n\).

To integrate any rational function, see the following steps.

(Step 1) Reduce if there are common factors in the denominator and the numerator.
(Step 2) If \(\text{deg} P(x)\geq \text{deg} Q(x)\), devide Q into P until a remainder \(R(x) \)is obtained such that \(\text{deg} R(x)\) < \(\text{deg} Q(x)\). Then the division statement is $$\frac{P(x)}{Q(x)}=S(x)+\frac{R(x)}{Q(x)}$$ where S(x) and Q(x) are also polynomials.
(Step 3) Factor the denominator \(Q(x)\) as far as possible.
(Step 4) Express the rational function \(\frac{R(x)}{Q(x)}\) as a sum of partial fractions.

Example: Evaluate \(\int \frac{2x^{5}-4x^{4}-5x^{3}+9x^{2}}{x^{4}-2x^{3}-3x^{2}}\ dx\)

Let \(f(x)=\frac{P(x)}{Q(x)}=\frac{2x^{5}-4x^{4}-5x^{3}+9x^{2}}{x^{4}-2x^{3}-3x^{2}}\)

(Step 1) Reduce if there are common factors in the denominator and the numerator.

$$\int \frac{2x^{5}-4x^{4}-5x^{3}+9x^{2}}{x^{4}-2x^{3}-3x^{2}}\ dx=\int \frac{x^{2}(2x^{3}-4x^{2}-5x+9)}{x^{2}(x^{2}-2x-3)}\ dx=\int \frac{2x^{3}-4x^{2}-5x+9}{x^{2}-2x-3}\ dx$$

(Step 2) Perform the long division if the degree of the numerator is greater than the degree of denominator.

$$\frac{2x^{3}-4x^{2}-5x+9}{x^{2}-2x-3}=\frac{2x(x^{2}-2x-3)+(x-9)}{x^{2}-2x-3}=2x+\frac{x-9}{x^{2}-2x-3}$$

(Step 3) Factor the denominator \(Q(x)\) as far as possible.

$$2x+\frac{x-9}{x^{2}-2x-3}=2x+\frac{x-9}{(x+1)(x-3)}$$

(Step 4) Express the rational function \(\frac{R(x)}{Q(x)}\) as a sum of partial fractions.

$$2x+\frac{x-9}{(x+1)(x-3)}=2x+\frac{-2}{x+1}+\frac{3}{x-3}$$

Thus

$$\begin{eqnarray*}\int \frac{2x^{5}-4x^{4}-5x^{3}+9x^{2}}{x^{4}-2x^{3}-3x^{2}}\ dx&=&\int \left(2x+\frac{-2}{x+1}+\frac{3}{x-3}\right)\ dx\\&=&\int 2x\ dx-2\int \frac{1}{x+1}\ dx+3\int \frac{1}{x-3}\ dx\\&=& x^{2}-2\ln|x+1| +3\ln |x-3|+C\\&=&x^{2}+\ln\frac{|x-3|^{3}}{(x+1)^{2}}+C\end{eqnarray*}$$


Express as a sum of partial fraction

There are theorems in Algebra that grantee, any rational function can be expressed as a sum of partial fractions

Let \(\frac{R(x)}{Q(x)}\) be a rational function where R and Q are polynomials and deg(R)>deg(Q).
(1)Any polynomials can be factors as a product of linear factors (of the form ax+b) and irreducible factors (of the form \(Ax^{2}+Bx+C\) where \(B^{2}-4AC\) < 0 ). That is:
$$Q(x)=\prod_{n=1}^{m}(a_{n}x+b_{n})^{r_{k}}\prod_{\ell=1}^{k}(A_{\ell}x^{2}+B_{\ell}x+C_{\ell})^{R_{\ell}}$$ (2)Any rational Functions \(\frac{R(x)}{Q(x)}\) can be decomposed as a sum of partial fractions of the form \(\frac{A}{ax+b}\) or \(\frac{Dx+E}{Ax^{2}+Bx+C}\). That is : $$\begin{eqnarray*}\frac{R(x)}{Q(x)}&=&\sum_{n=1}^{m}\sum_{i=1}^{r_{n}}\frac{A_{n\ i}}{(a_{n}x+b_{n})^{i}}+\sum_{\ell=1}^{k}\sum_{j=1}^{R_{\ell}}\frac{D_{\ell}x+E_{\ell}}{(A_{\ell}x^{2}+B_{\ell}x+C_{\ell})^{j}}\end{eqnarray*}.$$

We see the details for the four cases occur.

Case 1:\(Q(x)=(a_{1}x+b_{1})(a_{2}x+b_{2})\cdots(a_{m}x+b_{m})\)

In the case of that \(Q(x)\) is a product of distinct linear factors;

$$Q(x)=(a_{1}x+b_{1})(a_{2}x+b_{2})\cdots(a_{m}x+b_{m})$$

where no factor is repeated and no factor is a constant multiple of another, the fraction can be decomposed as below:

$$\frac{R(x)}{Q(x)}=\frac{A_{1}}{a_{1}x+b_{1}} +\frac{A_{2}}{a_{2}x+b_{2}}+\cdots \frac{A_{m}}{a_{m}x+b_{m}}.$$


Example : \(\frac{x+9}{x^{2}-2x-3}\)

Since the two distinct linear factors, the partial fraction decomposition has the form;

$$\frac{x+9}{x^{2}-2x-3}=\frac{x+9}{(x+1)(x-3)}=\frac{A}{x+1}+\frac{B}{x-3}$$

To determine the value of A and B, we multiply both sides of the equation by the product of denominators, \((x+1)(x-3)\), obtaining

$$x+9=A(x-3)+B(x+1) \ \ \ \ \cdots (*)$$

Expanding the right hand side of the above equation, we get

$$x+9=(A+B)x+(B-3A)$$

Equating coefficients, we obtain

$$A+B=1\ \ \ \ \ B-3A=9$$

Another method for finding the coefficients:
・Put x=-1 in (*): 8=-4A
・Put x=3 in (*): 12=4B

Solving, we get \(A=-2\) and \(B=3\).

Case 2:\(Q(x)=(a_{1}x+b_{1})^{r_{1}}(a_{2}x+b_{2})^{r_{2}}\cdots(a_{m}x+b_{m})^{r_{m}}\)

In the case of that \(Q(x)\) is a product of linear factors, some of which are repeated;

$$Q(x)=(a_{1}x+b_{1})^{r_{1}}(a_{2}x+b_{2})^{r_{2}}\cdots(a_{m}x+b_{m})^{r_{m}}$$

the fraction can be decomposed as below:

$$\begin{eqnarray*}\frac{R(x)}{Q(x)}&=&\frac{A_{11}}{a_{1}x+b_{1}}+\frac{A_{12}}{(a_{1}x+b_{1})^{2}}+ \cdots +\frac{A_{1\ r_{1}}}{(a_{1}x+b_{1})^{r_{1}}}\\&&+\cdots +\\&&\frac{A_{m1}}{a_{m}x+b_{m}}+\frac{A_{m\ r_{2}}}{(a_{m}x+b_{m})^{2}}+\cdots +\frac{A_{m\ r_{m}}}{(a_{m}x+b_{m})^{r_{m}}}\end{eqnarray*}.$$


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

$$\frac{2x+3}{x^{2}(x+1)^{2}}=\frac{A}{x}+\frac{B}{x^{2}}+\frac{C}{x+1}+\frac{D}{(x+1)^{2}}$$

Multiplying by the least common denominator, \(x^{2}(x+1)^{2}\), we get

$$2x+3=Ax(x+1)^{2}+B(x+1)^{2}+Cx^{2}(x+1)+Dx^{2}$$

and equating coefficients, we obtain \(A=-4, B=3, C=4\) and \(D=1\).

Case 3:\(Q(x)=\prod_{n=1}^{m}(a_{n}x+b_{n})^{r_{n}}\prod_{\ell=1}^{k}(A_{\ell}x^{2}+B_{\ell}x+C_{\ell})\)

In the case of that \(Q(x)\) contains irreducible quadric factors, none of which is repeated (i.e; \(Q(x)\) has the factor \(Ax^{2}+Bx+C\) where \(B^{2}-4AC < 0\));

$$\begin{eqnarray*}Q(x)=&&\prod_{n=1}^{m}(a_{n}x+b_{n})^{r_{n}}\prod_{\ell=1}^{k}(A_{\ell}x^{2}+B_{\ell}x+C_{\ell})\\=&&(a_{1}x+b_{1})^{r_{1}}\cdots(a_{m}x+b_{m})^{r_{m}}\\&&\times(A_{1}x^{2}+B_{1}x+C_{1})\cdots(A_{k}x^{2}+B_{k}x+C_{k})\end{eqnarray*}$$

the fraction can be decomposed as below:

$$\begin{eqnarray*}\frac{R(x)}{Q(x)}&=&\sum_{n=1}^{m}\sum_{i=1}^{r_{n}}\frac{A_{n\ i}}{(a_{n}x+b_{n})^{i}}+\sum_{\ell=1}^{k}\frac{D_{\ell}x+E_{\ell}}{A_{\ell}x^{2}+B_{\ell}x+C_{\ell}}\end{eqnarray*}.$$

Example : \(\frac{2x+3}{x^{2}(x^{2}+1)}\)

$$\frac{2x+3}{x^{2}(x^{2}+1)}=\frac{A}{x}+\frac{B}{x^{2}}+\frac{Cx+D}{x^{2}+1}$$

Multiplying by the least common denominator, \(x^{2}(x^{2}+1)\), we get

$$2x+3=Ax(x^{2}+1)+B(x^{2}+1)+(Cx+D)x^{2}$$

and equating coefficients, we obtain \(A=2, B=3, C=-2\) and \(D=-3\).

Case 4: \(Q(x)=\prod_{n=1}^{m}(a_{n}x+b_{n})^{r_{n}}\prod_{\ell=1}^{k}(A_{\ell}x^{2}+B_{\ell}x+C_{\ell})^{R_{\ell}}\)

In the case of that \(Q(x)\) contains irreducible quadric factors, some of which are repeated;

$$\begin{eqnarray*}Q(x)=&&\prod_{n=1}^{m}(a_{n}x+b_{n})^{r_{n}}\prod_{\ell=1}^{k}(A_{\ell}x^{2}+B_{\ell}x+C_{\ell})^{R_{\ell}}\\=&&(a_{1}x+b_{1})^{r_{1}}\cdots(a_{m}x+b_{m})^{r_{m}}\\&&\times(A_{1}x^{2}+B_{1}x+C_{1})^{R_{1}}\cdots(A_{k}x^{2}+B_{k}x+C_{k})^{R_{k}}\end{eqnarray*}$$

the fraction can be decomposed as below:

$$\begin{eqnarray*}\frac{R(x)}{Q(x)}&=&\sum_{n=1}^{m}\sum_{i=1}^{r_{n}}\frac{A_{n\ i}}{(a_{n}x+b_{n})^{i}}+\sum_{\ell=1}^{k}\sum_{j=1}^{R_{\ell}}\frac{D_{\ell}x+E_{\ell}}{(A_{\ell}x^{2}+B_{\ell}x+C_{\ell})^{j}}\end{eqnarray*}.$$

Example : \(\frac{2x+3}{x^{2}(x^{2}+1)^{2}}\)

$$\frac{2x+3}{x^{2}(x^{2}+1)^{2}}=\frac{A}{x}+\frac{B}{x^{2}}+\frac{Cx+D}{x^{2}+1}+\frac{Ex+F}{(x^{2}+1)^{2}}$$

Multiplying by the least common denominator, \(x^{2}(x^{2}+1)^{2}\), we get

$$2x+3=Ax(x^{2}+1)^{2}+B(x^{2}+1)^{2}+(Cx+D)x^{2}(x^{2}+1)+(Ex+F)x^{2}$$

and equating coefficients, we obtain \(A=2, B=3, C=-2, D=-3, E=-2\) and \(F=-3\).