Find the solution for the below recurrence relation with initial conditions $a_1=10$, $a_2=31$ $$ a_{n+2}=-2 a_{n+1}+8 a_n+4n^2\,. $$
Let us first consider the corresponding homogeneous recurrence relation $a_n = -2a_{n-1} + 8a_{n-2}$
The characteristic equation is $r^2 + 2r - 8 = (r + 4)(r - 2) = 0$
The characteristic equation has 2 distinct roots therefore the general solution is of the form $\alpha_1(-4)^n + \alpha_2(2^n)$
We also have that there is a Particular solution of the form $1^n(\mu_2 n^2 + \mu_1 n + \mu_0)$, as 1 is not a root of the characteristic equation.
$\mu_2 n^2 + \mu_1 n + \mu_0 = -2 (\mu_2 (n-1)^2 + \mu_1 (n-1) + \mu_0) + 8(\mu_2 (n-2)^2 + \mu_1 (n-2) + \mu_0) + 4(n-2)^2$
$\mu_2 n^2 + \mu_1 n + \mu_0 + 2 (\mu_2 (n-1)^2 + \mu_1 (n-1) + \mu_0) - 8(\mu_2 (n-2)^2 + \mu_1 (n-2) + \mu_0) - 4(n-2)^2 = 0$
$\mu_2 n^2 + \mu_1 n + \mu_0 + 2 (\mu_2 (n^2 - 2n + 1) + \mu_1 (n-1) + \mu_0) - 8(\mu_2 (n^2 - 4n + 4) + \mu_1 (n-2) + \mu_0) - 4(n-2)^2 = 0$
$\mu_2 n^2 + \mu_1 n + \mu_0 + 2 (\mu_2 n^2 - 2 \mu_2 n + \mu_2 + \mu_1 n - \mu_1 + \mu_0) - 8(\mu_2 n^2 - 4 \mu_2 n + 4 \mu_2 + \mu_1 n - 2\mu_1 + \mu_0) - 4(n^2 - 4n + 4) = 0$
$\mu_2 n^2 + \mu_1 n + \mu_0 + 2 \mu_2 n^2 - 2 \cdot 2\mu_2 n + 2 \mu_2 + 2 \mu_1 n - 2 \mu_1 + 2 \mu_0 - 8\mu_2 n^2 + 8 \cdot 4 \mu_2 n - 8 \cdot 4 \mu_2 - 8 \mu_1 n + 8 \cdot 2\mu_1 - 8\mu_0 - 4n^2 + 16n + -16 = 0$
$-5\mu_2 n^2 - 4n^2 - 5\mu_1 n +16n -5 \mu_0 + 28\mu_2 n + 14\mu_1 -30\mu_2 - 16 = 0$
$-n^2 (5\mu_2 + 4) + n(- 5\mu_1 + 28 \mu_2 + 16) + (14\mu_1 -30\mu_2 - 5\mu_0 -16) = 0$
Then I want to solve for $\mu_2, \mu_1, \mu$, and then find the values of $\alpha_1, \alpha_2$ using the initial conditions.
Am I correct Up to this point? I feel like I may be over complicating it somewhat, as so far I have not been able to find a correct solution.
The problem here is to find a particular solution.
Making $a_n = c_0+c_1 n+c_2 n^2$ and substituting into the recurrence we obtain the conditions
$$ \left\{ \begin{array}{rcl} -5 c_0+4 c_1+6 c_2 & = & 0\\ 8 c_2-5 c_1 & = & 0\\ 5 c_2+ 4 & = & 0 \\ \end{array} \right. $$
and solving we have
$$ c_0 = -\frac{248}{125},\ \ c_1 = -\frac{32}{25},\ \ c_2 = -\frac{4}{5} $$
The complete solution is
$$ a_n = (-4)^nC_1+2^nC_2-\frac{248}{125}-\frac{32}{25}n-\frac 45 n^2 $$
The constants $C_1, C_2$ can be obtained from the initial conditions.