Solution (source code)

= Solution

The <Box-Muller transform> uses independent uniforms to set
$$
R=\sqrt{-2\log U_2},\qquad A=2\pi U_3,\qquad
\boxed{X_1=R\cos A,\quad X_2=R\sin A.}
$$
The radius has the unit <Rayleigh distribution>, with density $re^{-r^2/2}$ for $r>0$, and the angle is independently uniform on $[0,2\pi)$. Their joint density is $(2\pi)^{-1}re^{-r^2/2}$. The Cartesian change of variables has absolute <Jacobian determinant> $r$, so the joint density of $(X_1,X_2)$ is
$$
\frac1{2\pi}e^{-(x_1^2+x_2^2)/2}
=\left(\frac1{\sqrt{2\pi}}e^{-x_1^2/2}\right)
\left(\frac1{\sqrt{2\pi}}e^{-x_2^2/2}\right).
$$
The factorization proves that the outputs are <independent random variables>, each with a <standard normal distribution>.