Good start. I am not sure if the following is the simplest way, but it seems to lead to finding p and q, at least in theory.
So, we have for some function . Now, looking at degrees of polynomials, is a quadratic polynomial, let's say .
Next, we look at both sides' coefficients of , , as well as the free terms. Equating the leading coefficients, we see that . Similarly, equating the constant terms (or putting x = 0), we get that . Finally, equating the coefficients at , we get that . Therefore, .
Next, one of the roots of is -1/2. Substituting into the original equation, we get , or . Substitute the expression for above; this gives (after lots of simplifications) .
Finally, combining this with , one can find and . In my calculations, this boils down to a linear (not even a quadratic) equation.
Disclaimer: my calculations can be wrong.