TITLE: Finding the sum $\frac{x}{x+1} + \frac{2x^2}{x^2+1} + \frac{4x^4}{x^4+1} + \cdots$
QUESTION [9 upvotes]: Suppose $|x| < 1$. Can you give any ideas on how to find the following sum?
$$
\frac{x}{x+1} + \frac{2x^2}{x^2+1} + \frac{4x^4}{x^4+1} + \frac{8x^8}{x^8+1} + \cdots
$$

REPLY [2 votes]: Evaluating $$\sum_{q\ge 0} \frac{2^q x^{2^q}}{1+x^{2^q}}$$
we obtain
$$\sum_{q\ge 0} 2^q \sum_{k\ge 0} (-1)^k x^{(k+1)2^q}
= \sum_{n\ge 1} x^n \sum_{2^q|n} 2^q (-1)^{n/2^q-1}.$$
Now observe that
$$\sum_{2^q|n} 2^q (-1)^{n/2^q-1}
= \sum_{p=0}^{v_2(n)} 2^p (-1)^{n/2^p-1}$$
where  $v_2(n)$ is  the  exponent of  the highest  power  of $2$  that
divides $n.$ This is
$$-\sum_{p=0}^{v_2(n)-1} 2^p + 2^{v_2(n)}
= - (2^{v_2(n)}-1) + 2^{v_2(n)} = 1.$$
because $n/2^p$ is even unless $p=v_2(n).$ 
(This also goes through when $n$ is odd and we have one value for $p$, namely zero.)
Hence the end result is
$$\sum_{n\ge 1} x^n  = \frac{x}{1-x}.$$