How to differentiate equation x^2 = y^3 with respect to t?

I think it can be differentiated like 2 dx/dt = 3y^2 dy/dt but in the solution, the equation has been rearranged to x=y^(3/2) and then differentiated. I think the answer should still be same but I'm getting different answers for both. Which one is correct?