I have
$$ x = 1-\frac{p}{2}(e^{iw}-e^{-iw}) + \frac{p^2}{2}( e^{iw} -2 + e^{-iw}) $$
$$ x = 1- \frac{p}{2}(2 i \sin w) +\frac{p^2}{2}(-4\sin^{2}\frac{w}{2}) $$
$$ |x^{2}| = ( 1 - ip\sin w -2p^{2}\sin^2{w/2}) ( 1 + ip\sin w -2p^{2}\sin^2{w/2} ) $$
after doing all the algebra i get
$$ 1 + p^{2} \sin^{2}w - 4p^{2}\sin^{2}w/2 + 4p^{4}\sin^{4}w/2$$
but the correct answer is
$$1 + 4p^{2}(p^2-1)\sin^{4}w/2$$
which i can seem to get, can anyone show me how? Thanks

Double-angle identity:
$$\sin 2\theta = 2\sin\theta\cos\theta$$
$$\sin\omega = 2\sin\frac\omega2\cos\frac\omega2$$
$$\sin^2\omega = 4\sin^2\frac\omega2\cos^2\frac\omega2$$
$$\sin^2\omega-4\sin^2\frac\omega2 = 4\sin^2\frac\omega2\Big(\cos^2\frac\omega2-1\Big) = 4\sin^2\frac\omega2\Big(-\sin^2\frac\omega2\Big) = -4\sin^4\frac\omega2$$
Therefore
$$1+p^2\sin^2\omega-4p^2\sin^2\frac\omega2+4p^4\sin^4\frac\omega2$$
$$= 1+p^2\Big(\sin^2\omega-4\sin^2\frac\omega2\Big)+4p^4\sin^4\frac\omega2$$
$$= 1+p^2\Big(-4\sin^4\frac\omega2\Big)+4p^4\sin^4\frac\omega2$$
$$= 1+\big(-4p^2+4p^4\big)\sin^4\frac\omega2$$
$$= 1+4p^2(p^2-1)\sin^4\frac\omega2$$