Given $T(n) = \sum_{i = 0}^{\log n} i 2^i$, what is $O(T(n))$?
There are two ways to calculate the sum. The first way is to write it as $$\sum_{i=1}^{\log n} \sum_{k=1}^{i}2^{i}.$$

You change the order of sum and the calculation is the sum of geometric series.

Another way is to write it as $f(x)=\sum_{i=1}^{\log n} x^{i}$, and find the $xf`(x)|_{x=2}$, again a sum of geometric series.