Integrals Involving Rational Functions

Consider integral 4x6x23x+2dx\int\frac{{{4}{x}-{6}}}{{{{x}}^{{2}}-{3}{x}+{2}}}{d}{x}.

This integral can be easily evaluated using substitution u=x23x+2{u}={{x}}^{{2}}-{3}{x}+{2}.

Indeed, du=(2x3)dx{d}{u}={\left({2}{x}-{3}\right)}{d}{x}. So, integral becoms 2duu=2lnu+C=2lnx23x+2+C{2}\int\frac{{{d}{u}}}{{u}}={2}{\ln}{\left|{u}\right|}+{C}={2}{\ln}{\left|{{x}}^{{2}}-{3}{x}+{2}\right|}+{C}.

This integral is easy, because in numerator there is exact derivative of denominator (or a constant multiply). But in many cases there is no derivative in numerator. For example, how to integrate 1x23x+2dx\int\frac{{1}}{{{{x}}^{{2}}-{3}{x}+{2}}}{d}{x}?

Example 1. Integrate dxx23x+2\int\frac{{{d}{x}}}{{{{x}}^{{2}}-{3}{x}+{2}}}.

Note, that (x23x+2)=(x2)(x1){\left({{x}}^{{2}}-{3}{x}+{2}\right)}={\left({x}-{2}\right)}{\left({x}-{1}\right)}.

So, 1x23x+2=1(x2)(x1)\frac{{1}}{{{{x}}^{{2}}-{3}{x}+{2}}}=\frac{{1}}{{{\left({x}-{2}\right)}{\left({x}-{1}\right)}}}.

Now, suppose you can decompose it as Ax2+Bx1\frac{{A}}{{{x}-{2}}}+\frac{{B}}{{{x}-{1}}}. We need to determine constants A and B.

So, Ax2+Bx1=A(x1)+B(x2)(x2)(x1)\frac{{A}}{{{x}-{2}}}+\frac{{B}}{{{x}-{1}}}=\frac{{{A}{\left({x}-{1}\right)}+{B}{\left({x}-{2}\right)}}}{{{\left({x}-{2}\right)}{\left({x}-{1}\right)}}}.

And this must be equal for any x{x} to 1(x2)(x1)\frac{{1}}{{{\left({x}-{2}\right)}{\left({x}-{1}\right)}}}. Denominators are equal, so we require equality of numerators:

Thus, A(x1)+B(x2)=1{A}{\left({x}-{1}\right)}+{B}{\left({x}-{2}\right)}={1}.

At this point we have one of two ways to proceed. One way will always work, but is often requires more work. The other, while it won’t always work, is often quicker when it does work.

First way that always works. We can rewrite equation as (A+B)x+(A2B)=0x+1{\left({A}+{B}\right)}{x}+{\left(-{A}-{2}{B}\right)}={0}\cdot{x}+{1}.

Equating coefficients near like terms gives:

