Let $X$ be Geometric($p$). As an exercise from the book Probability Essentials, 2nd edition (Jacod, J., Protter, P., 2004, p.34), I have to compute $E[1/(1+X)]$. The answer is $\log((1-p)^{\frac{p}{1-p}})$ but I kept getting $\log(p^{\frac{p}{1-p}})$ or $\log(p^{-\frac{p}{1-p}})$. I don't see the mistake in my own calculation. One of my calculation can be seen below: $$ $$ We have \begin{align*} E\left[\frac{1}{1+X}\right] &= \sum_{j=0}^{\infty}\frac{1}{1+j}(1-p)^jp\\ &= p\sum_{j=0}^{\infty}\frac{1}{1+j}(1 - p)^j\\ &= \frac{p}{1-p}\sum_{j=0}^{\infty}\frac{1}{1+j}(1-p)^{j+1}\\ &= \frac{p}{1-p}\sum_{j=0}^{\infty}\int_0^{1 - p} t^j \ dt \end{align*} The infinite series $\sum_{j=0}^{\infty}t^j$ converges uniformly to $\frac{1}{1-t}$ since $|t| < 1$, so we can interchange the integral sign and the sum sign $$\frac{p}{1-p}\sum_{j=0}^{\infty}\int_0^{1 - p} t^j \ dt = \frac{p}{1-p}\int_0^{1-p}\sum_{j=0}^{\infty}t^j dt = \frac{p}{1-p}\int_0^{1-p}\frac{1}{1-t}\ dt.$$ This is equal to $$-\frac{p}{1-p}\log(p) = \log(p^{-\frac{p}{1-p}}).$$ So my questions are: could you please point out the mistake? and what should I do so I get the correct answer. Or maybe it is a mistake from the book?
Edit. This is the definition of the Geometric distribution that is used in Probability Essential: $X$ has a Geometric distribution with parameter $1 - p$: $$P(X = k) = (1-p)^kp, \ \ \ \ \ \ k = 0, 1, 2, 3, \dotsc$$
You are right. By series expansion of $\ln(1-x)$ for $x\in[-1,1)$, we directly have
\begin{align} \mathbb E\left[\frac1{1+X}\right]&=\frac p{1-p}\sum_{j=0}^\infty \frac{(1-p)^{1+j}}{1+j} \\&=-\frac p{1-p}\ln(1-(1-p)) \\&=\ln \left(p^{-p/(1-p)}\right) \end{align}
Alternatively,
\begin{align} \mathbb E\left[\frac1{1+X}\right]&=\mathbb E\left[\int_0^1 t^X\,dt\right] \\&\stackrel{(\star)}=\int_0^1 \mathbb E\left[t^X\right]dt \\&=p\int_0^1\frac{1}{1-(1-p)t}\,dt \\&=-\frac{p}{(1-p)}\ln p \\&=\ln \left(p^{-p/(1-p)}\right) \end{align}
Here the step $(\star)$ holds simply because of Fubini/Tonelli's theorem.