# How do I go about solving various summation of binomial coefficients like $\sum_{r=0}^{n} \binom{n}{r}f(r)$

I've come across many problems that require me to find summation of binomial coefficients.

How go about solving these kind of summations of the form $$\sum_{r=0}^{n} \binom{n}{r}f(r)$$ where f(r) is some function

for starters how to do these

1. $$\sum_{r=0}^{n} \binom{n}{r}(r+1)$$

2. $$\sum_{r=0}^{n} \binom{n}{r}\frac{r^2}{3}$$

I remember someone using differentiation somewhere but I can't find where it was. So I thought this would be a good place where peiple can look

We know $(1+x)^n=\sum {n\choose r}x^r1^{n-r}$ differentiating with respect to $x$ we have $n (1+x)^{n-1}=\sum r {n\choose r}x^{r-1}(1)$putting $x=1$ we have $n2^{n-1}=\sum r {n\choose r}$ if you differentiate first expression twice you can find answer to your second query.

Hint:

$$(r+1)\binom nr=r\binom nr+\binom nr$$

$$r^2\binom nr=r(r-1)\binom nr+r\binom nr$$

Now for $r>0,$ $$\displaystyle r\binom nr=\cdots=n\binom{n-1}{r-1}$$

Now for $r>1,$ $$r(r-1)\binom nr=\cdots=n(n-1)\binom{n-2}{r-2}$$

Now set $m=n,n-1,n-2$ in $$(1+1)^m=\sum_{r=0}^m\binom mr$$

Use \begin{eqnarray*} (1+x)^n = \sum_{r=0}^n \binom{n}{r} x^r \end{eqnarray*} Differentiate and set $x=1$.

\begin{eqnarray*} \sum_{r=0}^n(r+1) \binom{n}{r} x^r \mid_{x=1} &=& \left( (1+x)^n +\frac{d}{dx} (1+x)^n \right)_{x=1} \\ &=& \left( (1+x)^n +n (1+x)^{n-1} \right)_{x=1} \\ &=& n2^{n-1}+2^n. \end{eqnarray*}

\begin{eqnarray*} \sum_{r=0}^n r \binom{n}{r} x^r &=& n x(1+x)^{n-1} \\ \end{eqnarray*} Differentiate again \begin{eqnarray*} \sum_{r=0}^n r^2 \binom{n}{r} x^{r-1} &=& n(n-1) x(1+x)^{n-2}+n (1+x)^{n-1} \\ \end{eqnarray*} Now set $x=1$ and we have \begin{eqnarray*} \sum_{r=0}^n \frac{r^2}{3} \binom{n}{r} &=& \frac{1}{3} \left(n(n-1) 2^{n-2}+n 2^{n-1}\right) \\ \end{eqnarray*}