First you can multiply out and simplify:
As this is supposed to be an identity for all x, you can equate powers of x on both sides. As the RHS is zero (because everything's been gathered to the left), you can say:
Coefficients of :
Coefficients of :
take it away, maestro ...
Is the 9x2 or ?
I'm going to assume it's the latter, so you have
So basically any positive integers for p and q such that the above equation is true will suffice. (p, q) = (10, 2) is one such solution (and provides the lowest possible values for p and q).