This question has been already solved here, I just want to figure out why I'm not being able to solve it using my method. Here's what I did -
$T(n)=2T(n-1)+n$
$T(n-1)=2T(n-2)+(n-1)$
$\therefore \,T(n)=2\{2T(n-2)+(n-1)\}+n$
$T(n)=4T(n-2)+3n-2$
$T(n-2)=2T(n-3)+(n-2)$
$\therefore T(n)=4\{2T(n-3)+(n-2)\}+3n-2$
$T(n)=8T(n-3)+7n-10$
$
\\.
\\.
\\.
\\T(n)=2^kT(n-k)+(2^k-1)n-c
\\\therefore T(n)=2^{n-1}T(1)+(2^{n-1}-1)n-c
\\T(n)=2^{n-1}+(2^{n-1}-1)n-c
$
This is where I'm stuck. I've seen other methods at the link above but I want to keep it simple by using induction. How should I proceed?
The answer is supposed to be : $2^{n+1}-n-2$