How the product of two integrals is iterated integral? $\int\cdot \int = \iint$

Let $\large{I} = \Large \int\limits_{-\infty}^{\infty} \normalsize e^{\small -\frac{y^2}{2}}\ dy$.

Then, my textbook says,

$$\tag{1} I^2 = \left( \int\limits_{-\infty}^{\infty} \normalsize e^{\small -\frac{y^2}{2}}\ dy\ \right) \left( \int\limits_{-\infty}^{\infty} \normalsize e^{\small -\frac{x^2}{2}}\ dx\ \right) = \int\limits_{-\infty}^{\infty} \int\limits_{-\infty}^{\infty} e^{-(y^2 +x^2)/2}\ dy\ dx$$

I am not seeing how we reach the rightmost, iterated integral, and I do not remember the calculus how or why this works. Why can we restate the product of two integrals, each having funcions of different variable, as an iterated integral including both variables?

Let $\large{I} = \Large \int\limits_{-\infty}^{\infty} \normalsize f_y(y)\ dy$ for any continuous, differentiable $f_y: \mathbb{R} \to \mathbb{R}$

Now, does (2) generally hold, $\forall x, y \in \mathbb{R}$ ? $$\tag{2} I^2 = \left( \int\limits_{-\infty}^{\infty} \normalsize f_y(y)\ dy\ \right) \left( \int\limits_{-\infty}^{\infty} \normalsize f_x(x)\ dx\ \right) = \int\limits_{-\infty}^{\infty} \int\limits_{-\infty}^{\infty} f_y(y)f_x(x) dy\ dx$$

or is result(1) specific to the particular function $e^{-(y^2)/2}$?

Please show the work or reasoning behind how and why this transformation is valid.

• If $\displaystyle \left( \int_{-\infty}^{\infty} \normalsize f_y(y)\ dy\ \right)$ converges, it is a constant, let's call it $a$. Then \begin{align} \left( \int_{-\infty}^{\infty} \normalsize f_y(y)\ dy\ \right) \left( \int_{-\infty}^{\infty} \normalsize f_x(x)\ dx\ \right)&=a\left( \int_{-\infty}^{\infty} \normalsize f_x(x)\ dx\ \right)\\ &=\left( \int_{-\infty}^{\infty} a\normalsize f_x(x)\ dx\ \right)\\&=\int_{-\infty}^{\infty} \left(\int_{-\infty}^{\infty} f_y(y) dy\right)f_x(x) dx, \end{align}for similar reasons you can now get the $f_x(x)$ inside the integral on $y$. – Git Gud Nov 3 '13 at 9:06
• Integrals are essentially sums (in view of Riemann sum). Thus it is not so bad to say that the questioned identity holds because $$(a+b)(c+d) = a(c+d)+b(c+d) = (ac+ad)+(bc+bd).$$ – Sangchul Lee Nov 3 '13 at 9:10
• We must be looking at the exact same textbook. I saw this in the proof that the normal distribution is a pdf, searched for "multiplying two integrals together," and landed right here. – Max Dec 4 '19 at 23:43
• Read Fubini's Theorem. Try either Wikipedia or Wolfram MathWorld for quick easy read. – Levano Mar 31 at 13:44

Note first, that for any integrable $f \colon \def\R{\mathbb R}\R \to \R$ and any $\alpha \in \R$ we have $$\int_\R \alpha f(x)\, dx = \alpha \int_\R f(x) \, dx$$ Now note that with $\alpha := \int_\R f(y)\, dy$ (this depends on $f$, but given $f$ it is a constant) this gives $$\int_\R \left(\int_\R f(y)\, dy\right)\, f(x)\, dx = \int_\R f(y)\, dy \cdot \int_\R f(x)\, dx$$ Now, for every fixed $x \in \R$, we apply the above again, now for $\alpha = f(x)$ (which is not depending on $y$), giving $$\left(\int_\R f(y)\, dy\right)\, f(x) = \int_\R f(x)f(y)\, dy$$ altogether $$\int_\R \int_\R f(y)f(x)\, dy\, dx = \int_\R f(y)\, dy \cdot \int_\R f(x)\, dx$$