What is the value of $\sum_{i=1}^n(-1)^{i+1}i(i+1)$? $$\sum_{i=1}^n(-1)^{i+1}i(i+1)$$
I know
$$\sum_{i=1}^ni(i+1)=\frac{n(n+1)(n+2)}3$$
but not for the first expression. Thank you in advance and I'm not a mathematician or math student so just ask me if any information is needed.

I'll write the general term as $$a_n=(-1)^{n+1}n(n+1)\qquad n=1,2,\cdots$$
Then, $$\sum_{k=1}^{2h} a_k=\sum_{k=1}^{h}a_{2k}+a_{2k-1}=\sum_{k=1}^h2k(2k-1)-(2k+1)2k=-\sum_{k=1}^h4k=-2h(h+1)$$
So, for even values of $n$, $$\sum_{k=1}^n a_k=-\frac{n(n+2)}2=-\frac{n^2}2-n$$
On the other hand, if $n$ is odd, $$\sum_{k=1}^n a_k=n(n+1)=\sum_{k=1}^{n-1}a_k=n(n+1)-\frac{(n-1)(n+1)}{2}=\\=\frac{n^2}2+n+\frac12$$
One formula covering both cases $$\sum_{k=1}^na_k=\frac14+(-1)^{n+1}\frac{2n^2+4n+1}{4}$$
