Find the length of the curve $$x = t - sin\,t, \quad\quad y = 1 - cos\,t, \quad\quad 0\leq t\leq 2\pi$$
I have gotten close to the solution, but clearly I am making an error because I arrive at 0 for the answer. $$\frac{dx}{dt}=1-cos\,t, \quad \frac{dy}{dt}=sin\,t$$ $$L_{0}^{2\pi}= \int_{0}^{2\pi}\sqrt{(1-cos \,t)^2+ (sin\,t)^2}\quad dt$$ $$=\int_{0}^{2\pi}\sqrt{1-2\,cos\,t+cos^2t + sin^2t}\quad dt$$ $$=\frac{2}{\sqrt2}\int_{0}^{2\pi}\sqrt{1-\,cos\,t}\quad dt$$ $$=\frac{2}{\sqrt2}(-2)(\sqrt{1+\,cos\,t})]_0^{2\pi}$$ $$=\frac{-4}{\sqrt2}(\sqrt{1+\,cos\,t})]_0^{2\pi}$$ $$=-4-(-4)=0$$ When I plot the parametric function, as well as the final antiderivative, I can see that I am on the right track with the sum of 4s, but the sign seems to be a problem (plus the plot of the antiderivative is negative with a cusp at $\pi$ that doesn't seem like it is right).
UPDATE/REPLY: Thanks for the pointers and the solution to this. However, I'm not sure why my antiderivative is wrong? If I take the derivative of the solution, I get back the integral function: $$\frac{d}{dt} (-2)(\sqrt{1+cos\,t)}$$ $$=-\frac{-sin\,t}{\sqrt{(1+cos\,t)}}$$ $$=\frac{sin\,t}{\sqrt{(1+cos\,t)}}\frac{(\sqrt{(1-cos\,t)}}{(\sqrt{(1-cos\,t)}}$$ $$=\frac{sin\,t*\sqrt{1-cos\,t}}{\sqrt{1-cos^2\,t}}$$ $$=\frac{sin\,t*\sqrt{1-cos\,t}}{\sqrt{sin^2\,t}}$$ $$=\sqrt{1-cos\,t}$$ If that is correct, then why doesn't it work for determining length?