{A+B=0A2B=1{\left\{\begin{array}{c}{A}+{B}={0}\\-{A}-{2}{B}={1}\\ \end{array}\right.}.

Adding two equations gives that B=1-{B}={1} or B=1{B}=-{1}. From first equation A=B=(1)=1{A}=-{B}=-{\left(-{1}\right)}={1}.

Second way that will not always work. Note that A(x1)+B(x2)=1{A}{\left({x}-{1}\right)}+{B}{\left({x}-{2}\right)}={1} must hold for any x.{x}. Therefore, choosing appropriate x{x}'s we got the unknown constants to quickly drop out.

If x=1{x}={1} then x1=0{x}-{1}={0} and A(11)+B(12)=1{A}\cdot{\left({1}-{1}\right)}+{B}{\left({1}-{2}\right)}={1},so B=1{B}=-{1}.

If x=2{x}={2} then x2=0{x}-{2}={0} and A(21)+B(22)=1{A}\cdot{\left({2}-{1}\right)}+{B}{\left({2}-{2}\right)}={1}, so A=1{A}={1}.

Therefore 1(x2)(x1)=1x21x1\frac{{1}}{{{\left({x}-{2}\right)}{\left({x}-{1}\right)}}}=\frac{{1}}{{{x}-{2}}}-\frac{{1}}{{{x}-{1}}}.

Finally, dxx23x+2dx=(1x21x1)dx=lnx2lnx1+C\int\frac{{{d}{x}}}{{{{x}}^{{2}}-{3}{x}+{2}}}{d}{x}=\int{\left(\frac{{1}}{{{x}-{2}}}-\frac{{1}}{{{x}-{1}}}\right)}{d}{x}={\ln}{\left|{x}-{2}\right|}-{\ln}{\left|{x}-{1}\right|}+{C}.

The process described in example 1 is called partial fraction decomposition.

Definition. Partial Fraction Decomposition is a process of taking a rational expression and decomposing it into simpler rational expressions that we can add or subtract to get the original rational expression. Many integrals are solved quickly with performing partial fraction decomposition.

Partial fractions can only be done if the degree of the numerator is strictly less than the degree of the denominator. If this doesn't hold, we first need to perform long division.

Example 2. Evaluate x33x2+2x+4x23x+2dx\int\frac{{{{x}}^{{3}}-{3}{{x}}^{{2}}+{2}{x}+{4}}}{{{{x}}^{{2}}-{3}{x}+{2}}}{d}{x}.

Here degree of numerator is greater than degree of denominator, so perform long division first:

x33x2+2x+4x23x+2dx=x(x23x+2)+4x23x+2dx=(x+41x23x+2)dx=\int\frac{{{{x}}^{{3}}-{3}{{x}}^{{2}}+{2}{x}+{4}}}{{{{x}}^{{2}}-{3}{x}+{2}}}{d}{x}=\int\frac{{{x}{\left({{x}}^{{2}}-{3}{x}+{2}\right)}+{4}}}{{{{x}}^{{2}}-{3}{x}+{2}}}{d}{x}=\int{\left({x}+{4}\frac{{1}}{{{{x}}^{{2}}-{3}{x}+{2}}}\right)}{d}{x}=

=(x+4x24x1)dx=12x2+4lnx24lnx1+C=\int{\left({x}+\frac{{4}}{{{x}-{2}}}-\frac{{4}}{{{x}-{1}}}\right)}{d}{x}=\frac{{1}}{{2}}{{x}}^{{2}}+{4}{\ln}{\left|{x}-{2}\right|}-{4}{\ln}{\left|{x}-{1}\right|}+{C}.

In general if you have in denominator (anxn+an1xn1++a0)k{{\left({a}_{{n}}{{x}}^{{n}}+{a}_{{{n}-{1}}}{{x}}^{{{n}-{1}}}+\ldots+{a}_{{0}}\right)}}^{{k}} then corresponding term in partial fraction decomposition is An1xn1+An2xn2++A0anxn+an1xn1++a0+An1xn1+An2xn2++A0(anxn+an1xn1++a0)2++\frac{{{A}_{{{n}-{1}}}{{x}}^{{{n}-{1}}}+{A}_{{{n}-{2}}}{{x}}^{{{n}-{2}}}+\ldots+{A}_{{0}}}}{{{a}_{{n}}{{x}}^{{n}}+{a}_{{{n}-{1}}}{{x}}^{{{n}-{1}}}+\ldots+{a}_{{0}}}}+\frac{{{A}_{{{n}-{1}}}{{x}}^{{{n}-{1}}}+{A}_{{{n}-{2}}}{{x}}^{{{n}-{2}}}+\ldots+{A}_{{0}}}}{{{\left({a}_{{n}}{{x}}^{{n}}+{a}_{{{n}-{1}}}{{x}}^{{{n}-{1}}}+\ldots+{a}_{{0}}\right)}}^{{2}}}+\ldots+

+An1xn1+An2xn2++A0(anxn+an1xn1++a0)k+\frac{{{A}_{{{n}-{1}}}{{x}}^{{{n}-{1}}}+{A}_{{{n}-{2}}}{{x}}^{{{n}-{2}}}+\ldots+{A}_{{0}}}}{{{\left({a}_{{n}}{{x}}^{{n}}+{a}_{{{n}-{1}}}{{x}}^{{{n}-{1}}}+\ldots+{a}_{{0}}\right)}}^{{k}}}.

In particular,

  1. ax+bAax+b{a}{x}+{b}\to\frac{{A}}{{{a}{x}+{b}}}
  2. ax2+bx+cAx+Bax2+bx+c{a}{{x}}^{{2}}+{b}{x}+{c}\to\frac{{{A}{x}+{B}}}{{{a}{{x}}^{{2}}+{b}{x}+{c}}}
  3. (ax+b)2Aax+b+B(ax+b)2{{\left({a}{x}+{b}\right)}}^{{2}}\to\frac{{A}}{{{a}{x}+{b}}}+\frac{{B}}{{{\left({a}{x}+{b}\right)}}^{{2}}}
  4. (ax2+bx+c)2Ax+Bax2+bx+c+Cx+D(ax2+bx+c)2{{\left({a}{{x}}^{{2}}+{b}{x}+{c}\right)}}^{{2}}\to\frac{{{A}{x}+{B}}}{{{a}{{x}}^{{2}}+{b}{x}+{c}}}+\frac{{{C}{x}+{D}}}{{{\left({a}{{x}}^{{2}}+{b}{x}+{c}\right)}}^{{2}}}.

Often there are quadratic terms that can't be reduced (discriminant is negative). In this case you should complete a square.

Example 3. Find 1x26x+10dx\int\frac{{1}}{{{{x}}^{{2}}-{6}{x}+{10}}}{d}{x}.

x26x+10{{x}}^{{2}}-{6}{x}+{10} cannot be factored, so complete a square: x26x+10=x26x+9+1=(x3)2+1{{x}}^{{2}}-{6}{x}+{10}={{x}}^{{2}}-{6}{x}+{9}+{1}={{\left({x}-{3}\right)}}^{{2}}+{1}.

1(x3)2+1dx=arctan(x3)+C\int\frac{{1}}{{{{\left({x}-{3}\right)}}^{{2}}+{1}}}{d}{x}={\operatorname{arctan}{{\left({x}-{3}\right)}}}+{C}.

In general you will need following integrals:

  1. 1ax+bdx=1alnax+b+C\int\frac{{1}}{{{a}{x}+{b}}}{d}{x}=\frac{{1}}{{a}}{\ln}{\left|{a}{x}+{b}\right|}+{C}
  2. xx2±adx=12lnx2±a+C\int\frac{{x}}{{{{x}}^{{2}}\pm{a}}}{d}{x}=\frac{{1}}{{2}}{\ln}{\left|{{x}}^{{2}}\pm{a}\right|}+{C}
  3. 1(x+a)2+b2dx=1btan1(x+ab)+C\int\frac{{1}}{{{{\left({x}+{a}\right)}}^{{2}}+{{b}}^{{2}}}}{d}{x}=\frac{{1}}{{b}}{{\tan}}^{{-{1}}}{\left(\frac{{{x}+{a}}}{{b}}\right)}+{C}
  4. 1(ax+b)2dx=1a1ax+b+C\int\frac{{1}}{{{\left({a}{x}+{b}\right)}}^{{2}}}{d}{x}=-\frac{{1}}{{a}}\frac{{1}}{{{a}{x}+{b}}}+{C}

Example 4. Integrate 2x2x+4x3+4xdx\int\frac{{{2}{{x}}^{{2}}-{x}+{4}}}{{{{x}}^{{3}}+{4}{x}}}{d}{x}

Since x3+4x=x(x2+4){{x}}^{{3}}+{4}{x}={x}{\left({{x}}^{{2}}+{4}\right)} then partial fraction decomposition is 2x2x+4x(x2+4)=Ax+Bx+Cx2+4\frac{{{2}{{x}}^{{2}}-{x}+{4}}}{{{x}{\left({{x}}^{{2}}+{4}\right)}}}=\frac{{A}}{{x}}+\frac{{{B}{x}+{C}}}{{{{x}}^{{2}}+{4}}}.

Multiplying by x(x2+4){x}{\left({{x}}^{{2}}+{4}\right)} we have that (2x2x+4)=A(x2+4)+x(Bx+C)=(A+B)x2+Cx+4A{\left({2}{{x}}^{{2}}-{x}+{4}\right)}={A}{\left({{x}}^{{2}}+{4}\right)}+{x}{\left({B}{x}+{C}\right)}={\left({A}+{B}\right)}{{x}}^{{2}}+{C}{x}+{4}{A}.

Equating coefficients near like terms yields A+B=2{A}+{B}={2}, C=1{C}=-{1} and 4A=4{4}{A}={4}.

Thus, A=1{A}={1}, B=1{B}={1}, C=1{C}=-{1}.

2x2x+4x3+4xdx=(1x+x1x2+4)dx=(1x+xx2+41x2+4)dx=\int\frac{{{2}{{x}}^{{2}}-{x}+{4}}}{{{{x}}^{{3}}+{4}{x}}}{d}{x}=\int{\left(\frac{{1}}{{x}}+\frac{{{x}-{1}}}{{{{x}}^{{2}}+{4}}}\right)}{d}{x}=\int{\left(\frac{{1}}{{x}}+\frac{{x}}{{{{x}}^{{2}}+{4}}}-\frac{{1}}{{{{x}}^{{2}}+{4}}}\right)}{d}{x}=

=lnx+12lnx2+412tan1(x2)+C={\ln}{\left|{x}\right|}+\frac{{1}}{{2}}{\ln}{\left|{{x}}^{{2}}+{4}\right|}-\frac{{1}}{{2}}{{\tan}}^{{-{1}}}{\left(\frac{{x}}{{2}}\right)}+{C}.

Example 5. Evaluate 2x311x22x+22x2+x1dx\int\frac{{{2}{{x}}^{{3}}-{11}{{x}}^{{2}}-{2}{x}+{2}}}{{{2}{{x}}^{{2}}+{x}-{1}}}{d}{x}.

Degree of numerator is greater than degree of denominator, so we must first perform long division.

2x311x22x+22x2+x1=x6+5x42x2+x2=x6+5x4(2x1)(x+1)\frac{{{2}{{x}}^{{3}}-{11}{{x}}^{{2}}-{2}{x}+{2}}}{{{2}{{x}}^{{2}}+{x}-{1}}}={x}-{6}+\frac{{{5}{x}-{4}}}{{{2}{{x}}^{{2}}+{x}-{2}}}={x}-{6}+\frac{{{5}{x}-{4}}}{{{\left({2}{x}-{1}\right)}{\left({x}+{1}\right)}}}.

Partial fraction decomposition is 5x4(2x1)(x+1)=A2x1+Bx+1\frac{{{5}{x}-{4}}}{{{\left({2}{x}-{1}\right)}{\left({x}+{1}\right)}}}=\frac{{A}}{{{2}{x}-{1}}}+\frac{{B}}{{{x}+{1}}}.

Multiplying by (2x1)(x+1){\left({2}{x}-{1}\right)}{\left({x}+{1}\right)} gives the following: 5x4=A(x+1)+B(2x1){5}{x}-{4}={A}{\left({x}+{1}\right)}+{B}{\left({2}{x}-{1}\right)}.

If x=1{x}=-{1} then 5(1)4=A(1+1)+B(2(1)1){5}\cdot{\left(-{1}\right)}-{4}={A}{\left(-{1}+{1}\right)}+{B}{\left({2}\cdot{\left(-{1}\right)}-{1}\right)} or B=3{B}={3}.

If x=12{x}=\frac{{1}}{{2}} then 5124=A(12+1)+B(2121){5}\cdot\frac{{1}}{{2}}-{4}={A}{\left(\frac{{1}}{{2}}+{1}\right)}+{B}{\left({2}\cdot\frac{{1}}{{2}}-{1}\right)} or A=1{A}=-{1}.

So, 5x4(2x1)(x+1)=12x1+3x+1\frac{{{5}{x}-{4}}}{{{\left({2}{x}-{1}\right)}{\left({x}+{1}\right)}}}=-\frac{{1}}{{{2}{x}-{1}}}+\frac{{3}}{{{x}+{1}}}.

Finally, 2x311x22x+22x2+x1dx=(x612x1+3x+1)dx=\int\frac{{{2}{{x}}^{{3}}-{11}{{x}}^{{2}}-{2}{x}+{2}}}{{{2}{{x}}^{{2}}+{x}-{1}}}{d}{x}=\int{\left({x}-{6}-\frac{{1}}{{{2}{x}-{1}}}+\frac{{3}}{{{x}+{1}}}\right)}{d}{x}=

=12x26x12ln2x1+3lnx+1+C=\frac{{1}}{{2}}{{x}}^{{2}}-{6}{x}-\frac{{1}}{{2}}{\ln}{\left|{2}{x}-{1}\right|}+{3}{\ln}{\left|{x}+{1}\right|}+{C}.

Example 6. Evaluate 15x229x+15x(x3)(4x5)dx\int\frac{{{15}{{x}}^{{2}}-{29}{x}+{15}}}{{{x}{\left({x}-{3}\right)}{\left({4}{x}-{5}\right)}}}{d}{x}.

Partial fraction decomposition is 15x229x+15x(x3)(4x5)=Ax+Bx3+C4x5\frac{{{15}{{x}}^{{2}}-{29}{x}+{15}}}{{{x}{\left({x}-{3}\right)}{\left({4}{x}-{5}\right)}}}=\frac{{A}}{{x}}+\frac{{B}}{{{x}-{3}}}+\frac{{C}}{{{4}{x}-{5}}}.

Multiplying by x(x3)(4x5){x}{\left({x}-{3}\right)}{\left({4}{x}-{5}\right)} yields 15x229x+15=A(x3)(4x5)+Bx(4x5)+Cx(x3).{15}{{x}}^{{2}}-{29}{x}+{15}={A}{\left({x}-{3}\right)}{\left({4}{x}-{5}\right)}+{B}{x}{\left({4}{x}-{5}\right)}+{C}{x}{\left({x}-{3}\right)}.

If x=0{x}={0} then 1502290+15=A(03)(405)+B0(405)+C0(03){15}\cdot{{0}}^{{2}}-{29}\cdot{0}+{15}={A}{\left({0}-{3}\right)}{\left({4}\cdot{0}-{5}\right)}+{B}\cdot{0}\cdot{\left({4}\cdot{0}-{5}\right)}+{C}\cdot{0}\cdot{\left({0}-{3}\right)} or A=1{A}={1}.

If x=3{x}={3} then 1532293+15=A(33)(435)+B3(435)+C3(33){15}\cdot{{3}}^{{2}}-{29}\cdot{3}+{15}={A}{\left({3}-{3}\right)}{\left({4}\cdot{3}-{5}\right)}+{B}\cdot{3}\cdot{\left({4}\cdot{3}-{5}\right)}+{C}\cdot{3}\cdot{\left({3}-{3}\right)} or B=3{B}={3}.

If x=54{x}=\frac{{5}}{{4}} then 15(54)229(54)+15={15}\cdot{{\left(\frac{{5}}{{4}}\right)}}^{{2}}-{29}\cdot{\left(\frac{{5}}{{4}}\right)}+{15}=

=A((54)3)(4(54)5)+B(54)(4(54)5)+C(54)((54)3)={A}{\left({\left(\frac{{5}}{{4}}\right)}-{3}\right)}{\left({4}\cdot{\left(\frac{{5}}{{4}}\right)}-{5}\right)}+{B}\cdot{\left(\frac{{5}}{{4}}\right)}\cdot{\left({4}\cdot{\left(\frac{{5}}{{4}}\right)}-{5}\right)}+{C}\cdot{\left(\frac{{5}}{{4}}\right)}\cdot{\left({\left(\frac{{5}}{{4}}\right)}-{3}\right)} or C=1{C}=-{1}.

So, 15x229+15x(x3)(4x5)=1x+3x314x5\frac{{{15}{{x}}^{{2}}-{29}+{15}}}{{{x}{\left({x}-{3}\right)}{\left({4}{x}-{5}\right)}}}=\frac{{1}}{{x}}+\frac{{3}}{{{x}-{3}}}-\frac{{1}}{{{4}{x}-{5}}}.

Thus, required integral is (1x+3x3+14x5)dx=lnx+lnx3+14ln4x5+C\int{\left(\frac{{1}}{{x}}+\frac{{3}}{{{x}-{3}}}+\frac{{1}}{{{4}{x}-{5}}}\right)}{d}{x}={\ln}{\left|{x}\right|}+{\ln}{\left|{x}-{3}\right|}+\frac{{1}}{{4}}{\ln}{\left|{4}{x}-{5}\right|}+{C}.

Example 7. Integrate x(x+2)2(x1)dx\int\frac{{x}}{{{{\left({x}+{2}\right)}}^{{2}}{\left({x}-{1}\right)}{d}{x}}}.

Partial fraction decomposition is x(x+2)2(x1)=Ax+2+B(x+2)2+Cx1\frac{{x}}{{{{\left({x}+{2}\right)}}^{{2}}{\left({x}-{1}\right)}}}=\frac{{A}}{{{x}+{2}}}+\frac{{B}}{{{\left({x}+{2}\right)}}^{{2}}}+\frac{{C}}{{{x}-{1}}}.

Multiplying both by denominator gives x=A(x+2)(x1)+B(x1)+C(x+2)2{x}={A}{\left({x}+{2}\right)}{\left({x}-{1}\right)}+{B}{\left({x}-{1}\right)}+{C}{{\left({x}+{2}\right)}}^{{2}}.

If x=1{x}={1} then 1=A(1+2)(11)+B(11)+C(1+2)2{1}={A}{\left({1}+{2}\right)}{\left({1}-{1}\right)}+{B}{\left({1}-{1}\right)}+{C}{{\left({1}+{2}\right)}}^{{2}} or C=19{C}=\frac{{1}}{{9}}.

If x=2{x}=-{2} then 2=A(2+2)(21)+B(21)+C(2+2)2-{2}={A}{\left(-{2}+{2}\right)}{\left(-{2}-{1}\right)}+{B}{\left(-{2}-{1}\right)}+{C}{{\left(-{2}+{2}\right)}}^{{2}} or B=23{B}=\frac{{2}}{{3}}.

To find constant A we can't use second method anymore, so we rewrite x=A(x+2)(x1)+B(x1)+C(x+2)2{x}={A}{\left({x}+{2}\right)}{\left({x}-{1}\right)}+{B}{\left({x}-{1}\right)}+{C}{{\left({x}+{2}\right)}}^{{2}} as

x=(A+C)x2+(A+B+4C)x+(2AB+4C){x}={\left({A}+{C}\right)}{{x}}^{{2}}+{\left({A}+{B}+{4}{C}\right)}{x}+{\left(-{2}{A}-{B}+{4}{C}\right)}.

From this we have that A+C=0{A}+{C}={0}. We've already found that C=19{C}=\frac{{1}}{{9}}, so A=19{A}=-\frac{{1}}{{9}}.

Therefore, x(x+2)2(x1)=191x+2+231(x+2)2+191x1\frac{{x}}{{{{\left({x}+{2}\right)}}^{{2}}{\left({x}-{1}\right)}}}=-\frac{{1}}{{9}}\frac{{1}}{{{x}+{2}}}+\frac{{2}}{{3}}\frac{{1}}{{{\left({x}+{2}\right)}}^{{2}}}+\frac{{1}}{{9}}\frac{{1}}{{{x}-{1}}}.

Thus, required integral is (191x+2+131(x+2)2+191x1)dx=\int{\left(-\frac{{1}}{{9}}\frac{{1}}{{{x}+{2}}}+\frac{{1}}{{3}}\frac{{1}}{{{\left({x}+{2}\right)}}^{{2}}}+\frac{{1}}{{9}}\frac{{1}}{{{x}-{1}}}\right)}{d}{x}=

=19lnx+2231x+2+19lnx1+C=-\frac{{1}}{{9}}{\ln}{\left|{x}+{2}\right|}-\frac{{2}}{{3}}\frac{{1}}{{{x}+{2}}}+\frac{{1}}{{9}}{\ln}{\left|{x}-{1}\right|}+{C}.

Example 8. Find x2x21dx\int\frac{{{x}}^{{2}}}{{{{x}}^{{2}}-{1}}}{d}{x}.

First perform long division: x2x21=1+1x21\frac{{{{x}}^{{2}}}}{{{{x}}^{{2}}-{1}}}={1}+\frac{{1}}{{{{x}}^{{2}}-{1}}}.

Partial fraction decomposition is 1x21=121x1121x+1\frac{{1}}{{{{x}}^{{2}}-{1}}}=\frac{{1}}{{2}}\frac{{1}}{{{x}-{1}}}-\frac{{1}}{{2}}\frac{{1}}{{{x}+{1}}}.

Therefore, x2x21dx=(1+121x1121x+1)dx=x+12lnx112lnx+1+C\int\frac{{{{x}}^{{2}}}}{{{{x}}^{{2}}-{1}}}{d}{x}=\int{\left({1}+\frac{{1}}{{2}}\frac{{1}}{{{x}-{1}}}-\frac{{1}}{{2}}\frac{{1}}{{{x}+{1}}}\right)}{d}{x}={x}+\frac{{1}}{{2}}{\ln}{\left|{x}-{1}\right|}-\frac{{1}}{{2}}{\ln}{\left|{x}+{1}\right|}+{C}.

Some integral with roots can be expressed as integral of rational function.

Example 9. 1xx+2dx\int\frac{{1}}{{{x}-\sqrt{{{x}+{2}}}}}{d}{x}.

Let u=x+2{u}=\sqrt{{{x}+{2}}} then du=121x+2dx{d}{u}=\frac{{1}}{{2}}\frac{{1}}{{\sqrt{{{x}+{2}}}}}{d}{x} or dx=2x+2du=2udu{d}{x}={2}\sqrt{{{x}+{2}}}{d}{u}={2}{u}{d}{u}.

Also since u=x+2{u}=\sqrt{{{x}+{2}}} then x=u22{x}={{u}}^{{2}}-{2}.

So, 1xx+2dx=2uu2u2du\int\frac{{1}}{{{x}-\sqrt{{{x}+{2}}}}}{d}{x}=\int\frac{{{2}{u}}}{{{{u}}^{{2}}-{u}-{2}}}{d}{u}.

Since u2u2=(u2)(u+1){{u}}^{{2}}-{u}-{2}={\left({u}-{2}\right)}{\left({u}+{1}\right)} then partial fraction decomposition is 2u(u2)(u+1)=Au2+Bu+1\frac{{{2}{u}}}{{{\left({u}-{2}\right)}{\left({u}+{1}\right)}}}=\frac{{A}}{{{u}-{2}}}+\frac{{B}}{{{u}+{1}}}.

Multiplying by (u2)(u+1){\left({u}-{2}\right)}{\left({u}+{1}\right)} yields 2u=A(u+1)+B(u2){2}{u}={A}{\left({u}+{1}\right)}+{B}{\left({u}-{2}\right)}.

If u=1{u}=-{1} then 2(1)=A(1+1)+B(12){2}\cdot{\left(-{1}\right)}={A}{\left(-{1}+{1}\right)}+{B}{\left(-{1}-{2}\right)} or B=23{B}=\frac{{2}}{{3}}.

If u=2{u}={2} then 22=A(2+1)+B(22){2}\cdot{2}={A}{\left({2}+{1}\right)}+{B}{\left({2}-{2}\right)} or A=43{A}=\frac{{4}}{{3}}.

So, 2uu2u2du=(431u2+231u+1)du=43lnu2+23lnu+1+C=\int\frac{{{2}{u}}}{{{{u}}^{{2}}-{u}-{2}}}{d}{u}=\int{\left(\frac{{4}}{{3}}\frac{{1}}{{{u}-{2}}}+\frac{{2}}{{3}}\frac{{1}}{{{u}+{1}}}\right)}{d}{u}=\frac{{4}}{{3}}{\ln}{\left|{u}-{2}\right|}+\frac{{2}}{{3}}{\ln}{\left|{u}+{1}\right|}+{C}=

=43lnx+22+23lnx+2+1+C=\frac{{4}}{{3}}{\ln}{\left|\sqrt{{{x}+{2}}}-{2}\right|}+\frac{{2}}{{3}}{\ln}{\left|\sqrt{{{x}+{2}}}+{1}\right|}+{C}.

Example 10. Find 3x+5x2+10x+34dx\int\frac{{{3}{x}+{5}}}{{{{x}}^{{2}}+{10}{x}+{34}}}{d}{x}.

Factor in denominator is irreducible, so complete the square: x2+10x+34=x2+10x+25+9=(x+5)2+9{{x}}^{{2}}+{10}{x}+{34}={{x}}^{{2}}+{10}{x}+{25}+{9}={{\left({x}+{5}\right)}}^{{2}}+{9}.

Now make substitution u=x+5{u}={x}+{5} then du=dx{d}{u}={d}{x} and x=u5{x}={u}-{5}.

Thus, 3x+5x2+10x+34dx=3(u5)+5u2+9du=3uu2+9du101u2+9du=\int\frac{{{3}{x}+{5}}}{{{{x}}^{{2}}+{10}{x}+{34}}}{d}{x}=\int\frac{{{3}{\left({u}-{5}\right)}+{5}}}{{{{u}}^{{2}}+{9}}}{d}{u}={3}\int\frac{{u}}{{{{u}}^{{2}}+{9}}}{d}{u}-{10}\int\frac{{1}}{{{{u}}^{{2}}+{9}}}{d}{u}=

=32lnu2+9103arctan(u3)+C=32ln((x+5)2+9)103arctan(x+53)+C=\frac{{3}}{{2}}{\ln}{\left|{{u}}^{{2}}+{9}\right|}-\frac{{10}}{{3}}{\operatorname{arctan}{{\left(\frac{{u}}{{3}}\right)}}}+{C}=\frac{{3}}{{2}}{\ln{{\left({{\left({x}+{5}\right)}}^{{2}}+{9}\right)}}}-\frac{{10}}{{3}}{\operatorname{arctan}{{\left(\frac{{{x}+{5}}}{{3}}\right)}}}+{C}.

Now, let's see how to handle integrals where irreducible factor is raised to some power.

Example 11. Evaluate 1(x2+4x+13)3dx\int\frac{{1}}{{{\left({{x}}^{{2}}+{4}{x}+{13}\right)}}^{{3}}}{d}{x}.

We first complete the square: x2+4x+13=x2+4x+4+9=(x+2)2+9{{x}}^{{2}}+{4}{x}+{13}={{x}}^{{2}}+{4}{x}+{4}+{9}={{\left({x}+{2}\right)}}^{{2}}+{9}.

Now, make substitution u=x+2{u}={x}+{2} then du=dx{d}{u}={d}{x}.

1((x+2)2+9)3dx=1(u2+9)3du\int\frac{{1}}{{{\left({{\left({x}+{2}\right)}}^{{2}}+{9}\right)}}^{{3}}}{d}{x}=\int\frac{{1}}{{{\left({{u}}^{{2}}+{9}\right)}}^{{3}}}{d}{u}.

We will need trig substitution here.

Let u=3tan(t){u}={3}{\tan{{\left({t}\right)}}} then u2+9=9tan2(t)+9=9sec2(t){{u}}^{{2}}+{9}={9}{{\tan}}^{{2}}{\left({t}\right)}+{9}={9}{{\sec}}^{{2}}{\left({t}\right)} and du=3sec2(t)dt{d}{u}={3}{{\sec}}^{{2}}{\left({t}\right)}{d}{t}.

So, 1(u2+9)3du=3sec2(t)9sec2(t)dt=12431sec4(t)dt\int\frac{{1}}{{{\left({{u}}^{{2}}+{9}\right)}}^{{3}}}{d}{u}=\int\frac{{{3}{{\sec}}^{{2}}{\left({t}\right)}}}{{{9}{{\sec}}^{{2}}{\left({t}\right)}}}{d}{t}=\frac{{1}}{{243}}\int\frac{{1}}{{{{\sec}}^{{4}}{\left({t}\right)}}}{d}{t}.

To find this integral we need to use techniques from Integrals Involving Trig Functions note.

12431sec4(t)dt=1243cos4(t)dt=1243(cos2(t))2dt=1243(12(1+cos(2t)))2dt=\frac{{1}}{{243}}\int\frac{{1}}{{{{\sec}}^{{4}}{\left({t}\right)}}}{d}{t}=\frac{{1}}{{243}}\int{{\cos}}^{{4}}{\left({t}\right)}{d}{t}=\frac{{1}}{{243}}\int{{\left({{\cos}}^{{2}}{\left({t}\right)}\right)}}^{{2}}{d}{t}=\frac{{1}}{{243}}\int{{\left(\frac{{1}}{{2}}{\left({1}+{\cos{{\left({2}{t}\right)}}}\right)}\right)}}^{{2}}{d}{t}=

=1972(1+2cos(2t)+cos2(2t))dt=1972(1+2cos(2t)+12(1+cos(4t)))dt==\frac{{1}}{{972}}\int{\left({1}+{2}{\cos{{\left({2}{t}\right)}}}+{{\cos}}^{{2}}{\left({2}{t}\right)}\right)}{d}{t}=\frac{{1}}{{972}}\int{\left({1}+{2}{\cos{{\left({2}{t}\right)}}}+\frac{{1}}{{2}}{\left({1}+{\cos{{\left({4}{t}\right)}}}\right)}\right)}{d}{t}=

=1972(32t+sin(2t)+18sin(4t))+C=\frac{{1}}{{972}}{\left(\frac{{3}}{{2}}{t}+{\sin{{\left({2}{t}\right)}}}+\frac{{1}}{{8}}{\sin{{\left({4}{t}\right)}}}\right)}+{C}.

Since u=3tan(t){u}={3}{\tan{{\left({t}\right)}}} and u=(x+2){u}={\left({x}+{2}\right)} then t=arctan(x+23){t}={\operatorname{arctan}{{\left(\frac{{{x}+{2}}}{{3}}\right)}}}.

So, 1(x2+4x+13)3dx=\int\frac{{1}}{{{\left({{x}}^{{2}}+{4}{x}+{13}\right)}}^{{3}}}{d}{x}=

=1972(32arctan(x+23)+sin(2arctan(x+23))+18sin(4arctan(x+23)))+C=\frac{{1}}{{972}}{\left(\frac{{3}}{{2}}{\operatorname{arctan}{{\left(\frac{{{x}+{2}}}{{3}}\right)}}}+{\sin{{\left({2}{\operatorname{arctan}{{\left(\frac{{{x}+{2}}}{{3}}\right)}}}\right)}}}+\frac{{1}}{{8}}{\sin{{\left({4}{\operatorname{arctan}{{\left(\frac{{{x}+{2}}}{{3}}\right)}}}\right)}}}\right)}+{C}.