I came across a question which needs to simplify $(1-e^{ix})(1-e^{-ix})$ (It's a small part of mathematics in a physics question). I tried to simplify it but I obtained two answers instead after using two different approaches.
Approach 1: Expanding the terms
$(1-e^{ix})(1-e^{-ix})$
$=2 - (e^{ix} + e^{-ix})$
$=2(1-\cos x)$
$=4 \sin^2(\frac{x}{2})$
Approach 2:
$(1-e^{ix})(1-e^{-ix})$
$= e^{\frac{ix}{2}}(e^{-\frac{ix}{2}}-e^{\frac{ix}{2}})e^{-\frac{ix}{2}}(e^{\frac{ix}{2}}-e^{-\frac{ix}{2}})$
$=-(e^{\frac{ix}{2}}-e^{-\frac{ix}{2}})^2$ [the two exponents cancel each other and the sign of the first bracket is flipped so that both bracket terms are the same]
$=-(2\sin(\frac{x}{2}))^2$
$=-4\sin^2(\frac{x}{2})$
It is clear that both approaches give inconsistent answers. Please, can anyone check my work and let me know whether I made any mistake? Thank you.
$e^{ix/2}-e^{-ix/2}=cos(x/2)+isin(x/2)-(cos(-x/2)+isin(-x/2))=2isin(x/2)$ implies that $-(e{ix/2}-e^{-ix/2})^2=-(2i)^2sin^2(x/2)=4sin^2(x/2)$.