# Solving second order difference equations with non-constant coefficients

For the difference equation $$2ny_{n+2}+(n^2+1)y_{n+1}-(n+1)^2y_n=0$$ find one particular solution by guesswork and use reduction of order to deduce the general solution.

So I'm happy with second order difference equations with constant coefficients, but I have no idea how to find a solution to an example such as this, and I couldn't find anything useful through Google or in my text book.

EDIT: I copied the question wrong, answers make more sense now I realise that ..

• $$\left(n^2+1\right) = (n+1)^2-2n$$ that is just a guess. – Chinny84 Dec 17 '14 at 16:22
• Chinny's comment and user7530's hint implies $2ny_{n+2}+(n^2+1)y_{n+1}=(n+1)^2\implies 2n(y_{n+2}-1)=(n^2+1)(1-y_{n+1})$. You may find $\frac{y_{n+1}}{y_n}=f(n)$ – mike Dec 17 '14 at 16:30
• Should it not be $2ny_{n+2}+(n^2+1)y_{n+1}=(n+1)^2y_n$? I'm not sure I follow.. – user195486 Dec 17 '14 at 16:42

Let's look at the coefficients. We have $2n$, $n^2+1$, and $-(n+1)^2 = -n^2 - 2n - 1$. Do you notice anything particular about these three terms? Does that lead to the needed particular solution?

• Well, the sum of the coefficients is 0? Maybe I misunderstand, but I don't see how that leads to a solution..? – user195486 Dec 17 '14 at 16:33
• In order words if you multiply each coefficient by 1 and sum up, you get zero. Now look at your relation again. – user7530 Dec 17 '14 at 16:50

$\because$ sum of the coefficients of the difference equation is $0$

$\therefore$ The difference equation should have one group of linearly independent solutions that $y_n=\Theta(n)$ , where $\Theta(n)$ is an arbitrary periodic function with unit period.

But I don't know how can use the particular solution to deduce the general solution of the difference equation (maybe there are something like the difference equation version of reduction of order, but at least I don't know).

Hint: Write the equation as

$$2n(y_{n+2} - y_{n+1})= (n + 1)^2(y_{n} - y_{n+1})$$

or

$$2n A_{n+1} - (n+1)^2A_{n}$$

with solution

$$A_{n} = (n!)^2/ 2^{(n-1)}(n-1)!$$