Let us solve the recurrence relation an=an−1+n2, where a0=7.
The characteristic equation k−1=0 has the root k=1, and hence the general solutionis of the form:
an=C⋅1n+bn, where bn=n(an2+bn+c)=an3+bn2+cn.
It follows that
an3+bn2+cn=a(n−1)3+b(n−1)2+c(n−1)+n2.
For n=0 we get 0=−a+b−c, and hence a=b−c.
For n=1 we get a+b+c=1, and thus b−c+b+c=1, that is b=21. Therefore, a=21−c.
For n=−1 we get −a+b−c=−8a+4b−2c+1.
It follows that
c−21+21−c=8c−4+2−2c+1, and therefore 6c=1.
We conclude that c=61, a=21−61=31.
Consequently, the general solutionis of the form:
an=C+31n3+21n2+61n.
It follows that 7=a0=C, and we conclude that the particular solution is the following:
an=7+31n3+21n2+61n.
Comments