<s>[INST] Integral of $\frac{1}{\sqrt{x^2-x}}dx$ For a differential equation I have to solve the integral $\frac{dx}{\sqrt{x^2-x}}$. I eventually have to write the solution in the form $ x = ...$ It doesn't matter if I solve the integral myself or if I use a table to find the integral. However, the only helpful integral in an integral table I could find was:
$$\frac{dx}{\sqrt{ax^2+bx+c}} = \frac{1}{\sqrt{a}} \ln \left|2ax + b +2\sqrt{a\left({ax^2+bx+c}\right)}\right|$$
Which would in my case give:
$$\frac{dx}{\sqrt{x^2-x}} = \ln \left|2x -1 + 2\sqrt{x^2-x}\right|$$
Which has me struggling with the absolute value signs as I need to extract x from the solution. All I know is that $x<0$ which does not seem to help me either (the square root will only be real if $x<-1$). 
Is there some other formula for solving this integral which does not involve absolute value signs or which makes extracting $x$ from the solution somewhat easier? Thanks!
 [/INST] $$
\displaylines{
  \sqrt {x^2  - x}  = t + x \cr 
   \Leftrightarrow x^2  - x = t^2  + 2xt + x^2  \cr 
   \Leftrightarrow  - x = t^2  + 2xt \cr 
   - x = \frac{{t^2 }}{{1 + 2t}} \Rightarrow  - dx = \frac{{2\left( {t^2  + 1} \right)}}{{\left( {1 + 2t} \right)^2 }}dt \cr 
  \frac{{dx}}{{\sqrt {x^2  - x} }} =  - \frac{{\frac{{2\left( {t^2  + 1} \right)}}{{\left( {1 + 2t} \right)^2 }}dt}}{{t - \frac{{t^2 }}{{1 + 2t}}}} \cr 
   = \frac{{2\left( {t^2  + 1} \right)dt}}{{t\left( {1 + 2t} \right)\left( {t + 1} \right)}} \cr 
  \frac{{2\left( {t^2  + 1} \right)}}{{t\left( {1 + 2t} \right)\left( {t + 1} \right)}} = \frac{\alpha }{t} + \frac{\beta }{{t + 1}} + \frac{\lambda }{{1 + 2t}} \cr}
$$
$$\displaylines{
  \frac{{2\left( {t^2  + 1} \right)}}{{t\left( {1 + 2t} \right)\left( {t + 1} \right)}} = \frac{\alpha }{t} + \frac{\beta }{{t + 1}} + \frac{\lambda }{{1 + 2t}} \cr 
   = \frac{{\lambda \left( {t^2  + t} \right) + \beta \left( {2t^2  + t} \right) + \alpha \left( {2t^2  + 3t + 1} \right)}}{{t\left( {1 + 2t} \right)\left( {t + 1} \right)}} \cr 
   = \frac{{t^2 \left( {\lambda  + 2\beta  + 2\alpha } \right) + t\left( {\lambda  + \beta  + 3\alpha } \right) + \alpha }}{{t\left( {1 + 2t} \right)\left( {t + 1} \right)}} \cr 
   \Rightarrow \left\{ \begin{array}{l}
 \alpha  = 2 \\ 
 \lambda  + \beta  + 6 = 0 \\ 
 .\lambda  + 2\beta  + 4 = 2 \\ 
 \end{array} \right. \Rightarrow \left\{ \begin{array}{l}
 \alpha  = 2 \\ 
 \beta  = 4 \\ 
 \lambda  =  - 10 \\ 
 \end{array} \right. \cr}
$$
$$
\int {\frac{{2\left( {t^2  + 1} \right)dt}}{{t\left( {1 + 2t} \right)\left( {t + 1} \right)}}}  = 2\ln \left( t \right) + 4\ln \left( {1 + t} \right) - 5\ln \left( {1 + 2t} \right)
$$
$$\int {\frac{{dx}}{{\sqrt {x^2  - x} }}}  = \ln \left( {\frac{{\left( { - x + \sqrt {x^2  - x} } \right)^2 \left( {1 + \left( { - x + \sqrt {x^2  - x} } \right)} \right)^4 }}{{\left( {1 + 2\left( { - x + \sqrt {x^2  - x} } \right)} \right)^5 }}} \right)$$
</s>