Starting equation: 2x = 32

Re-write the right side as 25, to get:

2x = 25

If the powers are equal, and the bases (here, 2) are equal the the exponents must also be equal:

x = 5