<s>[INST] For a random variable $X$ such that $P(aI've worked on the following problem and have a solution (included below), but I would like to know if there are any other solutions to this problem, particularly more elegant solutions that apply well known inequalities that I've overlooked.
QUESTION: Suppose we have a random variable s.t. $P(a<X<b) =1$  where $0 < a < X < b$ , $a$ and $b$ both positive constants.
Show that $$E(X)E\left(\frac{1}{X}\right) \le \frac{(a+b)^2}{4ab}$$
Hint:  find constant c and d s.t. $\frac{1}{x} \le cx+d$ when $a<x<b$, and argue that then we shall have $E(\frac{1}{X}) \le cE(X)+d$
MY SOLUTION: For a line $cx+d$ that cuts through $\frac{1}{X}$ at the points $x=a$ and $x = b$, it's easy to show that $ c = - \frac{1}{ab} $  and $d = \frac{a+b}{ab} $, 
$$ E\left(\frac{1}{X}\right) \le - \frac{1}{ab} E(X) + \frac{a+b}{ab} $$  
$$ abE\left(\frac{1}{X}\right) + E(X) \le (a+b) $$
and because both sides of the inequality are positive, it follows that:
$$ \left(abE\left(\frac{1}{X}\right) + E(X)\right)^2 \le (a+b)^2 $$
$$ (ab)^2E\left(\frac{1}{X}\right)^2 + 2abE\left(\frac{1}{X}\right)E(X) + E(X)^2  \le (a+b)^2 $$ 
Now, for the LHS, we can see that 
$2abE\left(\frac{1}{X}\right)E(X) \le (ab)^2E\left(\frac{1}{X}\right)^2 + E(X)^2$ 
because  
$0 \le (ab)^2E\left(\frac{1}{X}\right)^2 - 2ab\,E\left(\frac{1}{X}\right)E(X) + E(X)^2 = \left(ab\,E\left(\frac{1}{X}\right) - E(X)\right)^2 $
So,
$$ 4ab\,E\left(\frac{1}{X}\right)E(X) \le (ab)^2E\left(\frac{1}{X}\right)^2 + 2ab\,E\left(\frac{1}{X}\right)E(X) + E(X)^2  \le (a+b)^2 $$
and therefore:
$$ E\left(\frac{1}{X}\right)E(X) \le \frac{(a+b)^2}{4ab} $$  Q.E.D.
Thanks for any additional solutions you might be able to provide.  Cheers!
 [/INST] For any number $x$ such that $0<a\le x\le b$, we have $x-a\ge0$ and $b-x\ge0$, so
$$ (x-a)(b-x)\ge0,$$
which rearranges into the equivalent form
$$ {ab\over x} + x\le a+b,\tag{1}$$
which is the inequality you obtained earlier. You can slickify the rest of your proof as follows. Let $X$ be a random variable with $0<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 positive. Then
$$4abE(1/X)E(X) = 4mn=(m+n)^2-(m-n)^2\le(m+n)^2\le(a+b)^2.$$
</s>