That is, I don't understand how did we arrive at the second step.
$\sin^2(2x)=\dfrac{1-\cos(4x)}{2}=\dfrac{1}{2}(1-\cos(4x))$
I know these two identities should be used here, but I'm not sure what's exactly legal when they are used together at the same time.
$\sin^2(x)+\cos^2(x)=1$
$\sin(2x)=2\sin(x)\cos(x)$