Application of Differentiation Prove that if the curve $y = x^3 + px + q$ is tangent to the x-axis, then 
$$4p^3 + 27q^2 = 0$$
I differentiated $y$ and obtained the value $3x^2 + p$. If the curve is tangent to the x-axis, it implies that $x=0$ (or is it $y = 0$?). How do I continue to prove the above statement? Thanks. 
If I substitute in $x=0$, I will obtain $y= q$? Are my above steps correct? Please guide me. Thank you so much!

Notice, we have $$y=x^3+px+q$$ $$\frac{dy}{dx}=3x^2+p$$ Since, the x-axis is tangent to the curve at some point where $y=0$ & slope $\frac{dy}{dx}=0$ hence, we have $$\left(\frac{dy}{dx}\right)_{y=0}=0$$ $$3x^2+p=0\iff x^2=\frac{-p}{3}\tag 1$$
Now, at the point of tangency with the x-axis we have $$y=0\iff x^3+px+q=0$$ $$x^3+px+q=0$$ $$(x^3+px)=-q$$$$ (x^3+px)^2=(-q)^2$$ $$x^6+2px^4+p^2x^2=q^2$$
$$(x^2)^3+2p(x^2)^4+p^2x^2=q^2$$ Setting the value of $x^2$ from (1), we get $$\left(\frac{-p}{3}\right)^3+2p\left(\frac{-p}{3}\right)^2+p^2\left(\frac{-p}{3}\right)=q^2$$ $$-\frac{p^3}{27}+\frac{2p^3}{9}-\frac{p^3}{3}=q^2$$ $$-\frac{4p^3}{27}=q^2\iff -4p^3=27q^2$$ $$\color{red}{4p^3+27q^2=0}$$
