A problem asked by Vijay

Evaluate $\int \frac{dx}{x+\sqrt{x^2 - x +1}} $

Answer:

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

$=\int \frac{dx}{x+\sqrt{(x-\frac{1}{2})^2 + \frac{3}{4} }} $

Substitute $x - \frac{1}{2} = \frac{\sqrt{3}}{2}\tan t $ and $dx = \frac{\sqrt{3}}{2} \sec^2 t \; dt $

$\int \frac{dx}{x+\sqrt{(x-\frac{1}{2})^2 + \frac{3}{4} }} $

$=\int \frac{ \frac{\sqrt{3}} {2} \sec^2 t \; dt } { \frac{1}{2} + \frac{\sqrt{3}}{2} \tan t + \frac{\sqrt{3}}{2} \sec t } $

$=\int \frac{ \sqrt{3} \sec^2 t \; dt } { 1 + \sqrt{3} (\tan t + \sec t) } $

Substitute $u = \sec t + \tan t $ and $du = \sec t(\sec t + \tan t) \; dt = u \sec t \; dt$ and

$\sec t \;dt = \frac{du}{u} $

Note also that $\sec t - \tan t = \frac{1}{u} $ or $\sec t = \frac{1}{2}\left(u + \frac{1}{u}\right) $

So, $\sec^2 t \; dt = \frac{du}{2u}\left(u + \frac{1}{u}\right) = $

and we have

$\int \frac{ \sqrt{3} \sec^2 t \; dt } { 1 + \sqrt{3} (\tan t + \sec t) } $

$= \frac{\sqrt{3}}{2} \int \frac{(u^2+ 1) \; du } { u^2(1 + \sqrt{3} u) } $

$= \frac{\sqrt{3}}{2} \int \left( \frac{1}{u^2} - \frac{\sqrt{3}} {u} + \frac{4}{(1+\sqrt{3} u)} \right) \; du$

$= \frac{\sqrt{3}}{2} \left( \frac{-1}{u} - \sqrt{3} \ln|u| + \frac{4}{\sqrt{3}} ln|1+\sqrt{3} u| \right) + C $

Substitute back $u = \frac{2}{\sqrt{3}} \left( \sqrt{x^2 -x+1} + x - \frac{1}{2} \right) $ to get the final result.