Question: 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?

Answer: 
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$.
Using the variation of constants method. Assuming

$$
y\_n = A\_n(-7)^n+B\_n 2^n
$$

after substituting into the difference equation we have

$$
2(-7)^n(7A\_n-5A\_{n-1}+2A\_{n-2})-2^n 7(2B\_n+5B\_{n-1}-7B\_{n-2}-2) = 0
$$

so choosing now

$$
7A\_n-5A\_{n-1}+2A\_{n-2}=0\\
2B\_n+5B\_{n-1}-7B\_{n-2}=2
$$

we have after solving

$$
A\_n = C\_1\left(-\frac 27\right)^n+C\_2\\
B\_n = -\frac {1}{81}(2-9n)+\left(-\frac 72\right)^n C\_3+C\_4
$$

then choosing $C\_1=C\_2=C\_3=C\_4=0$ we have finally

$$
A\_n = 0\\
B\_n = -\frac {1}{81}(2-9n)
$$