simply the first eq as much as possible and you get
1 - [c * (ab+1)]}/[b * (ac + 1)]
Ignore 1 for now and just solve the right side of the expression
solve ab+1/ac+1 for starters
ab + 1 = 6x^2 - x - 1
ac + 1 = 2x^2 - x
take x common in 2x^2 - x
6x^2 - x - 1 / x(2x - 1)
Use long division method(or whatever you know) to divide (6x^2 - x - 1) by (2x-1) to get 3x + 1
finally, right side of the eq =
[(x-1)(3x+1)]/[(3x-2)x]
Bring in the 1 now and you get
1 - [(x-1)(3x+1)]/x(3x-2)
= [3x^2 - 2x - 3x^2 + 2x + 1]/[3x^2 - 2x]
= 1/(3x^2 - 2x)
Comparing with given expression we get
p = 3, q = 2