# Variable change in integral

I need to calculate the integral $$\int_0^{2\pi}\sqrt{1-\cos\,x}dx$$ but when I try the substitution with $u = 1-\cos\,x$ both integration limits goes to 0.

The same happens using the t-substitution.

-
math.stackexchange.com/a/348271/63095 <--This will be relevant here –  Fermé somme Apr 8 '13 at 17:43

Note that $\cos(2x)=\cos^{2}(x)-\sin^{2}(x)$

so $\vert\sin(x)\vert=\sqrt{\frac{1-\cos(2x)}{2}}$.

So redoing the calculation with $x$ as $\frac{x}{2}$ will give you

$\vert\sin(\frac{x}{2})\vert=\frac{1}{\sqrt{2}}\sqrt{1-\cos(x)}$.

Now you can solve the integral by splitting it into $[0,\pi]$ and $[\pi,2\pi]$ and using substitutions.

-
I upvoted your answer, and it is nice and elegant, but you should use "\sin" and "\cos". –  Stefan Smith Apr 7 '13 at 20:00
My mistake I thought I thought put slashes. Thank you for catching that. –  user71352 Apr 7 '13 at 20:03

You can't use that substitution over the entire interval $0 \leq x \leq 2\pi$, because $1-\cos x$ is not one-to-one there. Instead try splitting the integral into $\int_0^\pi \sqrt{1-\cos x}dx+\int_\pi^{2\pi} \sqrt{1-\cos x} dx$, and using your substitution on each one, separately.

-

Hint: Note that \begin{align} 1-\cos(x) = & 1-\cos\left(2\cdot \frac{x}{2}\right) \\ = & 1+\sin^2\left(\frac{x}{2}\right)-\cos^2\left(\frac{x}{2}\right) \\ = & \sin^2\left(\frac{x}{2}\right)+\sin^2\left(\frac{x}{2}\right) \\ = & 2\sin^2\left(\frac{x}{2}\right) \end{align} implies $$\int_{0}^{2\pi}\sqrt[2\,]{1+\cos(x)}\,\mathop{d}x= 2\cdot\int_{0}^{2\pi}\left|\sin\left(\frac{x}{2}\right)\right|\,\mathop{d}x$$

-