If one root of the equation x2+px+q=0 is the square of the other, then
p3+q2-q(3p+1)=0
p3+q2+q(1+3p)=0
p3+q2+q(3p-1)=0
p3+q2+q(1-3p)=0
Let root of the given equation x2+px+q=0 are α and α2
Now, αα2=α3=q, α+α2=-p
Cubing both sides, α3+(α2)3+3α.α2(α+α2)=-p3
q+q2+3q(-p)=-p3