Let $\overline{X}_k$ and $S_k^2$ denote the sample mean and sample variance based on the first $k$ observations. Then establish the following $$n S_{n+1}^2 = (n-1)S_n^2 + \big( \frac{n}{n+1}\big) (X_{n+1} - \overline{X}_n)^2.$$
I am trying to use the relation $$\overline{X}_{n+1} = \frac{X_{n+1} + n\overline{X}_n}{n+1}.$$
I tried to decompose the sum into the first $n$ and the last $n+1$th term, however I get $$n S_{n+1}^2 = \sum_{i=1}^{n+1} (X_i - \overline{X}_{n+1})^2 = \sum_{i=1}^n (X_i - \frac{X_{n+1} + n \overline{X}_n}{n+1})^2 + (\frac{n}{n+1} X_{n+1} - \overline{X}_n)^2,$$ which has the square of $\frac{n}{n+1}$. How can I get this relation? I would greatly appreciate some help.