Integrate: $\int{\sqrt{x^2-x+1}} dx$

calculusintegration

My question is:
Integrate: $\int{\sqrt{x^2-x+1}} dx$

I've tried completing the square, then using various substitutions e.g. $\tan(u)=x$ but haven't been successful so far. I've also tried integrating by parts but it got too messy. Would appreciate if someone could give a clue or a possible soln.

Also is there a general strategy to handle such integration problems. i.e. the square root of a function with discriminant less than 0?

Best Answer

$$ \begin{aligned} I &=\int \sqrt{x^{2}-x+1} d x \\ &=x \sqrt{x^{2}-x+1}-\int x \frac{2 x-1}{2 \sqrt{x^{2}-x+1}} d x \\ &=x \sqrt{x^{2}-x+1}-\int \frac{2\left(x^{2}-x+1\right)+\left(x-\frac{1}{2}\right)-\frac{3}{2}}{2 \sqrt{x^{2}-x+1}} d x \\ &=x \sqrt{x^{2}-x+1}-I-\frac{1}{4} \int \frac{2 x-1}{\sqrt{x^{2}-x+1}} d x+\frac{3}{4} \int \frac{d x}{\sqrt{x^{2}-x+1}} \\ &=\frac{1}{2}\left(x \sqrt{x^{2}-x+1}-\frac{1}{2} \sqrt{x^{2}-x+1}\right)+\frac{3}{8} \int \frac{d x}{\sqrt{\left(x-\frac{1}{2}\right)^{2}+\frac{3}{4}}} \end{aligned} $$

For the last integral, letting $x-\frac{1}{2}=\frac{\sqrt{3}}{2} \tan \theta$ yields

$$ \begin{aligned} \int \frac{d x}{\sqrt{\left(x-\frac{1}{2}\right)^{2}+\frac{3}{4}}}&=\int \frac{\frac{\sqrt{3}}{2} \sec ^{2} \theta d \theta}{\sqrt{\frac{3}{4} \tan ^{2} \theta+\frac{3}{4}}} \\ &=\int \sec \theta d \theta \\ &=\ln |\sec \theta+\tan \theta|+C_1 \\ &=\ln \left|\frac{2 \sqrt{x^{2}-x+1}}{\sqrt{3}}+\frac{2 x-1}{\sqrt{3}}\right|+C_1 \\ &=\ln \left|2 x-1+2 \sqrt{x^{2}-x+1}\right|+C_2 \end{aligned} $$ Now we can conclude that $$ I=\frac{2 x-1}{4} \sqrt{x^{2}-x+1}+\frac{3}{8} \ln \left|2 x-1+2 \sqrt{x^{2}-x+1}\right|+C $$

Alternate Method(Using hyperbolic functions)

Letting $x-\frac{1}{2}=\frac{\sqrt{3}}{2} \sinh \theta$ yields

$$ \begin{aligned} \int \frac{d x}{\sqrt{\left(x-\frac{1}{2}\right)^{2}+\frac{3}{4}}} &=\int \frac{\frac{\sqrt{3}}{2} \cosh \theta d \theta}{\sqrt{\frac{3}{4} \sinh ^{2} \theta+\frac{3}{4}}} \\ &=\int d \theta \\ &=\theta \\ &=\sinh ^{-1}\left(\frac{2 x-1}{\sqrt{3}}\right) \end{aligned} $$$$ \boxed{ I=\frac{2 x-1}{4} \sqrt{x^{2}-x+1}+\frac{3}{8} \sinh ^{-1}\left(\frac{2 x-1}{\sqrt{3}}\right)+C }\tag*{} $$