Solve the recurrence $a_{n+2}=5a_{n+1}-9a_n+3n$? What is the simplest way to solve the recurrence $a_{n+2}=5a_{n+1}-9a_n+3n$, with the initial values $a_0=2,a_1=1$? Is it possible to do this with generating functions?

There're at least two four commonly used methods:


*

*generating functions

*looking for solutions in a particular form: $n^k\alpha^n$ with $k\in\mathbb N$ and $\alpha\in\Bbb R$.

*Z-transform. Thank you, @Omnomnomnom.

*The annihiliator method/characteristic equations (even though they are closely related to the second method). Thank you, @anorton.
The wikipedia article on recurrence relations can give you a couple of ideas.
