<s>[INST] How is $2(\cos^2 x - \sin^2 x)(\sin x - \cos x) = -2(\cos x - \sin x)^2(\cos x + \sin x)$? I was reading the answer of a proof and in it the answer converted this:
$$2(\cos^2(x) - \sin^2(x))(\sin(x) - \cos(x))$$
to this
$$-2(\cos(x) - \sin(x))^2(\cos(x) + \sin(x))$$
can someone explain what happened and how did it end up like this?
 [/INST] We just use $a^2-b^2=(a-b)(a+b)$:
\begin{equation}
\begin{split}
2(\cos^2x - \sin^2 x)(\sin x - \cos x)&=-2(\cos^2 x - \sin^2 x)(\cos x - \sin x)\\
&=-2(\cos x - \sin x)(\cos x + \sin x)(\cos x - \sin x)\\&=-2(\cos x - \sin x)^2(\cos x + \sin x)
\end{split}
\end{equation}
</s>