Step 1: \(d_2\cdot v_s\cdot\cos 45^{\circ}=d_1\cdot(v_r-v_s\sin45^{\circ})\)
They multiplied out the bracket on the right hand side:
\(d_2\cdot v_s\cdot\cos 45^{\circ}=d_1\cdot v_r-d_1 \cdot v_s\sin45^{\circ}\)
and then they add d1 . vs sin45 each side:
\(d_2\cdot v_s\cdot\cos 45^{\circ}+d_1 \cdot v_s\sin45^{\circ}=d_1\cdot v_r\)
Factor out the common factor(vs):
\(v_s\cdot(d_2\cdot\cos 45^{\circ}+d_1\sin 45^{\circ})=d_1\cdot v_r\) <-- Step 2!!