TITLE: Expected value estimate.
QUESTION [6 upvotes]: 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.

REPLY [2 votes]: (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.$$