# Evaluate the indefinite integral. (Use C for the constant of integration.) integral {x^2 - 3 x +...

## Question:

Evaluate the indefinite integral. (Use C for the constant of integration.)

{eq}\displaystyle \int \dfrac {x^2 - 3 x + 12} {(x^2 - 4 x + 11 )^2}\ dx {/eq}.

## Integration & substitution

Basically u-substitution in integration is to use chain rule .

This helps to recognize the integrand as an exact derivative.

Prerequisites

{eq}\int \frac{1}{\left(x^2+7\right)^2}dx \\ \mathrm{Apply\:Integral\:Substitution:}\:x=\sqrt{7}v \\ =\int \frac{\sqrt{7}}{\left(7v^2+7\right)^2}dv \\ =\sqrt{7}\frac{1}{49}\cdot \int \frac{1}{\left(v^2+1\right)^2}dv \\ \mathrm{Apply\:Trig\:Substitution:}\:v=\tan \left(w\right) \\ =\sqrt{7}\frac{1}{49}\cdot \int \frac{1}{\sec ^4\left(w\right)\cos ^2\left(w\right)}dw \\ =\sqrt{7}\frac{1}{49}\cdot \frac{1}{2}\left(\int \:1dw+\int \cos \left(2w\right)dw\right) \\ =\sqrt{7}\frac{1}{49}\cdot \frac{1}{2}\left(\arctan \left(\frac{x}{\sqrt{7}}\right)+\frac{1}{2}\sin \left(2\arctan \left(\frac{x}{\sqrt{7}}\right)\right)\right) \\ =\frac{1}{14\sqrt{7}}\arctan \left(\frac{x}{\sqrt{7}}\right)+\frac{x}{14\left(7+x^2\right)} {/eq}

{eq}\int \frac{x^2-3x+12}{\left(x^2-4x+11\right)^2}dx \\ \mathrm{Take\:the\:partial\:fraction\:of}\:\frac{x^2-3x+12}{\left(x^2-4x+11\right)^2}=\frac{x+1}{\left(x^2-4x+11\right)^2}+\frac{1}{x^2-4x+11} \\ =\int \frac{x+1}{\left(x^2-4x+11\right)^2}+\frac{1}{x^2-4x+11}dx {/eq}

Integrating seperately

{eq}\int \frac{x+1}{\left(x^2-4x+11\right)^2}dx \\ \mathrm{Complete\:the\:square}\:x^2-4x+11= \left(x-2\right)^2+7 \\ \mathrm{Apply\:u-substitution:}\:u=x-2:du=dx \\ =\int \frac{u+3}{\left(u^2+7\right)^2}du \\ \mathrm{Apply\:Integration\:By\:Parts:}\:u=u+3,\:v=\frac{1}{\left(u^2+7\right)^2} \\ =\left(u+3\right)\left(\frac{1}{14\sqrt{7}}\arctan \left(\frac{u}{\sqrt{7}}\right)+\frac{u}{14\left(7+u^2\right)}\right)-\int \frac{1}{14\sqrt{7}}\arctan \left(\frac{u}{\sqrt{7}}\right)+\frac{u}{14\left(7+u^2\right)}du {/eq}

Now

{eq}\int \frac{1}{14\sqrt{7}}\arctan \left(\frac{u}{\sqrt{7}}\right)+\frac{u}{14\left(7+u^2\right)}du \\ =\int \frac{1}{14\sqrt{7}}\arctan \left(\frac{u}{\sqrt{7}}\right)du+\int \frac{u}{14\left(7+u^2\right)}du \\ {/eq}

Again integrating seperately

