# Show (via differentiation) $1-2+3-4+\cdots+(-1)^{n-1}n$ is $-\frac{n}{2}$ for $n$ even, $\frac{(n+1)}{2}$ for $n$ odd.

i) By considering $(1+x+x^2+\cdots+x^n)(1-x)$ show that, if $x\neq 1$, $$1+x+x^2+\cdots+x^n=\frac{(1-x^{n+1})}{1-x}$$

ii) By differentiating both sides and setting $x=-1$ show that $$1-2+3-4+\cdots+(-1)^{n-1}n$$

takes the value $-\frac{n}{2}$ if n is even and the value $\frac{(n+1)}{2}$ if n is odd.

For part i) I just simplified the LHS, divided by $(1-x)$ and got the desired result.

For the next part I found the derivative of both sides, and set $x=-1$ giving me:

$$1-2+3-4+\cdots+(-1)^{n-1}n = \frac{(2)(-1(n+1)(-1)^n)-(1-x^{n+1})(-1)}{4} = \frac{-2(n+1)(-1)^n+1+(-1)^{n+2}}{4}$$

However I'm not understanding the part about n being even and odd. If n is even, does this mean that $n = 2n$ and if it is odd, $n = 2n+1/2n-1$? What would be the next step?

Thanks

• $n = 2n$ can only be true when $n = 0$. Anyway, when $n$ is even $(-1)^n = 1$, and when is odd, $(-1)^n = -1$. Commented Aug 30, 2013 at 11:33
• The main importance of $n$ in part ii) being even or odd concerns the sign of $(-1)^n$ and $(-1)^{n+2}$. If $n$ is even, then they are both equal to $1$, and if $n$ is odd, they are equal to $-1$. Commented Aug 30, 2013 at 11:33
• @Arthur oh, so if we said n to be even, do I replace the n with 2n? Commented Aug 30, 2013 at 11:37
• No. If $n$ is even, it is of the form $2k$ for some integer $k$, not necessarily $k = n$. For example, $6$ is even and is of the form $2\times 3$, not $2\times 6$. Commented Aug 30, 2013 at 11:39
• $-2(n+1)(-1)^n + 1 + (-1)^{n+2} = -2(n+1) + 1 + +1 = -2n$ if n is even, and it equals $2(n+1) +1 -1 = 2(n+1)$ is $n$ is odd. Commented Aug 30, 2013 at 11:41

If $n$ is even, $n = 2k$ for some integer $k$. Then $(-1)^n = (-1)^{2k} = ((-1)^2)^k = 1^k = 1$ and $(-1)^{n + 2} = (-1)^n\times(-1)^2 = 1\times 1 = 1$. Therefore, we have
• yeah I managed to do it for the odd case (I like the way it's laid out, this is what I wanted to know). I still am failing to understand why the $(n+1)$ doesn't change when n is odd and even. If n is even then, $n=2k$ for some integer k, then $(n+1)=2k+1$ and if n is odd, then $n=2k-1$ for some integer k, then $(n+1) = 2k. How does (n+1) not change between even and odd values of n? Commented Aug 30, 2013 at 14:34 • If you substitute$n = 2k$at the beginning of the process I've written, your final answer will be$-\frac{2k}{2}$which you can write as either$-k$or$-\frac{n}{2}$. Likewise, in the odd case, if you replace$n$by$2k - 1$the expression becomes$\frac{2k}{2}$which you can write as either$k$or$\frac{n+1}{2}$. The manipulation of$(n + 1)$does not change depending on whether$n$is odd or even, whereas the behaviour of$(-1)^n$does. That is why we don't need to write$(n + 1)$differently for$n$odd and even, but we do need to make such considerations for$(-1)^n$. Commented Aug 30, 2013 at 15:20 • got it thanks, also when we say that$n=2k$for integer values of k do we include 0 or the negative numbers? Is -2 even? My teacher once told me numbers alternate in an even odd pattern, is this true? Is 0 included in the set of positive integers or natural numbers? Commented Aug 30, 2013 at 15:46 • Yes,$0$is even as are$-2$,$-4$,$\dots$Integers do indeed alternate between even and odd. The integer$0$is not positive or negative. Whether$0\$ is a natural number or not is a matter of convention; some people include it, some people don't. Commented Aug 30, 2013 at 16:00