## Stats: proving an equality with summations

Spent several hours trying to prove this, and now my eyes are swimming :/

I need to show that: $\displaystyle ns^2_{n+1} = (n-1)s^2_n + \frac{n}{n+1}(x_{n+1} - \bar{x}_n)^2$

where $\displaystyle \bar{x}$ is the mean, and $\displaystyle s^2_n$ is the variance for a set of data with n elements, and $\displaystyle s^2_{n+1}$ is the variance for the same set of data, with 1 additional element ($\displaystyle x_{n+1}$) added to it. The goal being, I assume, to calculate the new variance based on the old variance without having to redo the grunt work.

edit:
some formulas
$\displaystyle \bar{x} = \frac{\sum_{i=1}^n x_i}{n}$

$\displaystyle s^2 = \frac{\sum_{i=1}^n(x_i-\bar{x})^2}{n-1}$

or, alternatively

$\displaystyle s^2 = \frac{\sum_{i=1}^n x_i^2 - \frac{(\sum_{i=1}^n x_i)^2}{n}}{n-1}$

In a different portion of question, they also mentioned that the mean of the set with $\displaystyle x_{i+1}$ added to it can be derived from the current mean. I determined that this formula is $\displaystyle \bar{x}_{i+1} = \frac{n\bar{x}_n + x_{n+1}}{n+1}$