Jensen gap for a real-valued random variable $X \geq 0$ For a real-valued random variable $X \geq 0$,
We have $1 - \frac{1}{1+E \left[x\right]} \geq E \left[ 1 - \frac{1}{1+x} \right]$ (Jensen's inequality).
We want to get a tight constant gap between $1 - \frac{1}{1+E \left[x\right]}$ and $E \left[ 1 - \frac{1}{1+x} \right]$, i.e., $ \lvert  1 - \frac{1}{1+E \left[x\right]} - E \left[ 1 - \frac{1}{1+x} \right] \rvert \leq \epsilon_0$.
Any hints for this inequality?
 A: Taylor expanding $\frac{1}{1+x}$ around $x = E[x]$ gives us
\begin{align*}
\text{Gap} &= \left|1 - \frac{1}{1+E[x]} - E\left[1 - \frac{1}{1+x}\right] \right| \\&= \left|E\left[\frac{1}{1+x}\right] - \frac{1}{1+E[x]} \right| \\
&= \left|\frac{1}{1+E[x]} - E\left[\frac{x - E[x]}{(1 + E[x])^2}\right] +  E\left[\frac{(x - E[x])^2}{(1 + E[x])^3}\right] - \cdots - \frac{1}{1+E[x]}\right| \\
&\le \frac{\text{Var}(x)}{(1 + E[x])^3}
\end{align*}
A: Let's rephrase the inequality as $|\mathbb E[\frac{1}{1+X}]-\frac{1}{1+\mathbb E[X]}|\le\varepsilon$, i.e. we look at $\varphi(x)=\frac{1}{1+x}$. Let $X_n\in\{0,n\}$ with $\mathbb P(X_n=n)=1/\sqrt{n}$, then we have $\mathbb E[\frac{1}{1+X}]-\frac{1}{1+\mathbb E[X]}=1-\frac{1}{\sqrt{n}}+\frac{1}{\sqrt{n}}\frac{1}{1+n}-\frac{1}{1+\sqrt{n}}$. Taking $n\rightarrow\infty$ shows that the gap tends to $1$. On the other hand, since $\varphi(x)$ is decreasing we have $0<\varphi\le 1$ and thereby $\mathbb E[\frac{1}{1+X}]-\frac{1}{1+\mathbb E[X]}<1$, whereas $\mathbb E[\varphi(X)]-\varphi(\mathbb E[X])\ge 0$ follows from Jensen's inequality, so the tight constant is $\varepsilon=1$. The above implies that the answer for a given expectation $\mathbb E[X]$ will still be trivial, given by $1-\varphi(\mathbb E[X])$. If the variance is additionally fixed, then an argument similar to the discussion of Hoeffding's inequality or this question can probably provide a non-trivial tight constant.
