Hello this is the solution of non hemogenous recursion ,are you agree with my solution:
[{a[n+2]-2a[n+1]+a[n]
n,a[0]1,a[1]2},a,n]
(r-1)^2 = 0 => r= 1
an(h) =c1 + nc2
an(p)=a0+a1n
an=c1+nc2+n^2
c1=1
c2=0 then an= 1+n^2
Thank you very much for your attention