I'm struggling to solve $$y_n + 5y_{n-1} - 14y_{n-2} = 2^n$$
I've solved the first part: $${y_n}^{(h)} = A(-7)^n + B(2)^n$$
But struggling solving the particular solution.
I tried:
$${y_n}^{(p)} = Mk^n$$
$$Mk^n + 5(Mk^{n-1}) -14(Mk^{n-2}) = 2^n$$ $$\iff k^n(M+5Mk^{-1}-14Mk^{-2}) = 2 ^n$$ $$k = 2$$ $$M + \frac{5M}{2} - \frac{14M}{4} = 1 \iff 0 \ne 1$$ Next I tried with: $${y_n}^{(p)} = Mk^n \cdot n$$ $$Mk^n \cdot n + 5Mk^{n-1}(n - 1) - 14Mk^{n-2}(n-2) = 2^n$$ $$k^n(Mn + 5Mnk^{-1}-5Mk^{-1} -14Mnk^{-2} + 28Mk^{-2}) = 2^n$$ I don't know how to proceed from here. Can you help?
Your last line is $$k^n(Mn + 5Mnk^{-1}-5Mk^{-1} -14Mnk^{-2} + 28Mk^{-2}) = 2^n$$
As before, you have to take $k=2$.
Your equation can therefore be rewritten as $$ Mn(1+5/2-14/4)-5M/2+28M/4=1. $$ Since $1+5/2-14/4=0$, you see that the coefficient before $Mn$ is $0$ and there remains $-5M/2+28M/4=1$, hence $M=2/9$.