Calculus II Home

Partial Fractions

    


In this section we will learn to integrate rational functions: \[ \int \frac{P(x)}{Q(x)}\;dx, \] where \(P\) and \(Q\) are polynomials. The basic steps are as follows:

  1. If \(\deg P\geq \deg Q\), use polynomial long division to write \[ \frac{P(x)}{Q(x)}=S(x)+\frac{R(x)}{Q(x)}, \] where \(\deg R< \deg Q\).

  2. Write \(\displaystyle\frac{R(x)}{Q(x)}\) as a sum of partial fractions of the form \(\displaystyle\frac{A}{(ax+b)^n}\) or \(\displaystyle\frac{Ax+B}{(ax^2+bx+c)^n}\).


The preceding step 2 will be elaborated with examples in four cases:

  1. \(Q(x)\) is a product of distinct linear factors, i.e., \[ \frac{R(x)}{Q(x)}=\frac{R(x)}{(a_1x+b_1)(a_2x+b_2)\cdots (a_kx+b_k)}. \] In this case, the partial fraction decomposition takes the following form: \[ \frac{R(x)}{Q(x)}=\frac{R(x)}{(a_1x+b_1)(a_2x+b_2)\cdots (a_kx+b_k)}=\frac{A_1}{a_1x+b_1}+\frac{A_2}{a_2x+b_2}+\cdots+\frac{A_k}{a_kx+b_k}. \]
    Example. Evaluate \(\displaystyle\int \frac{2x^3+x^2-4x+7}{x^2+x-2} \,dx\).
    By polynomial long division, we get \[\frac{2x^3+x^2-4x+7}{x^2+x-2}=2x-1+\frac{x+5}{x^2+x-2}. \] We factor the denominator: \(x^2+x-2=(x-1)(x+2)\). For a partial fraction decomposition, let \[ \frac{x+5}{x^2+x-2}=\frac{x+5}{(x-1)(x+2)}=\frac{A}{x-1}+\frac{B}{x+2}.\] Multiplying by \((x-1)(x+2)\), we get \[x+5=A(x+2)+B(x-1) \;\;\;\;\;\;\;\; (1) \] Plugging \(x=1\) in (1), we get \[1+5=A(1+2)+B(1-1) \implies 6=3A \implies A=\frac{6}{3}=2.\] Plugging \(x=-2\) in (1), we get \[-2+5=A(-2+2)+B(-2-1) \implies 3=-3B \implies B=-1.\] So a partial fraction decomposition is \[ \frac{2x^3+x^2-4x+7}{x^2+x-2}=2x-1+\frac{2}{x-1}-\frac{1}{x+2}.\] \[\begin{align*} \int \frac{2x^3+x^2-4x+7}{x^2+x-2} \,dx &= \int \left[ 2x-1+\frac{2}{x-1}-\frac{1}{x+2}\right] \;dx \\ &= 2\int x \;dx-\int \;dx+2\int\frac{dx}{x-1}-\int\frac{dx}{x+2} \\ &= x^2-x+2\ln|x-1|-\ln|x+2|+C. \end{align*}\]

    Example. Show that \(\displaystyle\int \frac{dx}{x^2-a^2}=\frac{1}{2a} \ln\left\vert \frac{x-a}{x+a} \right\vert+C\) for \(a\neq 0\).
    Note that \(x^2-a^2=(x-a)(x+a)\). For a partial fraction decomposition, let \[ \frac{1}{(x-a)(x+a)}=\frac{A}{x-a}+\frac{B}{x+a}.\] Multiplying by \((x-a)(x+a)\), we get \[1=A(x+a)+B(x-a).\] Plugging \(x=a\), we get \[1=2aA\implies A=\frac{1}{2a}.\] Plugging \(x=-a\), we get \[1=-2aB\implies B=-\frac{1}{2a}.\] So a partial fraction decomposition is \[ \frac{1}{(x-a)(x+a)}=\frac{1}{2a(x-a)}-\frac{1}{2a(x+a)}=\frac{1}{2a}\left( \frac{1}{x-a}-\frac{1}{x+a} \right).\] \[\begin{align*} \int \frac{dx}{x^2-a^2} &= \frac{1}{2a} \int\left( \frac{1}{x-a}-\frac{1}{x+a} \right)\;dx\\ &=\frac{1}{2a} \left(\ln|x-a|-\ln|x+a|\right)+C\\ &=\frac{1}{2a} \ln\left\vert \frac{x-a}{x+a} \right\vert+C. \end{align*}\]

  2. \(Q(x)\) is a product of repeated linear factors, i.e., \[ \frac{R(x)}{Q(x)}=\frac{R(x)}{(a_1x+b_1)^{n_1}(a_2x+b_2)^{n_2}\cdots (a_kx+b_k)^{n_k}}. \] In this case, \((a_i x+b_i)^{n_i}\) contributes the following to the partial fraction decomposition: \[ \frac{A_1}{(a_ix+b_i)}+\frac{A_2}{(a_ix+b_i)^2}+\cdots+\frac{A_{n_i}}{(a_ix+b_i)^{n_i}}. \]
    Example. Evaluate \(\displaystyle\int \frac{x^2-5x+16}{(2x+1)(x-2)^2} \,dx\).
    For a partial fraction decomposition, let \[ \frac{x^2-5x+16}{(2x+1)(x-2)^2}=\frac{A}{2x+1}+\frac{B}{x-2}+\frac{C}{(x-2)^2}.\] Multiplying by \((2x+1)(x-2)^2\), we get \[x^2-5x+16=A(x-2)^2+B(x-2)(2x+1)+C(2x+1) \;\;\;\;\;\;\;\; (2) \] Plugging \(x=-\frac{1}{2}\) in (2), we get \[\begin{array}{rrcl} & \left(-\frac{1}{2}\right)^2+5\cdot \frac{1}{2}+16 &=&A\left(2+\frac{1}{2}\right)^2+B\left(2+\frac{1}{2}\right)\left(-2\cdot \frac{1}{2}+1\right)+C\left(-2\cdot \frac{1}{2}+1\right)\\ \implies & \frac{75}{4} &= &\frac{25}{4}A \\ \implies & A &=&3. \end{array}\] Plugging \(x=2\) in (2), we get \[2^2-5\cdot 2+16=A(2-2)^2+B(2-2)(2\cdot 2+1)+C(2\cdot 2+1) \implies 10=5C \implies C=2.\] There are two ways to get \(B\):

    1. Plug some value of \(x\neq -\frac{1}{2},2\).
      Plugging \(x=0\) in (2), we get \[0^2-5\cdot 0+16=3(0-2)^2+B(0-2)(2\cdot 0+1)+2(2\cdot 0+1) \implies 16=14-2B \implies B=-1.\]
    2. Compare the coefficients of like powers of \(x\) in both sides of (2).
      Rewriting (2), we get \[x^2-5x+16=3(x^2-4x+4)+B(2x^2-3x-2)+2(2x+1)=(3+2B)x^2+(-12-3B+4)x+(12-2B+2) \] Comparing the coefficient of \(x^2\) in both sides, we get \[ 1=3+2B \implies B=-1. \]
    So a partial fraction decomposition is \[ \frac{x^2-5x+16}{(2x+1)(x-2)^2}=\frac{3}{2x+1}-\frac{1}{x-2}+\frac{2}{(x-2)^2}.\] \[\begin{align*} \int \frac{x^2-5x+16}{(2x+1)(x-2)^2} \,dx &= 3\int \frac{dx}{2x+1}-\int\frac{dx}{x-2}+2\int \frac{dx}{(x-2)^2} \\ &= \frac{3}{2}\ln|2x+1|-\ln|x-2|-\frac{2}{x-2}+C. \end{align*}\]

  3. \(Q(x)\) contains an irreducible quadratic factor \(ax^2+bx+c\) (which cannot be written as the product of two linear factors because \(b^2-4ac<0\)).
    In this case, \(ax^2+bx+c\) contributes the following to the partial fraction decomposition: \[ \frac{A_1x+B_1}{ax^2+bx+c}. \] A relevant formula: \[\boxed{\int \frac{dx}{x^2+a^2} =\frac{1}{a}\tan^{-1}\left( \frac{x}{a}\right)+C,\; a\neq 0}\]
    Example. Evaluate \(\displaystyle\int \frac{x^2+2x-1}{x^3+x^2+x} \,dx\).
    First note that \(x^3+x^2+x=x(x^2+x+1)\) where \(x^2+x+1\) is irreducible. For a partial fraction decomposition, let \[ \frac{x^2+2x-1}{x^3+x^2+x}= \frac{x^2+2x-1}{x(x^2+x+1)} =\frac{A}{x}+\frac{Bx+C}{x^2+x+1}.\] Multiplying by \(x(x^2+x+1)\), we get \[ x^2+2x-1=A(x^2+x+1)+(Bx+C)x=(A+B)x^2+(A+C)x+A. \] Comparing the coefficients of like powers of \(x\), we get \[A+B=1,\; A+C=2,\; A=-1.\] So \(A=-1\), \(B=1-A=2\), and \(C=2-A=3\). So a partial fraction decomposition is \[ \frac{x^2+2x-1}{x^3+x^2+x}=-\frac{1}{x}+\frac{2x+3}{x^2+x+1}.\] To integrate the second fraction, we complete the square in the denominator: \[x^2+x+1=\left(x+\frac{1}{2}\right)^2+\frac{3}{4}\] \[\begin{align*} \int \frac{x^2+2x-1}{x^3+x^2+x} \,dx &= \int\left( -\frac{1}{x}+\frac{2x+3}{\left(x+\frac{1}{2}\right)^2+\frac{3}{4}} \right) \;dx\\ &=-\ln|x| +\int\frac{2x+3}{\left(x+\frac{1}{2}\right)^2 +\frac{3}{4} } \;dx\\ &=-\ln|x| +\int\frac{2(u-\frac{1}{2})+3}{u^2 +\frac{3}{4} } \;du \,\, \left(\text{Let } u=x+\frac{1}{2}.\; \text{Then } du=dx \right)\\ &=-\ln|x| +\int\frac{2u+2}{u^2 +\frac{3}{4}} \;du\\ &=-\ln|x| +\int\frac{2u}{u^2 +\frac{3}{4}}\;du +2\int \frac{du}{u^2 +\left(\frac{\sqrt{3}}{2}\right)^2}\\ &=-\ln|x| + \ln\left\vert u^2 +\frac{3}{4}\right\vert +2\frac{1}{\frac{\sqrt{3}}{2}}\tan^{-1}\left( \frac{u}{\frac{\sqrt{3}}{2}}\right)+C\\ &=-\ln|x| + \ln\left\vert \left(x+\frac{1}{2}\right)^2 +\frac{3}{4}\right\vert +\frac{4}{\sqrt{3}}\tan^{-1}\left( \frac{2\left(x+\frac{1}{2}\right)}{\sqrt{3}}\right)+C\\ &=-\ln|x| + \ln\left\vert x^2+x+1\right\vert +\frac{4}{\sqrt{3}}\tan^{-1}\left( \frac{2x+1}{\sqrt{3}}\right)+C \end{align*}\]

  4. \(Q(x)\) contains a repeated irreducible quadratic factor \((ax^2+bx+c)^n\), \(n\geq 2\).
    In this case, \((ax^2+bx+c)^n\) contributes the following to the partial fraction decomposition: \[ \frac{A_1x+B_1}{(ax^2+bx+c)}+\frac{A_2x+B_2}{(ax^2+bx+c)^2}+\cdots+\frac{A_nx+B_n}{(ax^2+bx+c)^n}. \]
    Example. Evaluate \(\displaystyle\int \frac{dx}{x(x^2+4)^2} \).
    For a partial fraction decomposition, let \[ \frac{1}{x(x^2+4)^2}= \frac{A}{x}+\frac{Bx+C}{x^2+4}+\frac{Dx+E}{(x^2+4)^2}.\] Multiplying by \(x(x^2+4)^2\), we get \[\begin{align*} 1 &=A(x^2+4)^2+(Bx+C)x(x^2+4)+(Dx+E)x\\ &=A(x^4+8x^2+16)+(Bx^4+Cx^3+4Bx^2+4Cx)+(Dx^2+Ex)\\ &=(A+B)x^4+Cx^3+(8A+4B+D)x^2+(4C+E)x+16A. \end{align*}\] Comparing the coefficients of like powers of \(x\), we get \[A+B=0,\; C=0,\; 8A+4B+D=0,\; 4C+E=0,\; 16A=1.\] So \(A=\frac{1}{16}\), \(B=-A=-\frac{1}{16}\), \(C=0\), \(D=-8A-4B=-\frac{1}{4}\), and \(E=-4C=0\). So a partial fraction decomposition is \[ \frac{1}{x(x^2+4)^2}= \frac{1}{16x}-\frac{x}{16(x^2+4)}-\frac{x}{4(x^2+4)^2}.\] \[\begin{align*} \int\frac{dx}{x(x^2+4)^2} &= \int \left( \frac{1}{16x}-\frac{x}{16(x^2+4)}-\frac{x}{4(x^2+4)^2} \right)\;dx\\ &= \frac{1}{16}\int \frac{dx}{x}-\frac{1}{32}\int\frac{2x\;dx}{x^2+4}-\frac{1}{8}\int\frac{2x\;dx}{(x^2+4)^2}\\ &=\frac{1}{16}\ln|x|-\frac{1}{32}\ln|x^2+4|+\frac{1}{8(x^2+4)}+C. \end{align*}\]


Last edited