Infinite series equality $\frac{1}{1+x}+\frac{2x}{1+x^2}+\frac{3x^2}{1+x^3}+\frac{4x^3}{1+x^4}+\cdots$ Prove the following equality ($|x|<1$).
$$\frac{1}{1+x}+\frac{2x}{1+x^2}+\frac{3x^2}{1+x^3}+\frac{4x^3}{1+x^4}+\cdots\\
=\frac{1}{1-x}+\frac{3x^2}{1-x^3}+\frac{5x^4}{1-x^5}+\frac{7x^6}{1-x^7}+\cdots\\$$

Multiplying $x$ to both sides, the identity is equivalent to
$$ \sum_{k=1}^{\infty} \frac{kx^k}{1+x^k} = \sum_{k=1}^{\infty} \frac{(2k-1)x^{2k-1}}{1-x^{2k-1}}. $$
Expanding and rearranging, each series can be written as
\begin{align*}
\sum_{k=1}^{\infty} \frac{kx^k}{1+x^k}
&= \sum_{k=1}^{\infty} \sum_{j=1}^{\infty} (-1)^{j-1} k x^{jk} = \sum_{n=1}^{\infty} \Bigg( \sum_{d|n} (-1)^{d-1}\frac{n}{d} \Bigg) x^{n} \\
\sum_{k=1}^{\infty} \frac{(2k-1)x^{2k-1}}{1-x^{2k-1}}
&= \sum_{k=1}^{\infty} \sum_{j=1}^{\infty} (2k-1)x^{j(2k-1)} = \sum_{n=1}^{\infty} \Bigg( \sum_{\substack{d | n \\ d \text{ odd}}} d \Bigg) x^{n}
\end{align*}
So it is sufficient to prove that
$$ \color{blue}{\sum_{d|n} (-1)^{d-1}\frac{n}{d} = \sum_{\substack{d | n \\ d \text{ odd}}} d} \quad \text{for } n = 1, 2, \cdots. \tag{1}$$
To this end, write $n = 2^e m$ for $e \geq 0$ and $m$ is odd. Then
$$ \sum_{d|n} (-1)^{d-1}\frac{n}{d}
= \sum_{d'|m} \underbrace{\sum_{i=0}^{e} (-1)^{2^i d'-1} 2^{e-i}}_{=1} \frac{m}{d'}
= \sum_{d'|m} \frac{m}{d'}
= \sum_{d|m} d
= \sum_{\substack{d | n \\ d \text{ odd}}} d $$
and hence $\text{(1)}$ is proved.
