complex numbers

ok..
w=cos(theta) + isin(theta) where theta is between 0 and pi.
if complex number w^2 + (5/w) -2 is purely imaginary, show that 2(cos^2)(theta) + 5cos(theta) -3=0.
Hence, find w.
Any input would be appreciated. thanks.