# Difference between revisions of "Arithmetico-geometric series"

An arithmetico-geometric series is the sum of consecutive terms in an arithmetico-geometric sequence defined as: $x_n=a_ng_n$, where $a_n$ and $g_n$ are the $n$th terms of arithmetic and geometric sequences, respectively.

## Finite Sum

The sum of the first n terms of an arithmetico-geometric sequence is $\frac{a_ng_{n+1}}{r-1}-\frac{x_1}{r-1}-\frac{d(g_{n+1}-g_2)}{(r-1)^2}$, where $d$ is the common difference of $a_n$ and $r$ is the common ratio of $g_n$. Or, $\frac{a_ng_{n+1}-x_1-drS_g}{r-1}$, where $S_g$ is the sum of the first $n$ terms of $g_n$.

Proof:

$x_n=(a_1+d(n-1))(g_1\cdot r^{n-1})$

Let $S_n$ represent the sum of the first n terms. $S_n=a_1g_1+(a_1+d)(g_1r)+(a_1+2d)(g_1r^2)+\ldots+(a_1+(n-1)d)(g_1r^{n-1})$

$S_n=a_1g_1+(a_1+dg_1)r+(a_1g_1+2dg_1)r^2+\ldots+(a_1g_1+(n-1)dg_1)r^{n-1}$

$rS_n=a_1g_1r+(a_1+dg_1)r^2+(a_1g_1+2dg_1)r^3+\ldots+(a_1g_1+(n-1)dg_1)r^{n}$

$rS_n-S_n=-a_1g_1-dg_1r-dg_1r^2-dg_1r^3-\ldots-dg_1r^{n-1}+(a_1g_1+(n-1)dg_1)r^n$

$S_n(r-1)=(a_1+(n-1)d)g_1r^n-a_1g_1-\frac{dg_1r(r^{n-1}-1)}{r-1}$

$S_n=\frac{(a_1+(n-1)d)g_1r^n}{r-1}-\frac{a_1g_1}{r-1}-\frac{dg_1r(r^{n-1}-1)}{(r-1)^2}=\frac{a_ng_{n+1}}{r-1}-\frac{x_1}{r-1}-\frac{d(g_{n+1}-g_2)}{(r-1)^2}$

## Infinite Sum

The sum of an infinite arithmetico-geometric sequence is $\frac{dg_2}{(1-r)^2}+\frac{x_1}{1-r}$, where $d$ is the common difference of $a_n$ and $r$ is the common difference of $g_n$ (|r|<1). Or, $\frac{drS_g+x_1}{1-r}$, where $S_g$ is the infinite sum of the $g_n$.

$S=a_1g_1+(a_1+d)(g_1r)+(a_1+2d)(g_1r^2)+\ldots$

$rS=a_1g_1r+(a_1+dg_1)r^2+(a_1g_1+2dg_1)r^3+.\,.\,.$

$rS-S=-a_1g_1-dg_1r-dg_1r^2-dg_1r^3-\ldots=-a_1g_1+\frac{dg_1r}{r-1}$

$S=\frac{dg_1r}{(r-1)^2}-\frac{a_1g_1}{r-1}=\frac{dg_2}{(r-1)^2}-\frac{x_1}{r-1}=\frac{dg_2}{(1-r)^2}+\frac{x_1}{1-r}$