There was a question on multiple integrals which our professor gave us on our assignment.
QUESTION: Changing order of integration, show that $$\int_0^\infty \int_0^\infty e^{-xy}\sin nx \,dx \,dy=\int_0^\infty \frac{\sin nx}{x}dx$$ and hence prove that $$\int_0^\infty \frac{\sin nx}{x}dx=\frac{\pi}{2}$$
MY ATTEMPT: I was successful in proving the first part.
Firstly, I can state that the function $e^{-xy}\sin nx$ is continuous over the region $\mathbf{R}=\{(x,y): 0<x<\infty,0<y<\infty\}$
$$\int_0^\infty \int_0^\infty e^{-xy}\sin nx \,dx \,dy$$ $$=\int_0^\infty \sin nx \left\{\int_0^\infty e^{-xy}\,dy\right\} \,dx$$ $$=\int_0^\infty \sin nx \left[\frac{e^{-xy}}{-x}\right]_0^\infty \,dx$$ $$ =\int_0^\infty \frac{\sin nx}{x}dx$$
However, the second part of the question yielded a different answer.
$$\int_0^\infty \int_0^\infty e^{-xy}\sin nx \,dx \,dy$$ $$=\int_0^\infty \left\{\int_0^\infty e^{-xy} \sin nx \,dx\right\} \,dy$$ $$=\int_0^\infty \frac{ndy}{\sqrt{n^2+y^2}}$$
which gives an indeterminate result, not the desired one.
Where did I go wrong? Can anyone help?