# Is it sufficient to prove Jensen's Inequality holds for an example probability distribution to prove that a function is convex?

I wanted to use Jensen's Inequality to prove that $f(x)=xlog(x)$ is convex. I know how to do it by simply showing that the second derivative is positive, but I got stuck trying to prove it differently by showing that Jensen's Inequality always holds.

My solution was to use an arbitrary uniform distribution to show that the inequality holds in one case therefore it holds in all cases. Is this logic correct? In other words, if: $$E[f(X)]\geq fE[X]$$ And the equality holds for one distribution, does this imply it holds for all distributions thus proving $f(x)$ is convex?

• I expect that if you can show that Jensen's inequality holds for all uniform distributions, as you say, then you can show that it holds for a uniform distribution on $[x-\epsilon,x+\epsilon]$ for all $x$ and $\epsilon$, and in the limit as $\epsilon\to 0$ this should imply that $f''(x)\ge0$ for all $x$. However, this is a lot more work.
– user856
Feb 4, 2018 at 7:15
• However, it is certainly not sufficient to show that Jensen's inequality holds for one particular distribution. Consider $f(x)=\sin x$ and the uniform distribution on $[-\pi,\pi]$.
– user856
Feb 4, 2018 at 7:17

The theorem says the if $X$ is integrable and real valued, and $\phi$ a convex function then $E[\phi(X)] \geq \phi(E[X])$. Its not an equivalence only an implication, hence the inequality itself says nothing about convexity.