TITLE: How to compute the sum $ 1+a(1+b)+a^2(1+b+b^2)+a^3(1+b+b^2+b^3)+\cdots$
QUESTION [6 upvotes]: Could it be possible to find the solution for the following series?    
$$ 1+a(1+b)+a^2(1+b+b^2)+a^3(1+b+b^2+b^3)+\cdots$$
Thanks in advance!

REPLY [2 votes]: You have $$\sum_{n=0}^\infty \left(a^n\sum_{m=0}^nb^m\right)\text{.}$$ Before determining what this converges to, it is worth establishing for which values of $(a,b)$ it converges at all. To that end, consider the Ratio Test:
$$\left\lvert\frac{a^{n+1}\sum_{m=0}^{n+1}b^m}{a^n\sum_{m=0}^nb^m}\right\rvert=\left\lvert a\left(1+\frac{b^{n+1}}{\sum_{m=0}^nb^m}\right)\right\rvert\to\begin{cases}\lvert ab\rvert&\lvert b\rvert>1\\\lvert a\rvert&\lvert b\rvert=1\\\lvert a\rvert&\lvert b\rvert<1\\\end{cases}$$
So it converges when:

$\lvert ab\rvert<1$ and $\lvert b\rvert>1$
$\lvert a\rvert<1$ and $\lvert b\rvert\leq1$

And diverges when:

$\lvert ab\rvert>1$ and $\lvert b\rvert>1$
$\lvert a\rvert>1$ and $\lvert b\rvert\leq1$

This test has been inconclusive when:

$\lvert ab\rvert=1$ and $\lvert b\rvert>1$
$\lvert a\rvert=1$ and $\lvert b\rvert\leq1$

Let's look at the last case first. If $\lvert a\rvert=1$, then you have $\sum_{n=0}^\infty {\pm_n\left(\sum_{m=0}^nb^m\right)}\text{.}$ The terms of such a series, $\pm_n\left(\sum_{m=0}^nb^m\right)$,  do not approach $0$ no matter what $b$ is. So your series will diverge. 
What if $\lvert b\rvert>1$ and $\lvert a\rvert=\frac{1}{\lvert b\rvert}$? Since $\lvert b\rvert>1$ we may write $\sum_{m=0}^nb^m=\frac{b^{n+1}-1}{b-1}$, and your series is $\sum_{n=0}^\infty {\pm_n\left(\frac{b^{n+1}-1}{b^n(b-1)}\right)}\text{.}$ Again using $\lvert b\rvert>1$, the terms of this series do not converge to $0$, so this series would be divergent. 
Now we know the only situations where your series converges are:

$\lvert ab\rvert<1$ and $\lvert b\rvert>1$ (which implies $\lvert a\rvert<1$)
$\lvert a\rvert<1$ and $\lvert b\rvert\leq1$ (which implies $\lvert ab\rvert<1$)

When $b\neq1$, both situations give:
$$\begin{align}
\sum_{n=0}^\infty \left(a^n\sum_{m=0}^nb^m\right)
&=\sum_{n=0}^\infty a^n\frac{1-b^{n+1}}{1-b}\\
&=\frac{1}{1-b}\left(\sum_{n=0}^\infty a^n-b\sum_{n=0}^\infty (ab)^n\right)\\
&=\frac{1}{1-b}\left(\frac{1}{1-a}-\frac{b}{1-ab}\right)\\
&=\frac{1}{(1-a)(1-ab)}\\
\end{align}$$
And when $b=1$ with $\lvert a\rvert<1$,
$$\begin{align}
\sum_{n=0}^\infty \left(a^n\sum_{m=0}^nb^m\right)
&=\sum_{n=0}^\infty (n+1)a^n\\
&=\left.\sum_{n=0}^\infty \frac{d}{dx}x^{n+1}\right|_{x=a}\\
&=\left.\frac{d}{dx}\sum_{n=0}^\infty x^{n+1}\right|_{x=a}\\
&=\left.\frac{d}{dx}\left(\frac{1}{1-x}-1\right)\right|_{x=a}\\
&=\left.\frac{1}{(1-x)^2}\right|_{x=a}\\
&=\frac{1}{(1-a)^2}\\
\end{align}$$
Which conveniently agrees with the formula $\frac{1}{(1-a)(1-ab)}$.