<s>[INST] Solve the recurrence relation $y_{n+2}+2y_{n+1}+2y_n=n^3.$ First I solved the characteristic equation $r^2+2r+2=0$ with $r_1=-1+i$ and $r_2=-1-i.$ In polar form this becomes $r_{1,2}=\sqrt{2}e^{\pm i3\pi/4},$ thus the general solution to the homogenous equation is $$y_h=\sqrt{2}^n\left(A\cos{\frac{3\pi}{4}n}+B\sin{\frac{3\pi}{4}n}\right).$$
Since $r_1\neq 1$ and $r_2\neq 1$, for the particular solution I can use the ansatz $y_n^{p}=an^3+bn^2+cn+d.$ I have that
$$y_{n+2}+2y_{n+1}+2y_n=a(n+2)^3+b(n+2)^2+c(n+2)+d+2(a(n+1)^3+b(n+1)^2+c(n+1)+d)+2(an^3+bn^2+cn+d) \\ = 5an^3+(12a+5b)n^2+(18a+8b+5c)n+10a+6b+4c+5d.$$
I simplified this with a computer, it feels tedious and because of that, and that my constants become quite small (for example $d=86/625$), I think my ansatz is wrong.
Can someone confirm that my ansatz is wrong and tell me what the proper one should be?
 [/INST] You might do better to choose $n+1, n, n-1$ which simplifies the arithmetic and promises more cancellation. Also you might organise the computation so that you get $$(n-1)^3=a\left((n+1)^3+2n^3+2(n-1)^3\right)+b\left((n+1)^2+2n^2+2(n-1)^2\right)+c\left((n+1)+2n+2(n-1)\right)+5d=$$$$=5an^3+(-3a+5b)n^2+(8a-4b+5c)n+(-a+3b-c+5d)$$
From which $5a=1$ 
$5b-3a=-3$ so that (multiply by $5$) we have $25b=-12$
Also $8a-4b+5c=2$ (multiply by $25$)  $125c=50-40-4=6$
And $-a+2b-c+5d=-1$ (multiply by $125$) $625d=-125+25+180+6=86$

Note for future reference that the fractions are predictable from $1+2+2=5$ so that the new term (as you run down the coefficients) is always multiplied by $5$.
</s>