I'm not even sure where to begin... Help will be appreciated
$(x-a)^2(x-b) = x^3+px+q$
Multiply out:
$(x-a)^2(x-b) = (x^2-2ax+a^2)(x-b) = x^3-(2a+b)x^2+(2ab+a^2)x-a^2b$
Equate coefficients:
$-(2a+b) = 0$
$2ab+a^2=p$
$-a^2b = q$
This is a system of three equations in four variables. So, solve for $p$ in terms of $q$.
$x^3 + px + q = (x - a)^2(x - b) = (x^2 - 2ax + a^2)(x - b) = x^3 - bx^2 - 2ax^2 + 2abx + a^2x - a^2b =$
$x^3 - (2a + b)x^2 + a(a + 2b)x - a^2b.$ Straight forward.
The coefficients of the powers must be equal in the right hand and left expressions.
$\therefore q = - a^2b\ and\ p = a(a + 2b)\ and\ 2a + b = 0.$
Proceed
JeffM and SlipEternal have given you 3 equations that must be satisfied
$q = - a^2b\ and\ p = a(a + 2b)\ and\ 2a + b = 0.$
from the last one $b=-2a$
substitute that into the first two and you get
$q=2a^3, ~p=-3a^2$
$q^2=4a^6$
$\dfrac{q^2}{4}=a^6$
$p^3=-27a^6$
$-\dfrac{p^3}{27}=a^6$
$\dfrac{q^2}{4}=-\dfrac{p^3}{27}$
$\dfrac{q^2}{4}+\dfrac{p^3}{27}=0$
$27q^2+4p^3=0$