Is there any way to calculate the following sum:$G(n)=\sum_{i=0}^ni\cdot f(i)$?

84 Views Asked by At

Suppose we have some formula $f(x)$ and we are able to work out the sum of first $F(n)=\sum_{i=0}^nf(i)$ with some nice formula $F(n)$; Now suppose we want to work out tha following sum $G(n)=\sum_{i=0}^ni*f(i)$ Is there any way to work out / derive the $G(n)$ as some nice formula? Maybe the $G(n)$ would be based on formula $F(n)$?

Thank you

2

There are 2 best solutions below

4
On

Maybe Abel's partial summation may help here.

  • For any real numbers $a_1, \ldots , a_n, b_1 \ldots , b_n$ you have $$\sum_{i=1}^n a_ib_i = A_nb_n + \sum_{i=1}^{n-1} A_i(b_i-b_{i+1})$$ where $A_i = a_1 + \cdots + a_i$.

Now set $a_i =f(i)$ and $b_i = i$ and note that for $i=0$ you have $if(i)=0$, so counting starts from $i=1$. Using your notation you have $A_i = F(i) = f(1) + \cdots + f(i)$ and hence

$$G(n)=\sum_{i=1}^ni\cdot f(i) = nF(n)-\sum_{i=1}^{n-1} F(i)$$

0
On

You can write $$G(n)=(f(1)+f(2)+...+f(n))+(f(2)+f(3)+...+f(n))+(f(n-1)+f(n))+f(n)=\sum_{j=1}^n\sum_{i=j}^n f(i)=\sum_{j=1}^n (F(n)-F(j-1))=n\cdot F(n)-\sum_{j=0}^{n-1} F(j)$$