The range is the horizontal distance traveled before the projectile hits the ground.

The distance covered in the x-direction is simply:

x = vox t

To find the range, use t as the time of flight, which we just calculated to be:

t = 2 vo sin(q) / g

Plugging in vox = vo cos(q) gives:

x = 2 vo2 sin(q) cos(q) / g

Using the trig. identity 2 sin(q) cos(q) = sin(2q) this can be written as:

x = vo2 sin(2q) / g