\frac{d}{dx}\left(y^2\right)=\frac{d}{dy}\left(y^2\right)\cdot\frac{dy}{dx}=2y\cdot y'