I need to solve this equation. I know how to solve the homogeneous side, but when I get to the non-homogeneous it becomes a problem.
$$ a_n = 7a_{n-1}- 10a_{n-2}+5^n-6$$
So far I have this
$$ a_n = 7a_{n-1}- 10a_{n-2}$$
$$ \frac{r^n}{r^{n-2}} = \frac{7r^{n-1}}{r^{n-2}}- \frac{10r^{n-2}}{r^{n-2}}$$
Then the characteristic equation for the homogeneous part is $$ r^2 = 7r - 10 $$ where $ r_1=2, r_2=5$.
So the homogeneous part is
$$ a_n^h=\alpha_1r_1^n + \alpha_2r_2^n = \alpha_1(2)^n+\alpha_2(5)^n$$
and I think the equation of the non-homogeneous part should be
$$ a_n^p = A(5^n)n+B$$
$$An(5^n)+B = 7(A(5^{n-1})(n-1)+B) -10(A(5^{n-2})(n-2)+B)$$
$$An(5^n)+B = 7(A(5^{n-1})(n-1))+7B-10(A(5^{n-2})(n-2))-10B$$
And I know there's a way to find $A$ and $B$ easily with like terms, but I don't know if I can use it here or how to use it.