Let $X$ be a random variable with a geometric distribution with parameter $p$.
Calculate $\Bbb E[1/(1+X)]$
I've looked at answers online but still do not understand how to solve this.
Specifically, I do not understand how to to get from $$\frac{p}{1-p} \sum_{x=0}^\infty (1/(1+x))((1-p)^x+1)$$ to $-p\ln(p) /(1-p)$.
Assuming that $X\in \{0, 1, \ldots\}$ is the geometric distribution counting failures before a first success.
Use the fact that $\mathsf E(g(X)) = \sum_x g(x)\;\mathsf P(X=x)$
$$\begin{align} \mathsf P(X=x) & = p (1-p)^x \quad \mathbf 1_{x\in \{0, 1,2,\ldots\}} \\[2ex] \mathsf E\left(\frac 1{1+X}\right) & = \sum_{x=0}^\infty \; \frac 1{1+x} p(1-p)^x \\[1ex] & = \frac{p}{1-p} \sum_{k=1}^\infty \frac{(1-p)^k}{k} \end{align}$$
Then use the Taylor expansion: $$\ln (1+z) = \sum_{k=1}^\infty {(-1)}^{k-1}\frac{z^k}{k}$$