{eq}\int \frac{1}{14\sqrt{7}}\arctan \left(\frac{u}{\sqrt{7}}\right)du \\ \mathrm{Apply\:Integration\:By\:Parts:}\:u=\arctan \left(\frac{u}{\sqrt{7}}\right),\:v=1 \\ =\frac{1}{14\sqrt{7}}\left(u\arctan \left(\frac{u}{\sqrt{7}}\right)-\int \frac{\sqrt{7}u}{u^2+7}du\right) \\ \int \frac{\sqrt{7}u}{u^2+7}du \\ =\sqrt{7}\cdot \int \frac{u}{u^2+7}du \\ \mathrm{Apply\:u-substitution:}\:v=u^2+7 \\ =\sqrt{7}\frac{1}{2}\cdot \int \frac{1}{v}dv \\ =\sqrt{7}\frac{1}{2}\ln \left|v\right| \\ =\frac{\sqrt{7}}{2}\ln \left|u^2+7\right| \\ \int \frac{1}{14\sqrt{7}}\arctan \left(\frac{u}{\sqrt{7}}\right)du=\frac{1}{14\sqrt{7}}\left(u\arctan \left(\frac{u}{\sqrt{7}}\right)-\frac{\sqrt{7}}{2}\ln \left|u^2+7\right|\right) \\ =\frac{1}{14\sqrt{7}}u\arctan \left(\frac{u}{\sqrt{7}}\right)-\frac{1}{14\sqrt{7}}\cdot \frac{\sqrt{7}}{2}\ln \left|u^2+7\right| \\ =\frac{1}{14\sqrt{7}}u\arctan \left(\frac{u}{\sqrt{7}}\right)-\frac{\sqrt{7}}{2}\cdot \frac{1}{14\sqrt{7}}\ln \left|u^2+7\right| \\ =\frac{1}{14\sqrt{7}}u\arctan \left(\frac{u}{\sqrt{7}}\right)-\frac{1}{28}\ln \left|u^2+7\right| {/eq}

And

{eq}\int \frac{u}{14\left(7+u^2\right)}du \\ \mathrm{Apply\:u-substitution:}\:v=7+u^2:dv=3udu \\ =\frac{1}{14}\cdot \frac{1}{2}\cdot \int \frac{1}{v}dv \\ =\frac{1}{14}\cdot \frac{1}{2}\ln \left|v\right| \\ \mathrm{Substitute\:back}\:v=7+u^2 \\ =\frac{1}{14}\cdot \frac{1}{2}\ln \left|7+u^2\right| \\ =\frac{1}{28}\ln \left|7+u^2\right| {/eq}

Thus we get

{eq}\int \frac{x+1}{\left(x^2-4x+11\right)^2}dx \\ =\left(u+3\right)\left(\frac{1}{14\sqrt{7}}\arctan \left(\frac{u}{\sqrt{7}}\right)+\frac{u}{14\left(7+u^2\right)}\right)-\int \frac{1}{14\sqrt{7}}\arctan \left(\frac{u}{\sqrt{7}}\right)+\frac{u}{14\left(7+u^2\right)}du \\ =\left(u+3\right)\left(\frac{1}{14\sqrt{7}}\arctan \left(\frac{u}{\sqrt{7}}\right)+\frac{u}{14\left(7+u^2\right)}\right)-\frac{1}{14\sqrt{7}}u\arctan \left(\frac{u}{\sqrt{7}}\right)-\frac{1}{28}\ln \left|u^2+7\right|+\frac{1}{28}\ln \left|7+u^2\right| \\ =\left(u+3\right)\left(\frac{1}{14\sqrt{7}}\arctan \left(\frac{u}{\sqrt{7}}\right)+\frac{u}{14\left(7+u^2\right)}\right)-\frac{1}{14\sqrt{7}}u\arctan \left(\frac{u}{\sqrt{7}}\right) \\ \mathrm{Substitute\:back}\:u=x-2 \\ =\left(x-2+3\right)\left(\frac{1}{14\sqrt{7}}\arctan \left(\frac{x-2}{\sqrt{7}}\right)+\frac{x-2}{14\left(7+\left(x-2\right)^2\right)}\right)-\frac{1}{14\sqrt{7}}\left(x-2\right)\arctan \left(\frac{x-2}{\sqrt{7}}\right) \\ simplify \\ =\left(x+1\right)\left(\frac{x-2}{14\left(x^2-4x+11\right)}+\frac{1}{14\sqrt{7}}\arctan \left(\frac{x-2}{\sqrt{7}}\right)\right)-\frac{1}{14\sqrt{7}}\arctan \left(\frac{x-2}{\sqrt{7}}\right)\left(x-2\right) \\ =\left(x+1\right)\left(\frac{1}{14\sqrt{7}}\arctan \left(\frac{x-2}{\sqrt{7}}\right)+\frac{x-2}{14\left(x^2-4x+11\right)}\right)-\frac{1}{14\sqrt{7}}\arctan \left(\frac{x-2}{\sqrt{7}}\right)\left(x-2\right) \\ Expand \\ \mathrm{Apply\:FOIL\:method}:\quad \left(a+b\right)\left(c+d\right)=ac+ad+bc+bd \\ =x\frac{1}{14\sqrt{7}}\arctan \left(\frac{x-2}{\sqrt{7}}\right)+x\frac{x-2}{14\left(x^2-4x+11\right)}+1\cdot \frac{1}{14\sqrt{7}}\arctan \left(\frac{x-2}{\sqrt{7}}\right)+1\cdot \frac{x-2}{14\left(x^2-4x+11\right)}-\frac{1}{14\sqrt{7}}x\arctan \left(\frac{x-2}{\sqrt{7}}\right)+\frac{1}{7\sqrt{7}}\arctan \left(\frac{x-2}{\sqrt{7}}\right) \\ =\frac{1}{14\sqrt{7}}x\arctan \left(\frac{x-2}{\sqrt{7}}\right)-\frac{1}{14\sqrt{7}}x\arctan \left(\frac{x-2}{\sqrt{7}}\right)+\frac{x\left(x-2\right)}{14\left(x^2-4x+11\right)}+\frac{x-2}{14\left(x^2-4x+11\right)}+\frac{1}{7\sqrt{7}}\arctan \left(\frac{x-2}{\sqrt{7}}\right)+\frac{1}{14\sqrt{7}}\arctan \left(\frac{x-2}{\sqrt{7}}\right) \\ \\ \mathrm{Group\:like\:terms}Add\:similar\:elements \\ =\frac{x\left(x-2\right)}{14\left(x^2-4x+11\right)}+\frac{x-2}{14\left(x^2-4x+11\right)}+\frac{3}{14\sqrt{7}}\arctan \left(\frac{1}{\sqrt{7}}\left(x-2\right)\right) \\ {/eq}

