Express q as a function of p, given that one root of x^2 + px + q = 0 is twice the other.