TITLE: Derivative of sum of powers
QUESTION [7 upvotes]: 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?

REPLY [2 votes]: 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$.