<s>[INST] How to derive the closed form of this recurrence? For the recurrence, $T(n) = 3T(n-1)-2$, where $T(0)= 5$, I found the closed form to be $4\cdot 3^n +1$(with help of Wolfram Alpha). Now I am trying to figure it out for myself. So far, I have worked out: $T(n-1) = 3T(n-2)-2, T(n-2) = 3T(n-3)-2, T(n-3) = 3T(n-4)-2$ leading me to: $T(n)=81\cdot T(n-4)-54-18-6-2 $ etc. I have noticed the constants follow a Geometric Series whose sum is given by $1-3^n$. I am having trouble putting this together to end up with the final closed form.
 [/INST] There are many ways to solve such linear recurrences. We describe one of them. 
Let the $n$-th term be $T_n$. We are told that
$$T_n=3T_{n-1}-2.$$
It would be nice to get rid of the constant term $-2$. Let $T_n=U_n+d$, where we will choose $d$ soon. Then
$$U_n+d=3(U_{n-1}+d)-2.$$
The constant term disappears if we choose $d=1$, and we obtain the recurrence
$$U_n=3U_{n-1}.$$
Since $T_0=5$, it follows that $U_0=4$, and therefore $U_n=4\cdot 3^n$. It follows that $T_n=4\cdot 3^n+1$. 
Remark: We analyze along your lines. We have $T_n=3T_{n-1}-2$. Thus $$T_n=3(3T_{n-2}-2)-2=3^2T_{n-2}-3.\cdot 2-2.$$ Substituting again, we get $$T_n=3^3T_{n-2}-3^2\cdot 2-3\cdot 2-2,$$ and then 
$$T_n=3^4T_{n-4}-3^3\cdot 2-3^2\cdot 2-3\cdot 2-2,$$ and so on. Ultimately, we end up with
$$T_n=3^nT_0 -2(1+3+3^2+\cdots +3^{n-1}).$$
The sum of the geometric series $1+3+\cdot +3^{n-1}$ is $\frac{3^n-1}{3-1}$.
Using the fact that $T_0=5$, we find that
$$T_n=3^n \cdot 5-(3^n-1)=4\cdot3^n+1.$$
</s>