recurrence relation with variable coefficients

How to solve recurrence relation $y(n)= y(n-1)+ (n-1)y(n-2)$ where $n$ is a variable ? $y(n)$ is a $n$th term, $y(n-1)$ is $(n-1)$th term and $y(n-2)$ is $(n-2)$th term.


Solution 1:

Hint

Let $y_{0}=a,y_{1}=b$,and let $$f(x)=\sum_{n=0}^{\infty}y_{n}x^n$$ then we have $$y_{n}x^n=xy_{n-1}x^{n-1}+x^2(n-2)y_{n-2}x^{n-2}+y_{n-2}x^n$$ $$\Longrightarrow \sum_{n=2}^{\infty}y_{n}x^n=x\sum_{n=2}^{\infty}y_{n-1}x^{n-1}+x^2\sum_{n=2}^{\infty}(n-2)y_{n-2}x^{n-2}+x^2\sum_{n=2}^{\infty}y_{n-2}x^{n-2}$$ $$\Longrightarrow f(x)-a-bx=x[f(x)-a]+x^3f'(x)+x^2f(x)$$ so $$f'(x)+\dfrac{x^2+x-1}{x^3}f(x)=\dfrac{(a-b)x-a}{x^3}$$ so $$f(x)=e^{-\int\frac{x^2+x-1}{x^3}dx}\left(\int\dfrac{(a-b)x-a}{x^3}e^{\int\frac{x^2+x-1}{x^3}dx}dx+C\right)$$ then I think you can do it,even it's ugly