How to evaluate the integral $ \int_{0}^{2\pi}|2e^{it}-1|^2 2ie^{it} dt $? How to evaluate the integral $$\int_{0}^{2\pi}|2e^{it}-1|^2 2ie^{it} dt $$
I have attempted it replacing $e^{it}$ with $\cos t +i\sin t$ but it doesn't seem to be working. How would I go about this?
 A: 
Motto: Complex exponentials are often simpler to manipulate than their underlying cosine and sine parts.

Several answers are already posted, which rush to cosine-sine decompositions at the expense of overly long computations, so let us explain in details how to apply the general principle above to the present case.
1. We start with the identities $$|z|^2=z\cdot\bar z\qquad \overline{e^{it}}=e^{-it}$$ They yield at once $$|2e^{it}-1|^2e^{it}=(2e^{it}-1)(2e^{-it}-1)e^{it}=5e^{it}\color{red}{-2}-2e^{2it}\tag{$\ast$}$$
The good news is that, basically, the computation part is already over... To see why, let us continue.
2. Our second ingredient is that, for every nonzero integer $n$, $$\int_0^{2\pi}e^{int}dt=0$$ which can be proven in several different, elementary, ways, and that the integral for $n=0$ is simply $2\pi$. Thus, once integrated over $(0,2\pi)$, the only remaining term in the expansion $(\ast)$ is $\color{red}{-2}$.
3. Finally, using 1. and 2., $$\int_{0}^{2\pi}|2e^{it}-1|^2 2ie^{it} dt=2i\int_0^{2\pi}(\color{red}{-2})\,dt=2i\cdot(\color{red}{-2})\cdot2\pi=-8i\pi$$
A: $\int_{0}^{2\pi}|2e^{it}-1|^2 2ie^{it}dt=\\
\int_{0}^{2\pi} |2\cos(t)+i\sin(t)-1|^2 2e^{it}dt=\\
\int_{0}^{2\pi} ((2\cos(t)-1)^2+(2\sin(t))^2) 2ie^{it}dt=\\
\int_{0}^{2\pi} (4\cos(t)^2+4\sin(t)^2+1-4\cos(t)) 2ie^{it}dt=\\
\int_{0}^{2\pi} (5-4\cos(t))2i(\cos(t)+i\sin(t)) dt=...$
A: $$ I=\int_{0}^{2\pi}|2e^{it}-1|^2 2ie^{it} dt $$
If $|2e^{it}-1| $, is a module of complex number then $$|2e^{it}-1|^2= (2cost -1)^2 + (2sint)^2=4cos^2t-4cost +1+4sin^2t$$.
We get $$I=2i(\int_{0}^{2\pi}4cos^2te^{it}dt-\int_{0}^{2\pi}4coste^{it}dt-i+i+\int_{0}^{2\pi}4sin^2te^{it}dt)$$
$$I_1=\int_{0}^{2\pi}cos^2te^{it}dt\\ I_2=\int_{0}^{2\pi}coste^{it}dt\\
I_3=\int_{0}^{2\pi}sin^2te^{it}dt$$
Then, in $I_1,I_2,I_3$, use the following:$$cos^2t=\frac{1+cos2t}{2},\ sin^2t=1-cos^2t,\ 2sintcost=sin2t,\ e^{it}=cost +isint$$
The result I'm getting is $-8i\pi$. Integrals $I_2$ and $I_3$ equal 0, and $I_2=\pi$.
Whole solution:
$$I_2=\int_0^{2\pi}cost(cost +isint)dt=\int_0^{2\pi}cos^2tdt+\int_0^{2\pi}isintcostdt=\int_0^{2\pi}\frac{1+cos2t}{2}dt+\int_0^{2\pi}i\frac{sin2t}{2}=\int_0^{2\pi}\frac{dt}{2}+
\int_0^{2\pi}\frac{cos2t}{2}dt+\int_0^{2\pi}i\frac{sin2t}{2}dt=\pi +\frac{sin2t}{2}|_0^{2\pi}-\frac{icos2t}{4}|_0^{2\pi}=\pi$$
$$I_1=\int_0^{2\pi}cos^2t(cost+isint)dt=\int_0^{2\pi}cos^2tcostdt+\int_0^{2\pi}isintcos^2tdt\\
I_{11}=\int_0^{2\pi}cos^2tcostdt\\
I_{12}=\int_0^{2\pi}isintcos^2tdt\\
I_{11}=\int_0^{2\pi}(1-sin^2t)costdt=\int_0^{\frac{\pi}{2}}(1-sin^2t)costdt+
\int_{\frac{\pi}{2}}^{\pi}(1-sin^2t)costdt+\int_{\pi}^{\frac{3\pi}{2}}(1-sin^2t)costdt+\int_{\frac{3\pi}{2}}^{2\pi}(1-sin^2t)costdt$$
Now, in $I_{11}$ we introduce a change of variables: $x=sint,\ dx=costdt$ and we get:
$$I_{11}=\int_0^1(1-x^2)dx+
\int_1^0(1-x^2)dx+\int_0^{-1}(1-x^2)dx+\int_{-1}^{0}(1-x^2)dx=0$$
$$I_{12}=\int_0^{2\pi}isintcos^2tdt=\int_0^{\frac{\pi}{2}}isintcos^2tdt+\int_{\frac{\pi}{2}}^{\pi}isintcos^2tdt+\int_{\pi}^{\frac{3\pi}{2}}isintcos^2tdt+\int_{\frac{3\pi}{2}}^{2\pi}isintcos^2tdt$$
We introduce a change of variables in $I_{12}$ :
$x=cost,\ dx=-sintdt$ and we get:
$$I_{12}=-(\int_1^0ix^2dx+\int_0^{-1}ix^2dx+\int_{-1}^0ix^2dx+\int_0^1ix^2dx)=0$$
Edit: Previously I've written that you should be able to solve $I_1,I_2,I_3$ using partial integration, but that's not going to work, at least not for $I_2$.