Integrating the second part

{eq}\int \frac{1}{x^2-4x+11}dx \\ \mathrm{Complete\:the\:square}\:x^2-4x+11= \left(x-2\right)^2+7 \\ =\int \frac{1}{\left(x-2\right)^2+7}dx \\ \mathrm{Apply\:u-substitution:}\:u=x-2:du=dv \\ =\int \frac{1}{u^2+7}du \\ \mathrm{Apply\:Integral\:Substitution:}\:u=\sqrt{7}v \\ =\int \frac{1}{\sqrt{7}\left(v^2+1\right)}dv \\ =\frac{1}{\sqrt{7}}\arctan \left(v\right) \\ \mathrm{Substitute\:back}\:v=\frac{u}{\sqrt{7}},\:u=x-2 \\ =\frac{1}{\sqrt{7}}\arctan \left(\frac{x-2}{\sqrt{7}}\right) {/eq}

{eq}\int \frac{x^2-3x+12}{\left(x^2-4x+11\right)^2}dx \\ =\int \frac{x+1}{\left(x^2-4x+11\right)^2}+\frac{1}{x^2-4x+11}dx \\ =\frac{x\left(x-2\right)}{14\left(x^2-4x+11\right)}+\frac{x-2}{14\left(x^2-4x+11\right)}+\frac{3}{14\sqrt{7}}\arctan \left(\frac{1}{\sqrt{7}}\left(x-2\right)\right)+\frac{1}{\sqrt{7}}\arctan \left(\frac{x-2}{\sqrt{7}}\right) {/eq}

Therfore

{eq}\int\frac{x^2-3x+12}{\left(x^2-4x+11\right)^2}dx=\frac{x\left(x-2\right)}{14\left(x^2-4x+11\right)}+\frac{x-2}{14\left(x^2-4x+11\right)}+\frac{3}{14\sqrt{7}}\arctan \left(\frac{1}{\sqrt{7}}\left(x-2\right)\right)+\frac{1}{\sqrt{7}}\arctan \left(\frac{x-2}{\sqrt{7}}\right)+C {/eq}