Compute the length of an arc of $\gamma(t)=(t-\sin t,1-\cos t)$ So I have a formula for arc length $$s(t)=\int_{t_0}^t \vert\vert \dot\gamma(u)\vert\vert du$$
I computed that $$\vert\vert \dot\gamma(t)\vert\vert=\sqrt{2(1-\cos t)}$$
Substituting this into the integral $$\int_0^{2\pi} \sqrt{2(1-\cos t)} dt$$
$$=2\int_0^{2\pi} \sqrt{1-\cos t} dt$$
$$=\sqrt{2}\int_0^{2\pi} \sqrt{1-\cos t} \frac{\sqrt{1+\cos t}}{\sqrt{1+\cos t}} dt$$
$$=\sqrt{2}\int_0^{2\pi} \frac{\sin t}{\sqrt{1+\cos t}}dt$$
Using subsitution $u=1+\cos t$, $du=-\sin t dt$
$$=\sqrt{2}\int_0^{2\pi} \frac{-1}{\sqrt{u}} du$$
$$=-\sqrt{2} (2\sqrt{1+\cos t}\big\vert_0^{2\pi})=0$$
Obviously this has to be wrong, but I'm not sure what I'm doing wrong.
 A: $\sqrt {1-\cos^{2}t} =|\sin \, t|$ not $\sin \, t$.
A: The arc length of the curve is 
$$s(t)=\int_{0}^{2\pi}\sqrt{\left(\frac{dx}{dt}\right)^2+\left(\frac{dy}{dt}\right)^2}dt=\int_{0}^{2\pi}\sqrt{(1-\cos(t))^2+\sin^2(t)}dt=\int_{0}^{2\pi}\sqrt{2(1-\cos(t))}dt=$$
$$=\int_{0}^{2\pi}2\sqrt{\frac{1-\cos(t)}{2}}dt=\int_{0}^{2\pi}2\sin\left(\frac{t}{2}\right)dt=\left.-4\cos\left(\frac{t}{2}\right)\right|_{0}^{2\pi}=-4[\cos(\pi)-\cos(0)]=8.$$
A: It's a correct antiderivative - locally, in some regions. There are sign assumptions built in; for that identity $\sqrt{1-\cos^2 t}=\sin t$ to be true, we must be in a region where $\sin$ is positive, such as $t\in [0,\pi]$. Where $\sin$ is negative, such as $t\in [\pi,2\pi]$, we instead have $\sqrt{1-\cos^2 t}=-\sin t$ and $2\sqrt{2}\sqrt{1+\cos t}$ is an antiderivative. We can't cover the whole region we're integrating over in one formula this way - we'll need both.
To handle this, then, we split the integral in two:
$$\int_0^{\pi}\sqrt{2(1-\cos t)}\,dt+\int_{\pi}^{2\pi}\sqrt{2(1-\cos t)}\,dt = \left[-2\sqrt{2}\sqrt{1+\cos t}\right]_0^{\pi}+\left[2\sqrt{2}\sqrt{1+\cos t}\right]_{\pi}^{2\pi}=8$$
As a side note, we have the half-angle identity $\sqrt{2(1-\cos t)}=2\left|\sin \frac{t}{2}\right|$. It's all quite a bit simpler if we use that - including that we can get the full interval $[0,2\pi]$ covered by one antiderivative formula.
