<s>[INST] Using summation by parts to evaluate an alternating sum I want to evaluate
$$
 \sum_{k=0}^n (-1)^k \binom{n}{k} k.
$$
I tried summation by parts, i.e. the formula
$$
 \sum_{k=0}^n (f(k+1) - f(k))g(k)
  = f(n+1)g(n+1) - f(0)g(0) - \sum_{k=0}^n f(k+1) (g(k+1) - g(k))
$$
with $f(k+1) - f(k) = (-1)^k \binom{n}{k}$ and $g(k) = k$. As
$$
 (-1)^{k+1}\binom{n-1}{k+1} - (-1)^k \binom{n-1}{k}
 = (-1)^{k+1} \left( \binom{n-1}{k+1} + \binom{n-1}{k} \right)
 = (-1)^{k+1} \binom{n}{k+1} 
$$
we have $f(k) = (-1)^k \binom{n-1}{k}$. Plugging into the formula
\begin{align*}
 \sum_{k=0}^n (-1)^k \binom{n}{k} k
  & = (-1)^{n+1} \binom{n-1}{n+1} (n+1) - (-1)^0 \binom{n-1}{0}\cdot 0
    - \sum_{k=0}^n (-1)^{k+1} \binom{n-1}{k+1} \\
  & = \sum_{k=0}^n (-1)^{k} \binom{n-1}{k+1}.
\end{align*}
But for example if $n = 3$ then
$$
 \sum_{k=0}^n (-1)^k \binom{n}{k} k = -3 + 6 -3 = 0
$$
but
$$
 \sum_{k=0}^n (-1)^{k} \binom{n-1}{k+1} 
  = \binom{2}{1} - \binom{2}{2}
  = 1
$$
which is not equal, but I cannot see whats wrong with the above derivation??
 [/INST] Summation by parts is definitely an overkill, differentiation a lesser overkill. For any $n\geq 1$ we have
$$ k\binom{n}{k} = n\binom{n-1}{k-1} $$
and
$$ \sum_{k=0}^{n}(-1)^k\binom{n}{k}k = \sum_{k=1}^{n}(-1)^k\binom{n}{k}k = -n\sum_{k=1}^{n}(-1)^{k-1}\binom{n-1}{k-1}=-n\sum_{j=0}^{n-1}\binom{n-1}{j}(-1)^j $$
so your sum is constantly zero for any $n\geq 2$ and you just have to compute it by hand for $n=0$ and $n=1$.
</s>