Gaussian distribution and least square methods Gaussian Notation 
$$N(x|\mu,\sigma) = 1/(2\pi \sigma^2)^(1/2) \exp{ (-1/2\sigma^2)(x-\mu)^2} $$
$$p(x|\mu,\sigma) = \prod  N(x_n | \mu , \sigma^2)$$
When you take a  $$ln$$ on both side 
$$ln(x|\mu,\sigma)  =  -1/2\sigma^2  \sum(x_n-\mu)^2 - N/2(ln\sigma^2) - N/2ln(2\pi)$$
I'm confused with how 
$$N/2(ln\sigma^2) - N/2ln(2\pi)$$ 
derived.
and  when you take partial differential it mu and sigma will be 
$$\mu  = 1/N \sum X_n$$
$$\sigma^2 = 1/N \sum (x_n - \mu)2$$
can you show me how they derive this ? 
 A: Your notation is not great when defining the normal distribution and the number of samples.
$$
\prod_{i=0}^{n}\mathcal{N}(x_i|\mu,\sigma^2) = \prod_{i=0}^{n}\frac{1}{\sqrt{2\pi\sigma^2}}\mathrm{e}^{-\frac{(x-\mu)^2}{2\sigma^2}}
$$
we can distribute the product
$$
\prod_{i=0}^{n} a_i b_i = \prod_{i=0}^{n}a_i\prod_{i=0}^{n}b_i
$$
we also have
$$
\prod_{i=0}^{n}a = a^n
$$
and finally
$$
\prod_{i=0}^{n}\mathrm{e}^{x_i} = \mathrm{e}^{\sum_{i=0}^nx_i}
$$
so lets look at your problem
$$
\prod_{i=0}^{n}\frac{1}{\sqrt{2\pi\sigma^2}}\mathrm{e}^{-\frac{(x-\mu)^2}{2\sigma^2}} = \prod_{i=0}^{n}\frac{1}{\sqrt{2\pi\sigma^2}}\prod_{i=0}^{n}\mathrm{e}^{-\frac{(x-\mu)^2}{2\sigma^2}}
$$
$$
a = \frac{1}{\sqrt{2\pi\sigma^2}}\\
b_i = \mathrm{e}^{-\frac{(x-\mu)^2}{2\sigma^2}}
$$
$$
\prod_{i=0}^{n}\frac{1}{\sqrt{2\pi\sigma^2}}= \left(\frac{1}{\sqrt{2\pi\sigma^2}}\right)^n = (2\pi\sigma^2)^{-n/2}
$$
and the exponential
$$
\prod_{i=0}^{n}\mathrm{e}^{-\frac{(x-\mu)^2}{2\sigma^2}} =\mathrm{e}^{-\sum_{i=0}^n\frac{(x_i-\mu)^2}{2\sigma^2}}
$$
putting it all together
$$
\prod_{i=0}^{n}\mathcal{N}(x_i|\mu,\sigma^2) = (2\pi\sigma^2)^{-n/2}\cdot \mathrm{e}^{-\sum_{i=0}^n\frac{(x_i-\mu)^2}{2\sigma^2}}
$$
taking logs as usually $\ln (ab) = \ln a +\ln b$ and $\ln a^n = n\ln a$ we have
$$
\ln \left(\prod_{i=0}^{n}\mathcal{N}(x_i|\mu,\sigma^2) \right) = \ln\left((2\pi\sigma^2)^{-n/2}\cdot \mathrm{e}^{-\sum_{i=0}^n\frac{(x_i-\mu)^2}{2\sigma^2}}\right) = -\frac{n}{2}\ln(2\pi\sigma^2) - \sum_{i=0}^n\frac{(x_i-\mu)^2}{2\sigma^2}
$$
you can now distribute the log of the first term on the rhs.
To compute the derivatives as per the MLE method
we have
$$
\mathcal{L} = \ln \left(\prod_{i=0}^{n}\mathcal{N}(x_i|\mu,\sigma^2) \right)
$$
taking the derivaive w.r.t to $\sigma$ and $\mu$ and set to 0. 
$$
\dfrac{\partial \mathcal{L}}{\partial \mu} = - \dfrac{\partial}{\partial \mu}\sum_{i=0}^n\frac{(x_i-\mu)^2}{2\sigma^2}= -\frac{1}{\sigma^2}\sum_{i=0}^n-1\cdot(x_i-\mu)
$$
thus to obtain the minimum we require the numerator to be identically zero. Thus
$$
\sum_{i=0}^n(x_i-\mu)=0
$$
now re-arrange to be obtain the required expression.
Doing the same with $\sigma$ we compute
$$
\dfrac{\partial \mathcal{L}}{\partial \sigma} =  \dfrac{\partial }{\partial \sigma} -\frac{n}{2}\ln(2\pi\sigma^2) - \sum_{i=0}^n\frac{(x_i-\mu)^2}{2\sigma^2} = -\frac{n}{2}\frac{2\pi \cdot 2\sigma}{2\pi \sigma^2}- \sum_{i=0}^n(x_i-\mu)^2\frac{-2\sigma}{\sigma^3}
$$
setting to zero
$$
-\frac{n}{2}\frac{2\pi \cdot 2\sigma}{2\pi \sigma^2}- \sum_{i=0}^n(x_i-\mu)^2\frac{-2\sigma}{2\sigma^3} = -\frac{n}{\sigma}+\frac{1}{\sigma^2}\sum_{i=0}^n(x_i-\mu)^2
$$
so I will leave it to you to re-arrange
$$
-\frac{n}{\sigma}+\frac{1}{\sigma^2}\sum_{i=0}^n(x_i-\mu)^2 = 0
$$
