Justifying $\sum_{n=0}^\infty\log(1+x^{2^n}) = -\log(1-x)$ for $0\le x<1$

Question 2: how can one justify the first equal sign?

Note that for $x\in [0,1)$, we have

$$\begin{align} \left|\sum_{n=1}^N \log(1+x^{2^n})\right|&\le \sum_{n=1}^N\left|\log(1+x^{2^n})\right|\\\\ &\le \sum_{n=1}^N x^{2^n}\\\\ &\le \sum_{n=1}^N x^n\\\\ &=\frac{x-x^{N+1}}{1-x} \end{align}$$

Hence, for $x\in [0,1)$, the series $\sum_{n=1}^\infty \log(1+x^{2^n})$ converges absolutely.

Furthermore, we can write

$$\sum_{n=1}^N \log(1+x^{2^n})=\log\left(\prod_{n=1}^N (1+x^{2^n})\right)$$

and inasmuch as the logarithm is continuous,

$$\begin{align} \sum_{n=1}^\infty \log(1+x^{2^n})&=\lim_{N\to\infty }\log\left(\prod_{n=1}^N (1+x^{2^n})\right)\\\\ &=\log\left(\lim_{N\to\infty }\prod_{n=1}^N (1+x^{2^n})\right)\\\\ &=\log\left(\prod_{n=1}^\infty (1+x^{2^n})\right) \end{align}$$


The product $$ (1+x)(1+x^2)(1+x^4)\cdots(1+x^{2^N}) $$ is the sum of all the following terms $$ x^{\sum_{n=0}^N a_n 2^n} $$ where $a_n\in\{0,1\}$, $0\le n\le N$. But "due to the uniqueness of binary expansions of nonnegative integers", we know that the set $$ \{\sum_{n=0}^N a_n 2^n\mid a_n\in\{0,1\}\} $$ is exactly $\{0,1,2,\cdots, K\}$ where $$ K = 1+2+4+\cdots+2^N = 2^{N+1}-1 $$ Hence $$ (1+x)(1+x^2)(1+x^4)\cdots(1+x^{2^N})=\sum_{n=0}^K x^n\;. $$ Taking $N\to\infty$, we have equation (2).


In fact, to get equation (2), alternatively, we may define $$ a_N = \prod_{n=1}^N(1+x^{2^n})\;. $$ Then \begin{align} (1-x)a_N &= (1-x)(1+x)(1+x^2)\cdots(1+x^{2^N})\\ &= (1-x^2)(1+x^2)\cdots(1+x^{2^N})\\ &=\cdots\\ &= (1-x^{2^N})(1+x^{2^N})=(1-x^{2^{N+1}}) \end{align} Hence $(1-x)a_N\to 1$ as $N\to\infty$, and therefore have equation (2).


To show equation (3), note that for all $N$: $$ \sum_{n=0}^N\log(1+x^{2^n}) = \log \prod_{n=1}^N(1+x^{2^n})\tag{*} $$ Taking $N\to\infty$ and using the continuity of the function $\log x$ we have $$ \sum_{n=0}^\infty\log(1+x^{2^n}) = \log \prod_{n=1}^\infty(1+x^{2^n})\;. $$ Now apply equation (2) to get (3).


To elaborate on the last step: \begin{align} \lim_{N\to\infty}\sum_{n=0}^N\log(1+x^{2^n}) &= \lim_{N\to\infty}\log \prod_{n=1}^N(1+x^{2^n}) \quad &\text{by (*)}\\ &= \log \lim_{N\to\infty} \prod_{n=1}^N(1+x^{2^n}) \quad &\text{(by continuity)}\\ & = \log\frac{1}{1-x}\quad &\text{(by (2))} \end{align}