I was given an assignment of finding the sum of $$ 1^2 - 2^2 + 3^2 - 4^2 + 5^2 - 6^2 + \dots + (-1)^{n-1}n^2 $$ Where $n$ is an odd number.
I've already checked the answer in wolframalpha which is $$\sum_{k=1}^n (-1)^{k-1}k^2 = -\frac{(-1)^n n(n+1)}{2}$$
and was wondering if anyone would be willing to show me how to solve the exercise step-by-step.
I've tried grouping positive and negative terms and got pretty close to the actual answer but then ran out of ideas $$\sum_{k=1}^{n/2} (2n-1)^2-(2n)^2 = -\frac{n(n+1)}{2}$$
Thank you all.