<s>[INST] Solve the following questions: Following are two questions and their respective answers(as given in textbook):
Q1. If $$ k=\sum_{r=0}^n \frac{1}{n \choose r}$$, then write $$\sum_{r=0}^n \frac{r}{n \choose r}$$ in terms of k.
Ans. $$\frac {nk}{2}$$
Q2. If $$x+y=1$$ find $$\sum_{r=0}^n r^{2} y^{n-r} x^r$$.
Ans. $$n(nx+y)$$
The thing is, I have tried solving both the problems, but that hasn't been much fruitful.
I faced difficulties from the first one as the expressions are sum of reciprocals of binomial coefficients. Because I never came across such reciprocals earlier.
The problem with the second is because of the two terms x and y. Had either x or y not been there, I could have easily differentiated $$ (1+x)^n$$ or $$ (1+y)^n$$ and their respective expansions and derived the result.
So, I would be thankful to anyone who provides a proper solution for each of the above problems.
Note: I wanted to add 'homework' tag, but wasn't allowed to do so.
 [/INST] For the second one, start with:
$\begin{align}
   \sum_{0 \le r \le n} x^r y^{n - r}
     &= y^n \sum_{0 \le r \le n} \left( \frac{x}{y} \right)^r \\
     &= y^n \frac{1 - (x/y)^{n + 1}}{1 - x/y} \\
     &= \frac{y^{n + 1} - x^{n + 1}}{y - x} \\
   x \frac{\mathrm{d}}{\mathrm{d} x}
     \left(
       x \frac{\mathrm{d}}{\mathrm{d} x}
           \frac{y^{n + 1} - x^{n + 1}}{y - x}
     \right)
     &= \sum_{0 \le r \le n} r^2 x^r y^{n - r} 
\end{align}$
The result is a quite ugly expression:
$\begin{align}
   &\frac{y^n (x^2 y + x y^2) 
           - (n + 1)^2 x^{n + 1} y^2
           + (2 n^2 + 2 n - 1) x^{n + 2} y 
           - n^2 x^{n + 3}}
        {(y - x)^3} \\
    &\qquad = \frac{y^{n + 1} x (x + y)
                     - x^{n + 1} 
                        ((n^2 + 2 n + 1) y^2
                          - (2 n^2 + 2 n - 1) x y
                          + n^2 x^2)}
                    {(y - x)^3} \\
    &\qquad = \frac{y^{n + 1} x (x + y)
                     - x^{n + 1} (y - x)
                         ((n + 1)^2 y - n^2 x)
                    }
                    {(y - x)^3} \\
    &\qquad = \frac{y^{n + 1} x
                     - x^{n + 1} (y - x)
                         ((n + 1)^2 y - n^2 x)
                    }
                    {(y - x)^3}
\end{align}$
Yes, it is fine to consider $x$ and $y$ as separate variables, as mentioned. The relation $x + y = 1$ can be used to simplify the end result, however.
</s>