Derivative of sum of powers For fixed $n \geq 1$ and $p \in [0,1]$, is there a nice expression for the derivative of
$\sum_{k=0}^n p^k (1-p)^{n-k}$
with respect to p?
 A: I believe you can use the fact that $\displaystyle \dfrac{\text{d}}{\text{d}p} \sum \left( \dots \right) = \sum \dfrac{\text{d}}{\text{d}p} \left( \dots \right) $. $$ \begin{aligned} \dfrac{\text{d}}{\text{d}p} \sum_{k=0}^{n} p^k (1-p)^{n-k} & = \sum_{k=0}^{n} \dfrac{\text{d}}{\text{d}p} \left( p^k (1-p)^{n-k} \right) \\ & = \sum_{k=0}^{n} \left( kp^{k-1}(1-p)^{n-k} - (n-k)p^k (1-p)^{n-k-1} \right) \\ & = \sum_{k=0}^{n} p^{k-1} (1-p)^{n-k-1} \left( k(1-p) - (n-k)p \right) \\ & = \sum_{k=0}^{n} p^{k-1} (1-p)^{n-k-1} \left( k - np \right) \end{aligned} $$

 It might be handy knowing that if you were dealing with $\binom{n}{k}$ multiplied the summand, you'd indeed have $(p+(1-p))^n$ written out as a sum.

A: To flesh out my comment: the sum here can be evaluated explicitly using a (partial) geometric sum and then the resulting term can be differentiated explicitly.  More specifically, we have:
$$\begin{align}
\sum_{k=0}^np^k(1-p)^{n-k} &=\sum_{k=0}^np^k(1-p)^n(1-p)^{-k}\\
&=(1-p)^n\sum_{k=0}^np^k(1-p)^{-k}\\
&= (1-p)^n\sum_{k=0}^n\left(\frac{p}{1-p}\right)^k\\
&= (1-p)^n\frac{1-r^{n+1}}{1-r} &\ (r=\frac{p}{1-p})\\
&=\frac{(1-p)^{n+1}-p^{n+1}}{(1-p)-p}
\end{align}
$$
and this form is straightforward to differentiate in terms of $p$.
