<s>[INST] How to solve the non-homogeneous linear recurrence $ a_{n+1} - a_n = 2n+3 $, given that $a_0=1$? The problem: $ a_{n+1} - a_n = 2n+3 $, given that $a_0=1$
First I solved the associated homogeneous recurrence and got $a_n = A(1)^n = A$, where A is a constant, but I got stuck solving the rest. My final answer was $a_n=2n^2+n+1$ while my textbook has $a_n=n^2+2n+1$
Here is my work:
$ a_{n+1} - a_n = 2n+3 $
$pn=nd_1+d_2$ for all n
plug in and solve for $d_1$:
$(n+1)d_1+d_2-nd_1-d_2=2n+3$
$d_1=2n+3$
then solve for $d_2$:
$a_0=1=a_{n+1}-2n-3=(n+1)d_1+d_2-2n-3$
$d_2=1-n(2n+3)$
therefore
$p_n=nd_1+d_2 = 2n^2+n+4$ and $a_n=A+2n^2+n+4$
then solve for A:
$a_0=1=A +0+0+4$ so $A=-3$
therefore
$a_n=2n^2+n+1$
 [/INST] If $ a_{i+1} - a_i = 2i+3 $ then $\sum_{i=0}^{n-1}(a_{i+1} - a_i)=\sum_{i=0}^{n-1}(2i+3)$.
Observe that $\sum_{i=0}^{n-1}(a_{i+1} - a_i)=a_n-a_0$ and $\sum_{i=0}^{n-1}(2i+3)=n(n-1)+3n$.
Hence $a_n=1+n(n-1)+3n=(n+1)^2$.
</s>