<s>[INST] Inductive proof of $1^2-2^2+3^2-\dots+(-1)^{n-1}n^2=\frac{(-1)^{n-1}n(n+1)}2$ $$P(n):1^2-2^2+3^2-\dots+(-1)^{n-1}n^2=\frac{(-1)^{n-1}n(n+1)}2$$
I'm having trouble proving $P(k+1)$ through mathematical induction for this problem.
For $P(k+1)$, I have
$$1^2-2^2+3^2-\dots+(-1)^{(k+1)-1}(k+1)^2=\frac{(-1)^{(k+1)-1}(k+1)(k+2)}2$$
But I am unsure how to simplify/prove $P(k+1)$ from here. Any suggestions?
Thank you!
 [/INST] Here it is better to derive $P(n+1)$ from $P(n)$ rather than the other way round. I'll use sigma notation for the sum:
$$1^2-2^2+3^2-\dots+(-1)^{n-1}n^2=\sum_{k=1}^n(-1)^{k-1}k^2$$
Having shown $P(n)$:
$$\sum_{k=1}^n(-1)^{k-1}k^2=\frac{(-1)^{n-1}n(n+1)}2$$
we now add the next term of the summation, $(-1)^n(n+1)^2$:
$$\sum_{k=1}^{n+1}(-1)^{k-1}k^2=\frac{(-1)^{n-1}n(n+1)}2+(-1)^n(n+1)^2$$
$$=\frac{(-1)^{n-1}n(n+1)}2-\frac{2(-1)^{n-1}(n+1)^2}2$$
$$=\frac{(-1)^{n-1}(n+1)(n-2(n+1))}2$$
$$=\frac{(-1)^{n-1}(n+1)(-n-2)}2$$
$$=\frac{(-1)^n(n+1)(n+2)}2$$
This is $P(n+1)$ and completes the inductive step. Of course, you still need the base case, which is $P(1):1^2=\frac{(-1)^0×1×2}2$.
</s>