# About solving a second order difference equation [duplicate]

Let $r>4$ be a positive integer. I want to solve this difference equation:

$$u_{n+1}-r²(1+r²ⁿ⁺¹)u_{n}+r²r²ⁿ⁺¹u_{n-1}-2r²r²ⁿ⁺¹=0$$ but I have no a good idea to start.

## marked as duplicate by Did, Johanna, user149792, dustin, user99914 Mar 2 '15 at 5:13

• Isn't this a minor variation on your previous question math.stackexchange.com/q/1138033 ? – Did Mar 1 '15 at 18:43
• @Did: Yes, but the method does not works well. – DER Mar 1 '15 at 18:44
• @Did: No, the two questions are different. – DER Mar 1 '15 at 18:45
• "Yes, but the method does not works well." ?? Which method? What are you talking about? Why didn't you mention the other question? – Did Mar 1 '15 at 18:45
• @Did: You can see the usual method of summation to reduce it to a first order equation does not works for this case. – DER Mar 1 '15 at 18:46

$$u_n = \left(r^2 + r^{2n+1}\right) u_{n-1} - \left( r^{2n+1} \right) u_{n-2} + 2r^{2n+1}$$
using Sympy and found a general solution in terms of $u_0$ and $u_1$.
$$u_n = u_1\, r^{f(n)} + \sum_{k=0}^{n-2} \left[ \left( 2k+2-u_0 \right) r^3 + u_1 \right] r^{f(n)-g(k)} \\ \; \\ \begin{array} ( &f(n) = n^2 + 2n - 3 \\ &g(k) = k^2 + 4k + 3\\ \end{array}$$
which can be proved by induction. However, unless you can simplify this further, it's not much more computationally useful than the recurrence. As an example, here is the expanded form of $u_{10}$ when $u_0=u_1=0$.
$$u_{10} = 2r^{117} + 4r^{112} + 6r^{105} + 8r^{96} + 10r^{85} + 12r^{72} + 14r^{57} + 16r^{40} + 18r^{21}$$