# Mahnoor Jafer's question at Yahoo! Answers regarding an indefinite integral

#### MarkFL

Staff member
Here is the question:

Integration of x/[(x)^2-4x+8] dx?
I have posted a link there to this thread so the OP can view my work.

#### MarkFL

Staff member
Hello Mahnoor Jafer,

We are given to evaluate:

$$\displaystyle I=\int\frac{x}{x^2-4x+8}\,dx$$

Observing that:

$$\displaystyle \frac{d}{dx}\left(x^2-4x+8 \right)=2x-4$$ we will then rewrite the integral as follows:

$$\displaystyle I=\frac{1}{2}\int\frac{2x-4+4}{x^2-4x+8}\,dx=\frac{1}{2}\int\frac{2x-4}{x^2-4x+8}\,dx+2\int\frac{1}{(x-2)^2+2^2}\,dx$$

For the first integral on the right:

Use the substitution:

$$\displaystyle u=x^2-4x+8\,\therefore\,du=(2x-4)\,du$$

For the second integral on the right:

Use the substitution:

$$\displaystyle x-2=2\tan(\theta)\,\therefore\,dx=2\sec^2(\theta)\,d\theta$$

And we obtain:

$$\displaystyle I=\frac{1}{2}\int\frac{1}{u}\,du+\int\frac{\sec^2(\theta)}{\tan^2(\theta)+1}\,d\theta$$

Applying the Pythagorean identity $$\displaystyle \tan^2(x)+1=\sec^2(x)$$ on the second integral, we obtain:

$$\displaystyle I=\frac{1}{2}\int\frac{1}{u}\,du+\int\,d\theta$$

Now, using the rules of integration, we obtain:

$$\displaystyle I=\frac{1}{2}\ln|u|+\theta+C$$

Back-substituting for $u$ and $\theta$, we obtain:

$$\displaystyle I=\frac{1}{2}\ln\left|x^2-4x+8 \right|+\tan^{-1}\left(\frac{x-2}{2} \right)+C$$

Hence, we have found:

$$\displaystyle \int\frac{x}{x^2-4x+8}\,dx=\frac{1}{2}\ln\left|x^2-4x+8 \right|+\tan^{-1}\left(\frac{x-2}{2} \right)+C$$