\(% Differentiation % https://tex.stackexchange.com/a/60546/ \newcommand{\Diff}{\mathop{}\!\mathrm{d}} \newcommand{\DiffFrac}[2]{\frac{\Diff #1}{\Diff #2}} \newcommand{\DiffOp}[1]{\frac{\Diff}{\Diff #1}} \newcommand{\Ndiff}[1]{\mathop{}\!\mathrm{d}^{#1}} \newcommand{\NdiffFrac}[3]{\frac{\Ndiff{#1} #2}{\Diff {#3}^{#1}}} \newcommand{\NdiffOp}[2]{\frac{\Ndiff{#1}}{\Diff {#2}^{#1}}} % Evaluation \newcommand{\LEvalAt}[2]{\left.#1\right\vert_{#2}} \newcommand{\SqEvalAt}[2]{\left[#1\right]_{#2}} % Epsilon & Phi \renewcommand{\epsilon}{\varepsilon} \renewcommand{\phi}{\varphi} % Sets \newcommand{\NN}{\mathbb{N}} \newcommand{\ZZ}{\mathbb{Z}} \newcommand{\QQ}{\mathbb{Q}} \newcommand{\RR}{\mathbb{R}} \newcommand{\CC}{\mathbb{C}} \newcommand{\PP}{\mathbb{P}} \renewcommand{\emptyset}{\varnothing} % Probabililty \DeclareMathOperator{\Cov}{Cov} \DeclareMathOperator{\Corr}{Corr} \DeclareMathOperator{\Var}{Var} \DeclareMathOperator{\Expt}{E} \DeclareMathOperator{\Prob}{P} % Distribution \DeclareMathOperator{\Binomial}{B} \DeclareMathOperator{\Poisson}{Po} \DeclareMathOperator{\Normal}{N} \DeclareMathOperator{\Exponential}{Exp} \DeclareMathOperator{\Geometric}{Geo} \DeclareMathOperator{\Uniform}{U} % Complex Numbers \DeclareMathOperator{\im}{Im} \DeclareMathOperator{\re}{Re} % Missing Trigonometric & Hyperbolic functions \DeclareMathOperator{\arccot}{arccot} \DeclareMathOperator{\arcsec}{arcsec} \DeclareMathOperator{\arccsc}{arccsc} \DeclareMathOperator{\sech}{sech} \DeclareMathOperator{\csch}{csch} \DeclareMathOperator{\arsinh}{arsinh} \DeclareMathOperator{\arcosh}{arcosh} \DeclareMathOperator{\artanh}{artanh} \DeclareMathOperator{\arcoth}{arcoth} \DeclareMathOperator{\arsech}{arsech} \DeclareMathOperator{\arcsch}{arcsch} % UK Notation \DeclareMathOperator{\cosec}{cosec} \DeclareMathOperator{\arccosec}{arccosec} \DeclareMathOperator{\cosech}{cosech} \DeclareMathOperator{\arcosech}{arcosech} % Paired Delimiters \DeclarePairedDelimiter{\ceil}{\lceil}{\rceil} \DeclarePairedDelimiter{\floor}{\lfloor}{\rfloor} \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} \DeclarePairedDelimiter{\ang}{\langle}{\rangle} % Vectors \newcommand{\vect}[1]{\mathbf{#1}} \newcommand{\bvect}[1]{\overrightarrow{#1}} % https://tex.stackexchange.com/a/28213 % \DeclareMathSymbol{\ii}{\mathalpha}{letters}{"10} % \DeclareMathSymbol{\jj}{\mathalpha}{letters}{"11} % \newcommand{\ihat}{\vect{\hat{\ii}}} % \newcommand{\jhat}{\vect{\hat{\jj}}} \newcommand{\ihat}{\textbf{\^{ı}}} \newcommand{\jhat}{\textbf{\^{ȷ}}} \newcommand{\khat}{\vect{\hat{k}}} % Other Functions \DeclareMathOperator{\sgn}{sgn} \DeclareMathOperator{\tr}{tr} % Other Math Symbols \DeclareMathOperator{\modulo}{mod} \newcommand{\divides}{\mid} \newcommand{\notdivides}{\nmid} \newcommand{\LHS}{\text{LHS}} \newcommand{\RHS}{\text{RHS}} \newcommand{\degree}{^{\circ}}\)
By the formula for difference of two squares, we have \begin {align*} (1 - x)(1 + x)(1 + x^2)(1 + x^4) \cdots (1 + x^{2^n}) & = (1 - x^2)(1 + x^2)(1 + x^4) \cdots (1 + x^{2^n}) \\ & = (1 - x^4)(1 + x^4) \cdots (1 + x^{2^n}) \\ & = \cdots \\ & = 1 - x^{2^{n + 1}}. \end {align*}
This means, \[ 1 = (1 - x)(1 + x)(1 + x^2)(1 + x^4) \cdots (1 + x^{2^n}) + x^{2^{n + 1}}, \] and dividing both sides by \(1 - x\) gives \[ \frac {1}{1 - x} = (1 + x)(1 + x^2)(1 + x^4) \cdots (1 + x^{2^n}) + \frac {x^{2^{n + 1}}}{1 - x}. \]
Rearranging and taking natural logs on both sides, we have \[ \ln (1 - x^{2^{n + 1}}) - \ln (1 - x) = \sum _{k = 0}^{n} \ln (1 + x^{2^{k}}), \] and therefore, \[ \ln (1 - x) = -\sum _{k = 0}^{n} \ln (1 + x^{2^{k}}) + \ln (1 - x^{2^{n + 1}}). \]
Let \(n \to \infty \). \(2^{n + 1} \to \infty \), and since \(\abs *{x} < 1\), we have \(x^{2^{n + 1}} \to 0\), and hence \[ \ln (1 - x) = -\sum _{k = 0}^{\infty } \ln (1 + x^{2^{k}}) + \ln (1) = -\sum _{k = 0}^{\infty } \ln (1 + x^{2^{k}}), \] as desired.
Differentiating both sides with respect to \(x\), we have \[ - \frac {1}{1 - x} = - \sum _{k = 0}^{\infty } \frac {2^k x^{2^k - 1}}{1 + x^{2^k}}, \] and hence \[ \frac {1}{1 - x} = \sum _{k = 0}^{\infty } \frac {2^k x^{2^k - 1}}{1 + x^{2^k}}, \] exactly as desired.
Notice that \begin {align*} & \phantom {=} (1 + x + x^2) (1 - x + x^2) (1 - x^2 + x^4) (1 - x^4 + x^8) \cdots (1 - x^{2^{n - 1}} + x^{2^n}) \\ & = ((1 + x^2)^2 - x^2) (1 - x^2 + x^4) (1 - x^4 + x^8) \cdots (1 - x^{2^{n - 1}} + x^{2^n}) \\ & = (1 + x^2 + x^4) (1 - x^2 + x^4) (1 - x^4 + x^8) \cdots (1 - x^{2^{n - 1}} + x^{2^n}) \\ & = ((1 + x^4)^2 - (x^2)^2) (1 - x^4 + x^8) \cdots (1 - x^{2^{n - 1}} + x^{2^n}) \\ & = (1 + x^4 + x^8)(1 - x^4 + x^8) \cdots (1 - x^{2^{n - 1}} + x^{2^n}) \\ & = \cdots \\ & = 1 + x^{2^n} + x^{2^{n + 1}}. \end {align*}
Therefore, \[ 1 = (1 + x + x^2) (1 - x + x^2) (1 - x^2 + x^4) (1 - x^4 + x^8) \cdots (1 - x^{2^{n - 1}} + x^{2^n}) - x^{2^n} - x^{2^{n + 1}}, \] and hence \[ \frac {1}{1 + x + x^2} = (1 - x + x^2) (1 - x^2 + x^4) (1 - x^4 + x^8) \cdots (1 - x^{2^{n - 1}} + x^{2^n}) - \frac {x^{2^n} + x^{2^{n + 1}}}{1 + x + x^2}. \]
Rearranging and taking natural logs on both sides, we have \[ \ln (1 + x^{2^n} + x^{2^{n + 1}}) - \ln (1 + x + x^2) = \sum _{k = 1}^{n} \ln (1 - x^{2^{k - 1}} + x^{2^k}), \] and hence \[ \ln (1 + x + x^2) = -\sum _{k = 1}^{n} \ln (1 - x^{2^{k - 1}} + x^{2^k}) + \ln (1 + x^{2^n} + x^{2^{n + 1}}). \]
Let \(n \to \infty \), we have \(2^n, 2^{n + 1} \to \infty \), and since \(\abs *{x} < 1\), we must have \(x^{2^n}, x^{2^{n + 1}} \to \infty \), and hence \(\ln (1 + x^{2^n} + x^{2^{n + 1}}) \to 0\). Hence, \[ \ln (1 + x + x^2) = - \sum _{k = 1}^{\infty } \ln (1 - x^{2^{k - 1}} + x^{2^k}). \]
Differentiating both sides with respect to \(x\), we get \[ \frac {1 + 2x}{1 + x + x^2} = - \sum _{k = 1}^{\infty } \frac {- 2^{k - 1} x^{2^{k - 1} - 1} + 2^{k} x^{2^{k} - 1} }{1 - x^{2^{k - 1}} + x^{2^k}} = \sum _{k = 1}^{\infty } \frac {2^{k - 1} x^{2^{k - 1} - 1} - 2^{k} x^{2^{k} - 1} }{1 - x^{2^{k - 1}} + x^{2^k}}, \] which is exactly what is desired.