# Indefinite integration of a fraction with a non-factorable denominator

Solve the integral below:

$$\int \frac{x+1}{x^2-4x+6} \, dx$$

I tried u-sub and got

$$u=x^2-4x+6$$ $$du = 2x - 4 dx \leftrightarrow dx = \frac{1}{2(x-2)}du$$ $$\int \frac{x+1}{u} \frac{1}{2(x-2)} \, du = \frac{1}{2}\int \frac{x+1}{x-2} \frac{1}{u} \, du$$

Since that didn't lead me anywhere, I tried long division, which didn't help either. I was considering partial fraction decomposition however, I can't factor the denominator, so I'm stuck. Where do I go from here? Please let me know if any further clarification is necessary.

What you want to do is complete the square in the denominator, and the apply the appropriate trigonometric substitution which in this case will be $x-2=\sqrt2\tan\theta$: \begin{align}\int\frac{x+1}{x^2-4x+6}dx&=\int\frac{(x-2)+3}{(x-2)^2+2}dx=\int\frac{\sqrt2\tan\theta+3}{2\sec^2\theta}\sqrt2\sec^2\theta\,d\theta\\ &=\int\left(\tan\theta+\frac3{\sqrt2}\right)d\theta=-\ln\cos\theta+\frac3{\sqrt2}\theta+C_1\\ &=-\ln\left(\frac{\sqrt2}{\sqrt{(x-2)^2+2}}\right)+\frac3{\sqrt2}\tan^{-1}\frac{x-2}{\sqrt2}+C_1\\ &=\frac12\ln(x^2-4x+6)+\frac3{\sqrt2}\tan^{-1}\frac{x-2}{\sqrt2}+C\end{align} Differentiation confirms this result.
• Completing the square means trying to write $x^2+bx+c$ somehow as $\left(x+\frac b2\right)^2+d$. If you expand the latter expression out, it reads $x^2+bx+\frac{b^2}4+d=x^2+bx+c$. So it's a perfect match already, except we need $\frac{b^2}4+d=c$, so we find that $d=c-\frac{b^2}4$. In this case $b=-4$ and $c=6$ so we conclude that $d=6-\frac{(-4)^2}4=2$ and $x^2-4x+6=\left(x+\frac{(-4)}2\right)^2+2=\left(x-2\right)^2+2$. – user5713492 May 20 '16 at 11:22
You can write the integral as$$\frac 12\int\frac{2x-4}{x^2-4x+6}dx+\int\frac{3}{(x-2)^2+2}dx$$ $$=\frac 12\ln(x^2-4x+6)+\frac{3}{\sqrt{2}}\arctan\left(\frac{x-2}{\sqrt{2}}\right)+c$$