# 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?
$\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.