TITLE: Closed form for $t_n = 6t_{n-1}-9t_{n-2}$ where $t_0 = 5$ and $t_1 = 9$
QUESTION [1 upvotes]: Consider the sequence defined by
  $$
\begin{cases}
t_0=5\\
t_1=9\\
t_n=6t_{n-1}-9t_{n-2} & \text{if }n\ge 2
\end{cases}
.$$
  Find a closed form for $t_n$.
Your response should be a formula in terms of $n$, and should not contain terms such as $t_n,$ $t_{n-1},$ and so on. Do not include $``t_n=\text{''}$ in your response.

I tried forming a sequence by taking some values for $n$ and finding $t_n$. Once that was done, I moved on to find some pattern between $n$ and $t_n$ but couldn't find any. Here's the sequence: 
$$\begin{array}{c || c *5{| c}}
n & 0 & 1 & 2 & 3 & 4 \\
\hline
t_n & 5 & 9 & 9 & -27 & -243 
\end{array}$$
What am I suppose to do?

REPLY [3 votes]: Another widely used approach is using generating functions, i.e.
$$f(x)=\sum\limits_{n=0}\color{red}{t_n}x^n=
5+9x+\sum\limits_{n=2}t_nx^n=
5+9x+\sum\limits_{n=2}\left(6t_{n-1}-9t_{n-2}\right)x^n=\\
5+9x+6x\left(\sum\limits_{n=2}t_{n-1}x^{n-1}\right)-9x^2\left(\sum\limits_{n=2}t_{n-2}x^{n-2}\right)=\\
5+9x+6x\left(\sum\limits_{n=1}t_{n}x^{n}\right)-9x^2\left(\sum\limits_{n=0}t_{n}x^{n}\right)=
5+9x+6x\left(f(x)-5\right)-9x^2f(x)$$
or 
$$f(x)=5+9x+6x\left(f(x)-5\right)-9x^2f(x) \iff \\
f(x)=\frac{5-21x}{1-6x+9x^2}=
\frac{5-21x}{(1-3x)^2}=
\frac{7}{1-3x}-\frac{2}{(1-3x)^2}=\\
7\left(\sum\limits_{n=0}3^nx^n\right)-2\left(\sum\limits_{n=0}(n+1)3^nx^n\right)=\\
\sum\limits_{n=0}\color{red}{\left(7-2(n+1)\right)3^n}x^n$$
and 
$$t_n=\left(5-2n\right)3^n$$
{"set_name": "stack_exchange", "score": 1, "question_id": 2902485}