Expanding $(2^b-1)\cdot(1+2^b+2^{2b}+ \cdots + 2^{(a-1)b})$ Can someone please explain to me how the following works (primarily interested in an explanation of the second step when $2^b$ is expanded?
I understand how each series cancels out to equal $2^n-1$ at the end.
$$\begin{align*}
xy&=(2^b-1) \cdot (1 + 2^b + 2^{2b} + \cdots + 2^{(a-1)b})\\
&=2^b \cdot (1 + 2^b + 2^{2b} + \cdots + 2^{(a-1)b}) - (1 + 2^b + 2^{2b} + \cdots + 2^{(a-1)b})\\
&=(2^b + 2^{2b} + 2^{3b} + \cdots + 2^{ab})-(1+2^b+2^{2b}+ \cdots + 2^{(a-1)b})\\
&=2^{ab}-1\\
&=2^n-1
\end{align*}$$
 A: You can perhaps understand this better if you set $t=2^b$, so your product becomes
$$
(t-1)(1+t+t^2+\dots+t^{a-1})
$$
Distribute:
$$
t(1+t+t^2+\dots+t^{a-1})-(1+t+t^2+\dots+t^{a-1})
$$
Push $t$ in the first term inside the parenthesis:
$$
(t+t^2+t^3+\dots+t^{a})-(1+t+t^2+\dots+t^{a-1})
$$
Regroup:
$$
\underbrace{(t+t^2+t^3+\dots+t^{a-1})+t^{a}}_{t+t^2+t^3+\dots+t^{a}}
\;
\underbrace{{}-1-(t+t^2+\dots+t^{a-1})}_{-(1+t+t^2+\dots+t^{a-1})}
$$
Cancel the opposite terms:
$$
t^a-1
$$
Substitute back $t=2^b$:
$$
(2^b)^a-1=2^{ab}-1
$$
Conclusion:
$$
(2^b-1)(1+2^b+2^{2b}+ \cdots + 2^{(a-1)b})=2^{ab}-1
$$
A: $$\begin{align*}
xy&=(2^b-1) \cdot (1 + 2^b + 2^{2b} + \cdots + 2^{(a-1)b})\\
&=2^b \cdot (1 + 2^b + 2^{2b} + \cdots + 2^{(a-1)b}) - (1 + 2^b + 2^{2b} + \cdots + 2^{(a-1)b})\\
&=(2^b + 2^{2b} + 2^{3b} + \cdots + 2^{ab})-(1+2^b+2^{2b}+ \cdots + 2^{(a-1)b})\\
&= \left[2^{ab} - 1\right] + \left[(2^b + 2^{2b} + \cdots + 2^{
(a-1)b})-(2^b+2^{2b}+ \cdots + 2^{(a-1)b}) \right]\\
&= 2^{ab} - 1 +(2^b - 2^b) + (2^{2b} - 2^{2b}) + \cdots \\
&=2^{ab}-1\\
&=2^n-1
\end{align*}$$
A: $\begin{align*}
xy&=(2^b-1) \cdot (1 + 2^b + 2^{2b} + \cdots + 2^{(a-1)b})\\
\end{align*}$
Let $A = (1 + 2^b + 2^{2b} + \cdots + 2^{(a-1)b})$ so
$xy = (2^b-1)A = 2^b*A - A$.  Let's continue... 
$\begin{align*}
&=2^b \cdot (1 + 2^b + 2^{2b} + \cdots + 2^{(a-1)b}) - (1 + 2^b + 2^{2b} + \cdots + 2^{(a-1)b})\\
\end{align*}$
Note: $2^b \cdot (1 + 2^b + 2^{2b} + \cdots + 2^{(a-1)b})=2^b*1 + 2^b2^b + ...+2^b2^{(a-1)b}$
$= 2^b +2^{2b} + .... + 2^{ab}$.  And that's pretty much all the detail I can think to provide.  Continue...
$\begin{align*}
&=(2^b + 2^{2b} + 2^{3b} + \cdots + 2^{ab})-(1+2^b+2^{2b}+ \cdots + 2^{(a-1)b})\\
&=2^{ab}-1\\
&=2^n-1
\end{align*}$
