[proofplan]
We show that if the joint density factorises as $f(x_1, \ldots, x_n) = g_1(x_1) \cdots g_n(x_n)$, then each marginal density is proportional to the corresponding $g_i$, with a normalising constant determined by integration. We then verify the independence condition $f(x_1, \ldots, x_n) = f_1(x_1) \cdots f_n(x_n)$ by computing the product of marginals.
[/proofplan]
custom_env
admin
[step:Compute the marginal densities by integrating out other variables]
The marginal density of $X_i$ is obtained by integrating the joint density over all other variables. For concreteness, consider $X_1$:
\begin{align*}
f_{X_1}(x_1) &= \int_{-\infty}^{\infty} \cdots \int_{-\infty}^{\infty} f(x_1, \ldots, x_n)\, dx_2 \cdots dx_n \\
&= \int_{-\infty}^{\infty} \cdots \int_{-\infty}^{\infty} g_1(x_1) g_2(x_2) \cdots g_n(x_n)\, dx_2 \cdots dx_n \\
&= g_1(x_1) \prod_{j=2}^{n} \int_{-\infty}^{\infty} g_j(x_j)\, dx_j,
\end{align*}
where we factor out $g_1(x_1)$ (which does not depend on $x_2, \ldots, x_n$) and separate the remaining integrals (which are over independent variables). Define the constant $c_j = \int_{-\infty}^{\infty} g_j(x_j)\, dx_j > 0$ for each $j$. (Each $c_j$ is positive and finite because $g_j \ge 0$ and the joint density integrates to $1$.) Then
\begin{align*}
f_{X_1}(x_1) = g_1(x_1) \prod_{j=2}^{n} c_j.
\end{align*}
By the same argument for each $i$,
\begin{align*}
f_{X_i}(x_i) = g_i(x_i) \prod_{j \ne i} c_j.
\end{align*}
In particular, $f_{X_i}$ is proportional to $g_i$.
[/step]
custom_env
admin
[step:Verify the independence condition by comparing with the product of marginals]
The product of all marginal densities is
\begin{align*}
\prod_{i=1}^{n} f_{X_i}(x_i) = \prod_{i=1}^{n} \left(g_i(x_i) \prod_{j \ne i} c_j\right) = \left(\prod_{i=1}^{n} g_i(x_i)\right) \cdot \prod_{i=1}^{n} \prod_{j \ne i} c_j.
\end{align*}
In the second factor, each $c_j$ appears exactly $n-1$ times (once for each $i \ne j$), so
\begin{align*}
\prod_{i=1}^{n} \prod_{j \ne i} c_j = \left(\prod_{j=1}^{n} c_j\right)^{n-1}.
\end{align*}
Meanwhile, the joint density integrates to $1$:
\begin{align*}
1 = \int_{\mathbb{R}^n} f(x_1, \ldots, x_n)\, dx_1 \cdots dx_n = \prod_{j=1}^{n} c_j,
\end{align*}
so $\prod_{j=1}^{n} c_j = 1$, and therefore $\prod_{i=1}^{n} \prod_{j \ne i} c_j = 1^{n-1} = 1$. Hence
\begin{align*}
\prod_{i=1}^{n} f_{X_i}(x_i) = \prod_{i=1}^{n} g_i(x_i) = f(x_1, \ldots, x_n).
\end{align*}
The joint density equals the product of the marginals, so $X_1, \ldots, X_n$ are independent.
[/step]