In my complex analysis final yesterday we computed $$\int_{-\infty}^\infty{\sin(x^2)dx}=\int_{-\infty}^\infty{\cos(x^2)dx}=\sqrt{\pi/2}$$ using contour integration. It seems similar to the Gaussian $$\int_{-\infty}^\infty{e^{-x^2}dx}$$ which can be evaulated by computing $$\int_{-\infty}^\infty\int_{-\infty}^\infty{e^{-(x^2+y^2)}dx dy}$$ by switching to polar coordinates but I can't seem to get that to work.
If I try doing the same trick I would do $$\int_{-\infty}^\infty\int_{-\infty}^\infty{\sin(x^2+y^2)dxdy}=\int_{-\infty}^\infty\int_{-\infty}^\infty\sin(x^2)\cos(y^2)+\sin(y^2)\cos(x^2)dxdy$$ $$=2\int_{-\infty}^\infty\sin(x^2)dx\int_{-\infty}^\infty\cos(y^2)dy=2I^2$$ where $$I=\int_{-\infty}^\infty\sin(x^2)dx$$.
But now if I do $$\int_0^{2\pi}\int_{0}^\infty\sin(r^2)rdrd\theta$$ the integral seems to diverge. The antiderivative is just $$-\cos(r^2)/2$$ which has no limit as r goes to infinity.
My question is why doesn't this trick work here? What assumptions do I need to make or what theorems are used when using this idea to do the Gaussian integral but fail in this instance. Also, does anybody know a way of computing this integral without contour integration?