2-D Gauss function

$ \def \spekhaken {\iint} \def \half {\frac{1}{2}} \def \EN {\quad \mbox{and} \quad} $ Associated with the first and second order moments in one dimension is the Gauss function, also known as the normal distribution in Statistics: $$ g(x) = \frac{1}{\sigma \sqrt{2\pi}} e^{- \half (x-\mu)^2/\sigma^2} = \frac{1}{\sqrt{2\pi \sigma_{xx}}} e^{- \half (x-\mu_x)^2/\sigma_{xx}} $$ The exponent (apart from the factor $1/2$) could have been written as: $$ (x-\mu_x)^2/\sigma_{xx} = (x-\mu_x) \frac{1}{\sigma_{xx}} (x-\mu_x) $$ In the general two-dimensional case, $\sigma_{xx}$ will be replaced by the tensor: $$ \left[ \begin{array}{cc} \sigma_{xx} & \sigma_{xy} \\ \sigma_{xy} & \sigma_{yy} \end{array} \right] $$ And the inverse $1/\sigma_{xx}$ by the inverse of this matrix: $$ \left[ \begin{array}{cc} \sigma_{xx} & \sigma_{xy} \\ \sigma_{xy} & \sigma_{yy} \end{array} \right]^{-1} = \left[ \begin{array}{cc} \sigma_{yy} & - \sigma_{xy} \\ - \sigma_{xy} & \sigma_{xx} \end{array} \right] / ( \sigma_{xx} \sigma_{yy} - \sigma_{xy}^2 ) $$ The accompanying quadratic form is: $$ \left[ \begin{array}{cc} (x-\mu_x) & (y-\mu_y) \end{array} \right] \left[ \begin{array}{cc} \sigma_{yy} & - \sigma_{xy} \\ - \sigma_{xy} & \sigma_{xx} \end{array} \right] \left[ \begin{array}{c} (x-\mu_x) \\ (y-\mu_y) \end{array} \right] / ( \sigma_{xx} \sigma_{yy} - \sigma_{xy}^2 ) $$ $$ = \frac{ \sigma_{yy} (x-\mu_x)^2 - 2 \sigma_{xy} (x-\mu_x) (y-\mu_y) + \sigma_{xx} (y-\mu_y)^2 } { \sigma_{xx} \sigma_{yy} - \sigma_{xy}^2 } $$ This in turn corresponds to the generalization of the Gauss Function in 2-D: $$ g(x,y) = e^{ - \half \left[ \sigma_{yy} (x-\mu_x)^2 - 2 \sigma_{xy} (x-\mu_x) (y-\mu_y) + \sigma_{xx} (y-\mu_y)^2 \right] / ( \sigma_{xx} \sigma_{yy} - \sigma_{xy}^2 ) } $$ A simplified quadratic form for the inverse problem can be found easily, because the eigenvalues of an inverse matrix are always the inverses of the eigenvalues of the original tensor. The latter are $\lambda_1$ and $\lambda_2$. Hence the former are found immediately to be: $$ 1 / \lambda_1 \EN 1 / \lambda_2 $$ This in turn means that the Gauss function, when transformed to eigenvector coordinates, is simply given by: $$ g(x,y) = e^{ - \half \left[ (x-\mu_x)^2 / \lambda_1 + (y-\mu_y)^2 / \lambda_2 \right] } $$ What's still missing is a norming factor for the skewed 2-D Gaussian function. To this end, integrate the function $g(x,y)$ over the whole plane: $$ \spekhaken g(x,y) \, dx \, dy = \spekhaken e^{ - \half \left[ (x-\mu_x)^2 / \lambda_1 + (y-\mu_y)^2 / \lambda_2 \right] } \, dx \, dy $$ Substitute $u = (x-\mu_x) / \sqrt{\lambda_1}$ and $v = (y-\mu_y) / \sqrt{\lambda_2}$ : $$ = \spekhaken e^{ - \half ( u^2 + v^2 ) } \, d(u \sqrt{\lambda_1}) \, d(v \sqrt{\lambda_2}) = \sqrt{\lambda_1 \lambda_2} \spekhaken e^{ - \half (u^2 + v^2) } \, du \, dv = $$ Transform to polar coordinates: $$ = \sqrt{\lambda_1 \lambda_2} \spekhaken e^{ - \half r^2 } \, r dr d\phi = - \sqrt{\lambda_1 \lambda_2} \spekhaken e^{-\half r^2} \, d(-\half r^2) d\phi = $$ $$ = - \sqrt{\lambda_1 \lambda_2} \: 2\pi \left[ e^{-\half r^2 } \right]_0^\infty = \sqrt{\lambda_1 \lambda_2} \: 2\pi = 2 \pi \: \sqrt{Det} $$ Thus the norming factor for the 2-D skewed Gaussian function is, when used over the whole plane from $-\infty$ to $+\infty$: $$ 2\pi \sqrt{ \sigma_{xx} \sigma_{yy} - \sigma_{xy}^2 } $$ The normed (and skewed) two-dimensional Gaussian distribution function is completed herewith as: $$ g(x,y) = \frac{ e^{-\half \left[ \sigma_{yy} (x-\mu_x)^2 - 2 \sigma_{xy} (x-\mu_x) (y-\mu_y) + \sigma_{xx} (y-\mu_y)^2 \right] / ( \sigma_{xx} \sigma_{yy} - \sigma_{xy}^2 ) }} {2\pi\sqrt{\sigma_{xx}\sigma_{yy}-\sigma_{xy}^2 }} $$