Evaluate $\int \frac{dx}{(x^2-x+1)\sqrt{x^2+x+1}}$ Evaluate $$I=\int \frac{dx}{(x^2-x+1)\sqrt{x^2+x+1}}$$
My book gave the substitution for $$\int \frac{dx}{P\sqrt{Q}}$$ as
$\frac{Q}{P}=t^2$ when $P$ and $Q$ are quadratic expressions
So accordingly i used   
$$\frac{x^2+x+1}{x^2-x+1}=t^2 \tag{1}$$ we get
$$\frac{(1-x^2) \, dx}{(x^2-x+1)^2}=t \,dt$$
Then
$$I=\int \frac{\sqrt{x^2-x+1}\:dt}{1-x^2}$$
By Componendo Dividendo in $(1)$ we get
$$\frac{x^2+1}{x}=\frac{t^2+1}{t^2-1}$$
But how to express integrand purely in terms of $t$?

We have that $$\frac{x^2+1}{x}=\frac{t^2+1}{t^2-1}\tag{1}$$ so $$\frac{\sqrt{x^2-x+1}}{1-x^2}=\frac{\sqrt{x\left(\frac{t^2+1}{t^2-1}-1\right)}}{1-x\cdot\frac{t^2+1}{t^2-1}+1}=\frac{(t^2-1)\sqrt{\frac{2x}{t^2-1}}}{2(t^2-1)-x(t^2+1)}=\frac{\sqrt{2x(t^2-1)}}{2(t^2-1)-x(t^2+1)}$$ and you can further invoke $(1)$ to solve for $x$ to be substituted into the above expression.
