Please look at this expression:
$$1^{2}-2^{2}+3^{2}-4^{2} + \cdots + (-1)^{n-1} n^{2}$$
I found this expression in a math book. It asks us to find a general formula for calculate it with $n$.
The formula that book suggests is this:
$$-\frac{1}{2}\times (-1)^{n} \times n(n+1)$$
Would you mind explaining to me how we get this formula?