Find a solution to this integral $\displaystyle I = \int_0^{\infty} e^{-x^2} dx$ analytically by calculating $\displaystyle I^2 = \int_0^{\infty} \int_0^{\infty} e^{-x^2} e^{-y^2} dydx$.

I am not sure about how to go about this question, how did they get $\displaystyle I^2 = \int_0^{\infty} \int_0^{\infty} e^{-x^2} e^{-y^2} dydx$? Shouldn't $\displaystyle I^2 = \int_0^{\infty} e^{-x^2} dx \times \int_0^{\infty} e^{-x^2} dx = \int_0^{\infty}\int_0^{\infty} e^{-x^2} \cdot e^{-x^2} dxdy$?

Thanks very much! (Just a bit confused on this question because I am working ahead of class

)