Integral of the inverse of a "simple" sum $$\Large \int_{0}^{\infty} \left (\frac{1}{ \sum_{k=0}^{\infty} x^k} \right)~ dx$$
It seems like this converges to $\approx \frac{1}{2}$ but when I try to calculate this I get really stuck, and for no reason!
$$ \sum_{k=0}^{\infty} x^k = \frac{1}{1-x} $$
And so the integral becomes:
$$\large \int_{0}^{\infty} (1-x)~ dx = \text{Does not converge}$$
Even if I use the "regular" geometric progression sum $$ \frac{ 1 \cdot (x^n - 1)}{x-1} $$
Where $n \to \infty$ (number of "elements" in the progression) it seems to actually converge to $0$.
Why these $2$ tries failed? I don't get it... what is the correct way to find the value?
 A: You have to break it up into two cases: for $x \in (0,1)$, and $x \in (1,\infty)$. Then you have that
$$\int_0^\infty \frac{1}{\sum_{n=0}^\infty x^n} \, dx = \int_0^1 \frac{1}{\sum_{n=0}^\infty x^n} \, dx + \int_1^\infty \frac{1}{\sum_{n=0}^\infty x^n} \, dx$$
For the first one, we can use your approach to get that
$$\int_0^1 \frac{1}{\sum_{n=0}^\infty x^n} dx = \int_0^1 \frac{1}{1/(1-x)} dx = \int_0^1 (1-x) dx = x - \frac{x^2}{2} \bigg|_{x=0}^1 = \frac 1 2$$
This holds because (whenever $|x|<1$: note that it doesn't hold if $|x| \ge 1$!), then
$$\sum_{n=0}^\infty x^n = \frac{1}{1-x}$$
If $x > 1$, however, then $\sum_{n=0}^N x^n \to \infty \implies 1 / \sum_{n=0}^N x^n \to 0$, and so
$$\int_1^\infty \frac{1}{\sum_{n=0}^Nx^n} \, dx \stackrel{N \to \infty}{\longrightarrow} 0$$
though I think being able to do this limiting process requires additional justification (e.g. dominated convergence, perhaps?). But either way with that in mind, then we should be able to see that (if just intuitively), that the second integral should be $0$, and, overall, you get
$$\int_0^\infty \frac{1}{\sum_{n=0}^\infty x^n} \, dx = \frac 1 2$$
A: This is not exactly the most sensible approach to the problem but it does offer another way to get the solution and I'm a sucker for special functions. We have
$$
I=\int_0^1\lim_{n\to\infty}\frac{1-x}{1-x^n}\,\mathrm dx+\int_1^\infty\lim_{n\to\infty}\frac{1-x}{1-x^n}\,\mathrm dx.
$$
For $n\geq 0$ the integrand of the first integral is nonnegative and bounded above by one, which is integrable on $[0,1]$. Likewise, for $n\geq2$ the integrand of the second integral is nonnegative and bounded above by $(1+x+x^2)^{-1}$ which again is integrable on $[1,\infty)$; hence, by argument of dominated convergence
$$
I=\lim_{n\to\infty}\int_0^1\frac{1-x}{1-x^n}\,\mathrm dx+\lim_{n\to\infty}\int_1^\infty\frac{1-x}{1-x^n}\,\mathrm dx.
$$
Substituting $t=x^n$ and $t=x^{-n}$ into the first and second integral, respectively, we have from the integral representation of the harmonic numbers:
$$
I=\lim_{n\to\infty}\frac{1}{n}\left(H_{-1/n}-H_{1/n-1}+H_{2/n-1}-H_{-2/n}\right),
$$
which upon application of the functional identities and recurrence identities for $H_z$ simplifies to
$$
I=\lim_{n\to\infty}\frac{\pi}{n}(\cot(\pi/n)-\cot(2\pi/n))=\frac{1}{2}.
$$
A: The limit of the partial sums evaluates to different things depending on where in the domain of integration we are
$$\int_0^1 \lim_{n\to\infty}\frac{1-x}{1-x^n}\:dx + \int_1^\infty \lim_{n\to\infty}\frac{1-x}{1-x^n}\:dx = \int_0^1 1-x\:dx + \int_1^\infty 0\:dx = \frac{1}{2}$$
