implicit differentiation

I have a quick question regarding implicit differentiation:
Heres the problem and its solution
.

What I dont understand is from the 1st step (First arrow) to the second, in particular why the x^2 turns into y^2 in 2xycos(y^2). The same goes on the right side. Why isnt it y'[2xycos(x^2)+sin(x^2)]=-sin(y^2)-2xycos(y^2)?

I have a quick question regarding implicit differentiation:
Heres the problem and its solution
.

What I dont understand is from the 1st step (First arrow) to the second, in particular why the x^2 turns into y^2 in 2xycos(y^2). The same goes on the right side. Why isnt it y'[2xycos(x^2)+sin(x^2)]=-sin(y^2)-2xycos(y^2)?

Also, on the right side there is a y' which seems to disappear?

Thanks in advance.

They collected all the terms which had a on one side of the equation and all the terms without on the other side.