How should I try to evaluate this integral $\int_0^\pi \sqrt{1+4\sin^2\frac x2 - 4\sin\frac x2}\;dx$? Suppose that we are given the following integral:
$$\int_0^\pi \sqrt{1+4\sin^2\frac x2 - 4\sin\frac x2}\;dx.$$
(Original screenshot)
And the answer is one of these :-  

  
*
  
*$4\sqrt3-4-\frac\pi3$
  
*$\pi-4$
  
*$\frac{2\pi}3 - 4 - 4\sqrt3$
  
*$4\sqrt3-4$
  

(original screenshot  )
Is there a way to check each answer and reach to the question (like in case of indefinite integral I can differentiate the options and match it with question and tick the correct answer) or maybe confirm that this value is correct for the question without solving.
 A: Note that $1+4\sin^2(x/2)-4\sin(x/2)=(1-2\sin(x/2))^2$.
Now comes the only slightly tricky thing. Note that $\sqrt{a^2}=|a|$. 
The function $1-2\sin(x/2)$ is $\ge 0$ for $0\le x\le \pi/3$, and it is $\lt 0$ on the rest of our interval. So our integral is
$$\int_0^{\pi/3} (1-2\sin(x/2))\,dx+ \int_{\pi/3}^{\pi} (2\sin(x/2)-1)\,dx.$$
Remark: It is not clear how to work backwards in general from numerical answers. One can consider for each whether it is numerically plausible, at the most basic level whether it has the right sign. Thus (2) and (3) are impossible. But such a procedure gives no guarantee of ruling out all the wrong answers. It comes fairly close in this case, since the intended "trap" was in taking the square root, so two negative "answers" were supplied. A glance at the integral after we set it up  also shows that there must be a "$\pi$" term, eliminating (4). 
A: Hint: $$\int_0^\pi \sqrt{1+4\sin^2\frac x2 - 4\sin\frac x2}\;dx=\int_0^\pi \sqrt{\left(1-2\sin\left(\frac{x}{2}\right)\right)^2}\;dx=\\
\int_0^{\pi/3} \left(1-2\sin\left(\frac{x}{2}\right)\right)\;dx+\int_{\pi/3}^\pi \left(1-2\sin\left(\frac{x}{2}\right)\right)\;dx\\
\text{This you can evaluate.}$$
Since the answers are numerical, there is no way which I know through which you can get the integral back. Let me give an example:
$$4\sqrt{3}-4=4(\sqrt{3}-1)=4\left.\left(\sqrt{x}-\dfrac{x}{3}\right)\right|^3_0=4\int^3_0\left(\dfrac{1}{2\sqrt{x}}-\dfrac{1}{3}\right)dx$$
As is visible, you can't derive back the integral $\int_0^\pi \sqrt{1+4\sin^2\frac x2 - 4\sin\frac x2}\;dx$ just given the numerical value of the integral, as there are many other integrals that give back the exact same value.
A: \begin{align}
\int_0^\pi\sqrt{4\sin^2\frac{x}{2}-4\sin\frac{x}{2}+1}\,dx&=\int_0^\pi\sqrt{\left(2\sin\frac{x}{2}-1\right)^2}\,dx\\
&=\int_0^\frac{\pi}{3}\left(1-2\sin\frac{x}{2}\right)\,dx+\int_\frac{\pi}{3}^\pi\left(2\sin\frac{x}{2}-1\right)\,dx\\
&=\left[x+4\cos\frac{x}{2}\right]_0^\frac{\pi}{3}+\left[-4\cos\frac{x}{2}-x\right]_\frac{\pi}{3}^\pi\\
&=\frac{\pi}{3}+4\cos\frac{\pi}{6}-4-\pi+4\cos\frac{\pi}{6}+\frac{\pi}{3}\\
&=4\sqrt{3}-4-\frac{\pi}{3}
\end{align}
If this is multiple choices, I'd immediately answer 1 because its value greater than $0$ and we can easily notice that the answer must have term of $\pi$ because there is term integral of $1$ that yield $x$.
