<s>[INST] Transforming $-1+ \cos x +\sin x$ into $-2\sin^2 (x/2) +2\sin(x/2)\cos(x/2)$ This trigonometrical part was included in a complex variable problem. I tried to find how 
$$ -1+ \cos (x) +\sin (x)$$
becomes 
$$-2\sin^2 (x/2) +2\sin(x/2)\cos(x/2)$$
Can I let $1 = \sin^2 x +\cos^2x$ ?
Any help'll be appreciated. 
 [/INST] The identity $ \sin(2 \theta) = 2 \sin( \theta ) \cos( \theta ) $ give us that
$$
\sin(x) = \sin(2 \cdot x/2) = 2 \sin(x/2) \cos(x/2)
$$
Similary, we use that $ cos(2 \theta) = \cos^2( \theta ) - \sin^2( \theta ) $ to obtain
$$
-1 + \cos(x) = -1 + \cos(2 \cdot x/2) = -1 + ( \cos^2(x/2) - \sin^2(x/2) )
$$
Finally from the identity $ cos^2( \theta ) + \sin^2( \theta ) = 1 $ we deduce that $ -1 + \cos^2( \theta ) = - \sin^2( \theta ) $:
$$
-1 + ( \cos^2(x/2) - \sin^2(x/2) ) = ( -1 + \cos^2(x/2) ) - \sin^2(x/2)) = -\sin^2(x/2) - \sin^2(x/2) = -2 \sin^2(x/2)
$$
Adding the two equlities:
$$
-1 + \cos(x) + \sin(x) = -2 \sin^2(x/2) + 2 \sin(x/2) \cos(x/2)
$$
</s>