Expected value estimate. If we have $P(a< x<b)=1$, where $P$denotes probability,and$0<a<b$ then
$$E(X)E(\frac{1}{X})\le \frac{(a+b)^2}{4ab}$$
I have tried some trivial cases , uniform distribution and the case $P(x=a)=P(x=b)=\frac{1}{2}$, I found that in the later case we get the maximum value of right hand side of the inequality we wanted,or it’s the extreme case.（Although the case doesn’t satisfy the condition, I don’t know if it is useful or not.)
But I don’t know how to deal the general cases.
Even though the special case:the maximum value of the following functional.
$$\max_{\int_a^bf(x)dx=1}\int_a^b xf(x)dx\int_a^b\frac{1}{x}f(x)dx$$
Any suggestion will be appreciated.
 A: Firstly prove that for $Y$ s.t. $\mathbb P(0\leq Y\leq 1)=1$, $\mathop{\textrm{Var}}(Y)\leq \frac14$. 
Using $Y^2\leq Y$ we have
$$
\mathop{\textrm{Var}}(Y) = \mathop{\mathbb E}(Y^2) - \left(\mathop{\mathbb E}(Y)\right)^2\leq \mathop{\mathbb E}(Y) - \left(\mathop{\mathbb E}(Y)\right)^2 = x-x^2 \leq \frac14
$$
since the function $x-x^2$ takes its maximal value $\frac14$ at $x=\frac12$.
This allows us to bound the variances of $X$ and $\frac1X$: 
$$
\frac{X-a}{b-a}\in[0,1], \quad \frac{\frac1X-\frac1b}{\frac1a-\frac1b}\in[0,1],
$$
therefore
$$
\mathop{\textrm{Var}}(X) = (b-a)^2 \underbrace{\mathop{\textrm{Var}}\left(\frac{X-a}{b-a}\right)}_{\color{red}{\leq \frac14}}\leq \frac{(b-a)^2}{4}
$$
and
$$
\mathop{\textrm{Var}}\left(\frac1X\right) = \left(\frac1b-\frac1a\right)^2 \underbrace{\mathop{\textrm{Var}}\left(\frac{\frac1X-\frac1b}{\frac1a-\frac1b}\right)}_{\color{red}{\leq \frac14}}\leq \frac{(b-a)^2}{4a^2b^2}
$$
Finally use the Cauchy–Bunyakovsky–Schwarz inequality: 
$$
\left|\mathop{\textrm Cov}\left(X,\frac1X\right)\right|\leq \sqrt{\mathop{\textrm{Var}}(X)\cdot \mathop{\textrm{Var}}\left(\frac1X\right)}
$$
L.h.s. here is 
$$
\left|\mathop{\mathbb E}\left(X\cdot \frac1X\right)-\mathop{\mathbb E}\left(X\right)\mathop{\mathbb E}\left(\frac1X\right)\right|=\left|1-\mathop{\mathbb E}\left(X\right)\mathop{\mathbb E}\left(\frac1X\right)\right|
$$
We get 
$$
\mathop{\mathbb E}\left(X\right)\mathop{\mathbb E}\left(\frac1X\right) \leq 1+\sqrt{\mathop{\textrm{Var}}(X)\cdot \mathop{\textrm{Var}}\left(\frac1X\right)}\leq 1+ \sqrt{\frac{(b-a)^2}{4}\cdot \frac{(b-a)^2}{4a^2b^2}} = \frac{(a+b)^2}{4ab}.
$$
A: (The inequality requires the additional assumption $a\ge0$. Otherwise, taking $a=-2$ and $b=2$, the inequality would assert that $E(X) E(1/X)\le 0$ for any random variable $X$ satisfying $1\le X\le2$, which is wrong.)
For any number $x$ such that $0\le a\le x\le b$, we have $x-a\ge0$ and $b-x\ge0$, so
$(x-a)(b-x)\ge 0$,
which rearranges into the equivalent form
$$ {ab\over x} + x\le a+b.\tag{1}$$
Now let $X$ be a random variable with $0\le a\le X\le b$. Use $(1)$ to get:
$$m+n\le a+b,$$
where $m:=abE(1/X)$ and $n:=E(X)$ are both nonnegative. Then
$$4abE(1/X)E(X) = 4mn\le(m+n)^2\le(a+b)^2.$$
