The right side of the equation can be rewritten in terms of p as 4p (4p = 4(x^2 +6) = 4x^2 +24)
Now you have (x^2 +6)^2 - 21 = 4p
Replace (x^2 +6) with p
p^2 - 21 = 4p
Subtract 4p from each side:
p^2 - 21 -4p = 0
Rewrite the expression to get p^2 - 4p -21 = 0