<s>[INST] Solve non-homogeneous recurrence $x_{n+2} - 2x_{n+1} + x_n = 8$ I'm trying to solve this recurrence $x_{n+2} - 2x_{n+1} + x_n = 8$, but the solution of the homogeneous is $a_n=b+cn$, and I don't know how to change it to find the non-homogeneous solution.
 [/INST] $$x_{n+2} - 2x_{n+1} + x_n = 8\tag{1}$$
Set $n=n+1$
$$x_{n+3}-2x_{n+2}+x_{n+1}=8$$
Subtract the two equations
$$x_{n+3}-2x_{n+2}+x_{n+1}-x_{n+2} + 2x_{n+1} - x_n=0$$
$$x_{n+3}-3x_{n+2}+3x_{n+1}-x_n=0$$
Characteristic equation is
$$\lambda^3-3\lambda^2+3\lambda-1=0\to (\lambda-1)^3=0\to \lambda=1$$
and finally
$$x_n=an^2+bn+c\tag{2}$$

edit
from $(1)$ we get $x_0=8+2x_1-x_2$
from $(2)$ we have $x_0=c,\;x_1=a+b+c;\;x_2=4a+2b+c$
putting all together
$$\begin{cases}
c=8+2x_1-x_2\\
a+b+c=x_1\\
4a+2b+c=x_2\\
\end{cases}
$$
$$\begin{cases}
a+b+8+2x_1-x_2=x_1\to a+b=x_2-x_1-8\\
4a+2b+8+2x_1-x_2=x_2\to 4a+2b=2x_2-2x_1-8\\
\end{cases}
$$
$$\begin{cases}
a+b=x_2-x_1-8\\
2a+b=x_2-x_1-4\\
\end{cases}
$$
subtracting the two equations, we get $a=4$ so the $(2)$ becomes
$$x_n=4n^2+bn+c$$
</s>