I am now reading the Bishop Machine Learning Book and going through every single equation.
We know that in the case of a single real-valued variable $x$, the Gaussian distribution is defined by $$\mathcal{N}\left(x \mid \mu, \sigma^{2}\right)=\frac{1}{\left(2 \pi \sigma^{2}\right)^{1 / 2}} \exp \left\{-\frac{1}{2 \sigma^{2}}(x-\mu)^{2}\right\}$$
Since the dataset $\mathbf{X}$ is i.i.d., we can therefore write the probability of the dataset, given $\mu \text { and } \sigma^{2}$, in the form
$$p\left(\mathbf{x} \mid \mu, \sigma^{2}\right)=\prod_{n=1}^{N} \mathcal{N}\left(x_{n} \mid \mu, \sigma^{2}\right)$$
We will resolve the numerical underflow by computing the sum of the log probabilities, therefore from the above two equations we have the following log-likelihood function, $$\ln p\left(\mathbf{x} \mid \mu, \sigma^{2}\right)=-\frac{1}{2 \sigma^{2}} \sum_{n=1}^{N}\left(x_{n}-\mu\right)^{2}-\frac{N}{2} \ln \sigma^{2}-\frac{N}{2} \ln (2 \pi)$$
I am not quite sure how did they derive this in the book. Thanks a lot and have a good day.
You can refer to page 27 equation 1.54 for the detail.