Find the expression of the sequence $(a_n)$ that satisfies the recurrence relation $$a_n=5a_{n-1}-6a_{n-2}+2^n+9n^2+7n,$$ with the initial condition $a_0=0,\ a_1=4$.
My solution:
First, find the expression $b_n$ for the corresponding complementary recurrence relation $$b_n=5b_{n-1}-6b_{n-2}.$$ The expression can be easily solved as $$b_n=q_1\cdot2^n+q_2\cdot3^n.$$
Second, we assume the particular solution $p_n$ is in the form as $$p_n=cn\cdot 2^n+dn^2+en+h$$
Plug this into the original recurrence relation, and we obtain $$\begin{aligned} cn\cdot 2^n+dn^2+en+h&=5(c(n-1)\cdot 2^{n-1}+d(n-1)^2+e(n-1)+h)\\ &\quad -6(c(n-2)\cdot 2^{n-2}+d(n-2)^2+e(n-2)+h)+2^n+9n^2+7n\\ &=(cn+\frac{c}{2}+1)\cdot 2^n+(9-d)\cdot n^2+(7+14d-e)\cdot n+7e-19d-h \end{aligned}$$
Then, we can solve the particular solution. Combining the initial condition, we can determine all the coefficients, and obtain the final answer.
Here is my problem:
The manipulation and simplification of the part between the two shadowed lines are extremely complicated, which took me about 6 minutes to get this result. During exams, 6 minutes are very precious, and I don't want to waste so much time doing tedious calculation, which may give me a wrong answer. Therefore, is there any way to avoid such tedious calculation, or any trick to ease the process of finding a particular solution?