I have this recurrence relation, $$a_{n+1}=\frac{n+2}{n}a_n$$ with $a_1=1$.
I've already solved this using a substitution approach by letting $a_n=\dfrac{(n+1)!}{(n-1)!}b_n$. This means $a_{n+1}=\dfrac{(n+2)!}{n!}b_{n+1}$, and so $$\begin{align*} \frac{(n+2)!}{n!}b_{n+1}&=\frac{n+2}{n}\frac{(n+1)!}{(n-1)!}b_n\\ b_{n+1}&=b_n\\ \sum_{n=1}^{k-1}(b_{n+1}-b_n)&=0\\ b_k&=b_1\\ b_k&=\frac{(1-1)!}{(1+1)!}a_1\\ b_k&=\frac{1}{2} \end{align*}$$ Finally, $a_n=\dfrac{n(n+1)}{2}$.
I'm wondering if there's a way to use generating functions to solve this relation? I've been having trouble working with the $\dfrac{2}{n}a_n$ term. Are there only certain cases of relations for which generating functions are useful?
Hint: Let $$ f(x)=\sum_{n=1}^\infty\frac{a_n}{n}x^n $$ Then, formally, $$ f'(x)=\sum_{n=1}^\infty a_nx^{n-1} $$ Now, consider $2xf(x)+x^2f'(x)$: $$ 2xf(x)+x^2f'(x)=2x\sum_{n=1}^\infty\frac{a_n}{n}x^n+x^2\sum_{n=1}^\infty a_nx^{n-1}=\sum_{n=1}^\infty \left(\frac{2a_n}{n}+a_n\right)x^{n+1} $$ Since $a_1=1$, we have $$ x+2xf(x)+x^2f'(x)=f(x) $$ so, one must solve the differential equation $$ x+2xy+x^2y'=y. $$ (This is assuming that I got my indices right).