Complex exponential squared does not equal sinusoid squared? I just noticed this today and I'm a bit confused by it.
If we represent cos(x) as the real part of exp(ix), then I always thought that we could then say that cos(x)^2 is equal to the real part of exp(ix)exp(ix)=exp(2*i*x).  However, this clearly cannot be correct, as the real part of exp(2*i*x) is actually cos(2*x), which of course is not equal to cos(x)^2.
So what rule am I violating here when I try to represent cos(x)^2 as exp(2*ix)?  Why can't I just say cos(x)^2 is equal to the real part of exp(ix)exp(ix)=exp(2*i*x)?
I know I'm going wrong somewhere but can't see where.  Thanks!

Be slow when you're writing these things out; $e^{2ix}=\left(e^{ ix}\right)^2=\left(\cos(x)+i\sin(x)\right)^2=\cos^2(x)-\sin^2(x)+2i\cos(x)\sin(x)$. Hence, $\Re(e^{2ix})=\cos^2(x)-\sin^2(x)\neq \cos^2(x)$.
