I was reading the following http://www.cs.uiuc.edu/~jeffe/teaching/algorithms/notes/99-recurrences.pdf notes on recurrence relation, page 2.
A recurrence function for the Tower of Hanoi is given by $T(n) = 2T(n-1)+1$ with $T(0)=0$. Steps to find the closed form formula is shown but it is not clear.
Could someone show the steps to find the closed form of some equation, say $T(n) = 2T(n-1)+n$ with $T(0)=1$? The equation could be anything. I just want to learn the steps for it. Or any link to any article with such problem would also be much appreciated.
Dividing the equation by $2^n$ and letting $S_n=T_n/2^n$ we have $$ S_n=S_{n-1}+n/2^n $$ for all $n=1,2,3,...$. Putting $n=0,1,2, 3,... n$ and summing the result and using $T(0)=1$ we get the close form. (It is easy to find the sum $\sum_{k=0}^n k/2^k$).