How to integrate $\int_0^{\pi/2}\frac{1}{\sin^2(x)-\sin(x)\cos(x)+\cos^2(x)}\,\mathrm{d}x$ I got stuck at this definite integral, any idea?
$$\int_0^{\pi/2}\frac{1}{\sin^2(x)-\sin(x)\cos(x)+\cos^2(x)}\,\mathrm{d}x$$
Thank you.
 A: For $\displaystyle\int\dfrac{a\sin^2x+b\sin x\cos x+c\cos^2x}{A\sin^2x+B\sin x\cos x+C\cos^2x}dx$
divide numerator & denominator by $\cos^2x$ and choose $\tan x=t$
Here $a=A=C=c=1,b=0, B=-1$
A: Under $2x\to x$ and $t=\tan(\frac x2)$, one has
\begin{eqnarray}
&&\int_0^{\pi/2}\frac{1}{\sin^2(x)-\sin(x)\cos(x)+\cos^2(x)}\,\mathrm{d}x\\
&=&\int_0^{\pi/2}\frac{1}{1-\frac12\sin(2x)}\,\mathrm{d}x=\int_0^{\pi}\frac{1}{2-\sin(x)}\,\mathrm{d}x=\int_0^{\pi}\frac{1}{2-\frac{2\tan(\frac x2)}{1+\tan^2(\frac x2)}}\,\mathrm{d}x\\
&=&\frac12\int_0^\pi\frac{\tan^2(\frac x2)}{\tan^2(\frac x2)-\tan(\frac x2)+1}dx=\frac12\int_0^\infty\frac{t^2}{t^2-t+1}\frac{2}{t^2+1}dt\\
&=&\int_0^\infty\left(\frac{t}{t^2-t+1}-\frac{t}{t^2+1}\right)dt\\
&=&\frac12\ln\left(\frac{t^2-t+1}{t^2+1}\right)+\frac{\sqrt3}{3}\arctan\left(\frac{2t-1}{\sqrt3}\right)\bigg|_0^\infty\\
&=&\frac{2\sqrt3\pi}{9}
\end{eqnarray}
A: \begin{aligned}
\int_{0}^{\frac{\pi}{2}} \frac{1}{\sin ^{2} x-\sin x \cos x+\cos ^{2} x} d x =& \int_{0}^{\frac{\pi}{2}} \frac{\sec ^{2} x}{\tan ^{2} x-\tan x+1} d x \\
=& \int_{0}^{\infty} \frac{d t}{t^{2}-t+1}, \text { where } t=\tan x \\
=& \int_{0}^{\infty} \frac{d t}{\left(t-\frac{1}{2}\right)^{2}+\frac{3}{4}} \\
=& \frac{2}{\sqrt{3}}\left[\tan ^{-1}\left(\frac{t-\frac{1}{2}}{\frac{\sqrt{3}}{2}}\right)\right]_{0}^{\infty} \\
=& \frac{2 \pi}{\sqrt{3}}
\end{aligned}
