Question:
Let $\bar{x}_n$ and $s_n^2$ denote the sample mean and variance. Let $\bar{x}_{n + 1}$ and $s_{n+1}^2$ denote the mean and variance when a new observation $x_{n+1}$ is added. Show that $ n s_{n+1}^2 = (n - 1) s_{n+1}^2 + \frac{n}{n+1}(x_{n + 1} - \bar{x}_n) ^ 2 $ so that $s_{n + 1} ^ 2$ can be computed from $x_{n + 1}$, $\bar{x}_n$, and $s_n^2$.
My attempt:
I was able to derive that the new mean $\bar{x}_{n + 1} = \frac{n\bar{x} + x_{n + 1}} {n + 1}$ but I could not derive the new sample variance.
How do I proceed?
Update:
I am using the formula for variance as follows:
$$ s^2_{n+1} = \frac{\sum^{n+1}_{1} (x_i - \bar{x}_{n+1}) ^ 2}{n} $$
I added 1 to $n - 1$ since we have one more observation. I tried expanding the numerator as $(a - b) ^ 2$ and using properties of the summation operator but it didn't get me the right result.