Verify that $(n-1)s^2(x) = \sum_{k=1}^{n}x_2^k − n\bar{x}^2$ Let $ θ$ be the mean of a normal distribution and $ aθ^2$ be the variance where $a$ in a known constant. That is $normal~ ( θ, a θ^2)$  How do i verify that:
$( − 1)^2 () = $$\sum_{k=1}^{n} _^2 −  \bar{x}^2$
I know that $s^2(x) = 1/(n-1)  \sum_{k=1}^{n} (X_ −  \bar{X})^2$ which is the sum of squares. But im not sure where the $\sum_{k=1}^{n}2x_k\bar{x}$ goes when expanding this.
Furthermore, how does $exp(\sum_{k=1}^{n}(x_k -  θ)^2)$ expand to becomes  $exp((n-1)s^2(x) + n(\bar{x} -  θ)^2)$.
I tried $exp( \sum_{k=1}^{n}((x_k - \bar{x} + \bar{x} - θ)^2) $ and that is suppose to become $exp(\sum_{k=1}^{n}(x_k - \bar{x})^2 + \sum_{k=1}^{n}(\bar{x} - θ)^2) $ but is that even possible without a transition step or something; is this correct?
Would really appreciate your help.
 A: As you stated in the question text (I assume the $X$ were supposed to be $x$),
$$s^2(x) = 1/(n-1) \sum_{k=1}^{n} (x_k −  \bar{x})^2 \tag{1}\label{eq1}$$
Thus,
$$\begin{equation}\begin{aligned}
(n-1)s^2(x) & = \sum_{k=1}^{n} (x_k − \bar{x})^2 \\
& = \sum_{k=1}^{n} (x_k^2 - 2x_k\bar{x} + \bar{x}^2) \\
& = \sum_{k=1}^{n} x_k^2 - \sum_{k=1}^{n}2x_k\bar{x} + \sum_{k=1}^{n}\bar{x}^2 \\
& = \sum_{k=1}^{n} x_k^2 - 2\bar{x}\sum_{k=1}^{n}x_k + n\bar{x}^2 \\
& = \sum_{k=1}^{n} x_k^2 - 2\bar{x}(n\bar{x}) + n\bar{x}^2 \\
& = \sum_{k=1}^{n} x_k^2 - n\bar{x}^2
\end{aligned}\end{equation}\tag{2}\label{eq2}$$
Note in the second last line I used that
$$\bar{x} = \frac{\sum_{k=1}^{n} x_k}{n} \implies \sum_{k=1}^{n} x_k = n\bar{x} \tag{3}\label{eq3}$$
Regarding your additional question of

Furthermore, how does $exp(\sum_{k=1}^{n}(x_k -  θ)^2)$ expand to becomes  $exp((n-1)s^2(x) + n(\bar{x} -  θ)^2)$.

With the exponent expressions, you get that
$$\begin{equation}\begin{aligned}
\sum_{k=1}^{n}(x_k - \theta)^2) & = \sum_{k=1}^{n}\left(\left(x_k - \bar{x}\right) + \left(\bar{x} - \theta\right)\right)^2 \\
& = \sum_{k=1}^{n}\left(x_k - \bar{x}\right)^2 + 2\sum_{k=1}^{n}\left(x_k - \bar{x}\right)\left(\bar{x} - \theta\right) + \sum_{k=1}^{n}\left(\bar{x} - \theta\right)^2 \\
& = (n-1)s^2(x) + 2\left(\bar{x} - \theta\right)\sum_{k=1}^{n}\left(x_k - \bar{x}\right) + n\left(\bar{x} - \theta\right)^2 \\
& = (n-1)s^2(x) + 2\left(\bar{x} - \theta\right)\left(\sum_{k=1}^{n}x_k - n\bar{x}\right) + n\left(\bar{x} - \theta\right)^2 \\
& = (n-1)s^2(x) + n\left(\bar{x} - \theta\right)^2
\end{aligned}\end{equation}\tag{4}\label{eq4}$$
I used \eqref{eq3} to get that the middle term in the second last line above is $0$.
