Both sides were squared in that step. So on the right you have the integral times the integral. Remember that the variable you integrate over is a "dummy variable", that means it can be changed to a different character and it doesnt matter.

http://mathworld.wolfram.com/DummyVariable.html
By changing the dummy variable from "x" to "y" it is better illustrated how you are going from cartesian to polar coordinates.