I have this recursion $a_n = a_{n-2} +8n+2$.
$n\ge0 , a_0=0, a_1=1$.
The solution should look like this $a_n=d_n+b_n$ . Where $d_n$ is the solution for the homogeneous part and $b_n$ is for the the non-homogeneous. For $d_n$ I got
$d_n=\alpha\cdot1^n+\beta\cdot(-1)^n$
For $b_n$ is used this equation:$b_n=n^m\cdot q(n)\cdot s^n$
where $\deg(q_n)=\deg(8n+2)$
so $q_n=(An+B)$, $s=1$(from the recursion), $m=1$ (because $s(1)$ is $1$ times the root of the homogeneous part). At the end my $b_n=n\cdot(n+3)$ So $a_n=d_n+b_n$
$a_n=\alpha\cdot1^n+\beta\cdot(-1)^n+n(n+3)$
After calculating $α$ and $ß$: $α=-3/2, ß=3/2$.
So my final result is: $$a_n=-3/2\cdot1^n+3/2\cdot(-1)^n+n(n+3)$$
Is this correct?
The correct solution(because somebody can't scroll down where the solution is flagged, but can write a comment)
- $b_n=n(2n+5) = 2n^2+5n $
- $a_n=-3+3*(-1)^n+n*(2n+5)$
Since you are given $a_0$ and $a_1$ and you have found solutions $\alpha 1^n$ and $\beta (-1)^n$ for the homogeneous equation, I suspect you have mis-typed the recurrence relation and it is in fact the second order relation
$a_n = a_{n-2} + 8n +2$
In which case a solution to the non-homogeneous part is $a_n = 2n^2 + 5n$ and the general solution is
$a_n = \alpha + \beta (-1)^n +2n^2 + 5n$
You can find the values of $\alpha$ and $\beta$ from $a_0=0, a_1=1$.