A Difficult Definite Integral $\int_0^{2\pi}(t-\sin t)(1-\cos t)^2{\rm d}t.$ Problem
Evaluate $$\int_0^{2\pi}(t-\sin t)(1-\cos t)^2{\rm d}t.$$
Comment
It's very complicated to compute the integral applying normal method. I obtain the result resorting to the skillful formula

$$\int_0^{2\pi}xf(\cos x){\rm d}x=\pi\int_0^{2\pi}f(\sin x){\rm d}x,$$
where $f(x) \in C[-1,1].$

\begin{align*}
\require{begingroup}
\begingroup
\newcommand{\dd}{\;{\rm d}}\int_0^{2\pi} (t-\sin t)(1-\cos t)^2 \dd t
&= \int_0^{2\pi} t(1-\cos t)^2 \dd t - \int_0^{2\pi} \sin t(1-\cos t)^2 \dd t \\
&= \pi\int_0^{2\pi} (1-\sin t)^2 \dd t - \int_0^{2\pi} (1-\cos t)^2 \dd (1-\cos t) \\
&= \pi\int_0^{2\pi} \left(\frac32-\frac12\cos2t-2\sin t\right) \dd t - \left[\frac13(1-\cos t)^3\right]_0^{2\pi}\\
&= \pi\left[\frac32t-\frac14\sin2t+2\cos t\right]_0^{2\pi}\\
&= 3\pi^2
\endgroup
\end{align*}
But any other solution?
 A: With substitution $t=\pi+x$ we see that
$$I=\int_0^{2\pi}(t-\sin t)(1-\cos t)^2{\rm d}t=\int_{-\pi}^{\pi}(\pi+x+\sin x)(1+\cos x)^2{\rm d}x.$$
the part $(x+\sin x)(1+\cos x)^2$ is an odd function so it's integral over $[-\pi,\pi]$ is zero, then
$$I=\pi\int_{-\pi}^{\pi}(1+\cos x)^2{\rm d}x=\pi\int_{-\pi}^{\pi}\dfrac32+2\cos x+\dfrac12\cos2x{\rm d}x=\color{blue}{3\pi^2}$$
A: Notice that your integral is in fact an area integral of the function $(x,y) \mapsto x$ over one arch of a cycloid given by
$$\begin{cases} x = t - \sin t \\ y = 1-\cos t\end{cases}$$
Indeed, if we assume that the cycloid is explicitly given by $y = f(x)$, we have
\begin{align}
\int_{\text{cycloid}} x \,dA &= \int_0^{2\pi} \int_0^{f(x)} x\,dy\,dx\\
&= \int_0^{2\pi} xf(x)\,dx \\
&= \begin{bmatrix} x = t-\sin t \\ f(x) = 1-\cos t \\ dx = (1-\cos t)\,dt\end{bmatrix}\\
&= \int_0^{2\pi} (t-\sin t)(1-\cos t)^2\,dt
\end{align}
Now recall the formula for the $x$-coordinate of the centroid:
$$\frac1A \int_{\text{cycloid}} x \,dA = x\text{-coordinate of the centroid} = \pi$$
since centroid is clearly at $x = \pi$ by symmetry.
Using the same metrod as above area of the cycloid is $$A = \int_{\text{cycloid}}dA =  \int_0^{2\pi} (1-\cos t)^2 \,dt = 3\pi$$
this integral being a lot easier than the original one.
It follows $$\int_{\text{cycloid}} x \,dA = A\pi = 3\pi^2$$
A: The integral
$$
\int_0^{2\pi}\sin t(1-\cos t)^2\,dt=\Bigl[\frac{(1-\cos t)^3}{3}\Bigr]_0^{2\pi}=0
$$
is immediate. Thus we can concentrate on
$$
\int_0^{2\pi}t(1-\cos t)^2\,dt=[\dots t=2u \dots]=
16\int_0^{\pi}u\sin^4u\,du=\int_0^\pi u(e^{iu}-e^{-iu})^4\,du
$$
For integer $a$, we have
$$
\int_0^\pi ue^{2iau}\,du=\Bigl[\frac{ue^{2iau}}{2ia}\Bigr]_0^\pi-\frac{1}{2ia}\int_0^\pi e^{2iau}\,du=\frac{\pi e^{2ia\pi}}{2ia}+\frac{1}{4a^2}\Bigl[e^{2iau}\Bigr]_0^\pi=\frac{\pi}{2ia}
$$
Since $(e^{iu}-e^{-iu})^4=e^{4iu}-4e^{2iu}+6-4e^{-2iu}+e^{-4iu}$ we see that
$$
\int_0^\pi u\sin^4u\,du=\int_0^\pi 6u\,du=3\pi^2
$$
A: \begin{align}
&\int_0^{2\pi}(t-\sin t)(1-\cos t)^2{\rm d}t=\int_0^{2\pi}t+t{\cos }^2 t-2t\cos t-\sin t -\sin t{\cos }^2 t+\sin 2t{\rm d}t\\
&=\left[\frac{1}{2}t^2+\frac{1}{2}t^2+\frac{1}{4}t\sin 2t-\frac{1}{4}t^2+\frac{1}{8}\cos 2t-2t\sin t-2\cos t+\cos t+\frac{1}{3}{\cos }^3t-\frac{1}{2}\cos 2t\right]_0^{2\pi} \\
&=\left[\frac{3}{4}t^2+\frac{1}{4}t\sin 2t-\frac{3}{8}\cos 2t-2t\sin t-\cos t+\frac{1}{3}{\cos }^3 t\right]_0^{2\pi}\\
&=3\pi ^2
\end{align}
