Squaring a complex exponential that represents a real number Often, complex exponential functions are used to represent trigonometric functions, since
$$
e^{i\theta} \equiv \cos\theta + i\sin\theta .
$$
Thus, if for example I want to express the quantity $\cos x$, I might write:
$$
\cos x \equiv \Re\left\{e^{i x}\right\} .
$$
I'm told that I can manipulate the LHS just like I would the RHS, and at the end just take the real part to get the same answer as other methods, but I have come across some trouble.
Let's say I wanted to square the LHS to get $\cos^2 x$. On the RHS, this would give me:
$$
\begin{align}
e^{2ix} &= (\cos x + i \sin x)^2 \\
         &= (\cos^2x - \sin^2 x + 2i\cos x \sin x) \\
\implies \Re\{e^{2ix}\}         &= \cos^2 x - \sin^2 x
\end{align}
$$
Now, of course I recognise that the RHS is the identity for $\cos 2x$, which makes complete sense since $e^{2ix} \equiv e^{i(2x)}$. My question then is, why do the rules suddenly break down as soon as I attempt to square my complex exponential as I would my trig function? And what are the most conventional steps to take to work around this? Many thanks.
 A: The premise of the title is incorrect, and that may be the source of the confusion. When we write
$$ \exp(it) = \cos t + i\sin t \in \Bbb C$$
this is not a complex number representing a real number. It is a complex number representing two real numbers.
A complex number representing one real number would be written as
$$ \exp(ik\pi) = a + i\cdot 0 \in \Bbb C $$
and these numbers multiply and square as you would expect.
On the other hand, if you want compound numbers that represent two real numbers, like
$$ (a,b)\in \Bbb R^2 $$
then the only way to have multiplication (and exponentiation) preserve both values is to have a componentwise multiplication like the Hadamard product. On the other hand, $\Bbb C$ is differentiated from other structures on $\Bbb R^2$ precisely by its multiplication, which must have
$$(0,1)\cdot (0,1) = (-1,0) \neq (0,1)$$
and is therefore not componentwise.
For this particular example, the fact that
$$ \exp((0,1)\cdot t) = (\cos t,\sin t) $$
holds at all is actually a result of the definition of complex multiplication. For $\Bbb R^2$ with a Hadamard product, we have
$$ \exp((0,1)\cdot t) = (0,\exp t) $$
while for dual numbers (which have $(0,1)\cdot (0,1) = 0$), we have
$$ \exp((0,1)\cdot t) = (1,t) $$
Interestingly, dual numbers actually do preserve the first component ("real part") through multiplication (and exponentiation), because
$$ (a,x)\cdot (b,y) = (ab,ay+bx) $$
so it is possible to preserve one coordinate without componentwise multiplication, but the product on $\Bbb C$ doesn't do this.
A: The problem lies in the fact that you cannot deduce from $a=\operatorname{Re}(z)$ that $a^2=\operatorname{Re}(z^2)$, which is what you did. For instance, $1=\operatorname{Re}(1+i)$, but $1^2\ne\operatorname{Re}\bigl((1+i)^2\bigr)=0$.
