Notation within gaussian function
The notation $\|x_n - \mu\|^2$ stands for the squared $L_2$ norm of the vector $x_n - \mu$.
The squared $L_2$ norm of the $d$-dimensional vector $v = \begin{pmatrix} v_1 &amp; \cdots &amp; v_d \end{pmatrix}$ is $$\|v\|^2 = v_1^2 + \cdots + v_d^2. $$
In particular, when $d = 1$, we have $\|v\|^2 = v_1^2$.
The formula you state works for the Gaussian multivariate distribution, when the various variables are independent and have the same variance $\sigma^2$. The formula in the general case is a bit more complicated.