I was solving a practice competitive programming question when I realized that this seems very familiar to the things I have done in a Calculus class. So, I tried to figure out the closed form partial sum for $\sum _{ n=1 }^{ m }{ (-1)^{ n }\cdot n } $, but I realized that I am in over my head. I entered "$-1 + 2 + -3 + 4 + -5 +...$" into Wolfram Alpha, and I got that the partial sum formula for $\sum _{ n=1 }^{ m }{ (-1)^{ n }\cdot n } = \frac { 1 }{ 4 } (2(-1)^{ m }m+(-1)^{ m }-1)$
I feel guilty for blindly applying a formula to solve a problem, and I have not been able to find any wikipedia article, or any other source that provides an explanation for this closed form partial sum formula. I would appreciate if someone can provide an explanation for this.