Integrating the following function
By Fubini, \begin{align*} I&=\int_{{\bf{R}}^{n}}e^{-a_{1}^{2}x_{1}^{2}}\cdots e^{-a_{n}^{2}x_{n}^{2}}dx_{1}\cdots dx_{n}\\ &=\int_{{\bf{R}}}\cdots\int_{\bf{R}}e^{-a_{1}^{2}x_{1}^{2}}dx_{1}\cdots e^{-a_{n}^{2}x_{n}^{2}}dx_{n}\\ &=\left(\int_{\bf{R}}e^{-a_{1}^{2}x_{1}^{2}}dx_{1}\right)\cdots\left(\int_{{\bf{R}}}e^{-a_{n}^{2}x_{n}^{2}}dx_{n}\right)\\ &=\dfrac{\sqrt{\pi}}{|a_{1}|}\cdots\dfrac{\sqrt{\pi}}{|a_{n}|}. \end{align*}
The function is measurable because it is continuous and, also, positive. By the Fubini-Tonelli Theorem, $$ \begin{aligned}\int_{\mathbb{R}^n}\exp\left({-\sum_{i=1}^na_i^2x_i^2}\right)\,dx&=\prod_{i=1}^n\int_{\mathbb{R}}e^{-a_i^2x_i^2}\,dx_i=\prod_{i=1}^n\left(\int_{\mathbb{R}}e^{-a_i^2x^2}\,dx\right)\\&=\left(\frac{1}{|a_1\cdots a_n|}\int_{\mathbb{R}}e^{-x^2}\,dx\right)^n=\frac{(\sqrt{\pi})^n}{|a_1\cdots a_n|}. \end{aligned}$$
In case you are not familiar with the Gaussian Integral, here is a quick result.
Applying the previous theorem and a change of variable to $(\int_{\mathbb{R}}e^{-x^2}\,dx)^2\,$ we obtain $$\left(\int_{\mathbb{R}}e^{-x^2}\,dx\right)^2=\int_{\mathbb{R}}e^{-x^2}\,dx\int_{\mathbb{R}}e^{-y^2}\,dy=\int_{\mathbb{R}^2}e^{-(x^2+y^2)}\,dxdy=\int_{]0,+\infty[\times]0,2\pi[}re^{-r^2}\,drd\theta=\pi.$$ Take the square root of both sides, and the result follows.