i know the summation of $1 \times 2 + 2\times 3 + 3\times 4 = \frac{k(k+1)(k+2)}3$ but this one has negative terms. so we need to find below
$$\sum_{i=1}^n(-1)^{i+1} (i(i+1))$$
e.g. $1\times 2 - 2\times 3 + 3\times 4 ....$
if you can share the derivation then it would be very great.
Hint:
If $n$ is even,
\begin{align} \sum_{i=1}^n (-1)^{i+1} i(i+1) &= 1(2)-(2)(3)+(3)(4)-4(5)+\ldots+(n-1)(n)-n(n+1) \\ &=2(1-3)+4(3-5)+\ldots+n(n-1-n-1)\\ &=(-2)(2+4+\ldots n)\\ &=(-4)\left(1+2 + \ldots +\frac{n}{2}\right)\end{align}
Edit:
If $n$ is even, the expression above simplifies to
$$(-4)\frac12\left(\frac{n}2 \right)\left(\frac{n}2 +1\right)=-\frac{n(n+2)}2$$
If $n$ is odd, then $n-1$ is even and the corresponding expression is
$$-\frac{(n-1)(n+1)}2+n(n+1)=(n+1)\left(n - \frac{n-1}{2} \right)=\frac{(n+1)^2}{2}$$