A functional integral inequality Suppose $f:I=(0,1)\to \mathbb R$ is a continuous function that satisfies
$$ \int_I f(t) e^{at}\,dt \geq 0\quad \text{for all $a \in \mathbb R$}.$$
Does it follow that $f\geq 0$ on $I$?
 A: The answer is no. E.g., take
$$f(t):=1-\frac{3}{2} \max \left(0,1-2 \left| t-\frac{1}{2}\right| \right).$$
Then $f(1/2)=-1/2<0$, but
$$ \int_0^1 f(t) e^{at}\,dt=
\frac{2 e^{a/2}}{a^2}\,\left(a \sinh\frac{a}{2}-3 \left(\cosh
   \frac{a}{2}-1\right)\right)\ge0$$
for all real $a$. (The inequality here follows from the inequality $u\sinh u\ge2(\cosh u-1)$ for $u\ge0$, which is easily checked by calculus.)
A: I don't think so. Roughly, the condition given should force $f$ to be nonnegative at least at around the endpoints $0$ and $1$, but it could be negative on the midpoint of the interval.
Consider a continuous function $g(t): [1/2, 1) \to \mathbb{R}$ such that $g$ satisfies the following properties.

*

*$g(1/2) < 0$ and $g(1/2 + \epsilon) = 0$ for some small $\epsilon > 0$.

*$g$ is negative on $(1/2, 1/2 + \epsilon)$ and nonnegative on $[1/2 + \epsilon, 1)$.

*$\int_{1/2 + \epsilon}^1 g(t) dt + 2 \int_{1/2}^{1/2 + \epsilon} g(t) dt > 0$.

Now define $f(t)$ to be equal to $g(t)$ on $[1/2, 1)$ and $g(1-t)$ on $(0,1/2]$.
If $a \geq 0$, then
\begin{align*}
\int_0^1 f(t)e^{at} dt &\geq \int_{1/2+\epsilon}^1 g(t)e^{at} dt + \int_{1/2}^{1/2+\epsilon} g(t)e^{at} dt + \int_{1/2 - \epsilon}^{1/2} g(1-t)e^{at}dt \\
&\geq e^{a(1/2+\epsilon)}(\int_{1/2+\epsilon}^1 g(t) dt + \int_{1/2}^{1/2+\epsilon} g(t) dt) + e^{a/2} \int_{1/2}^{1/2 + \epsilon} g(t) dt \\
&\geq e^{a/2}(\int_{1/2+\epsilon}^1 g(t)dt + 2\int_{1/2}^{1/2+\epsilon}g(t) dt) \\
&> 0.
\end{align*}
The first inequality just throws away the manifestly non-negative part
$$\int_0^{1/2 - \epsilon} f(t)e^{at} dt.$$
The second inequality replaces the $e^{at}$ term in each integral by its infimum or supremum on that interval, depending on whether $f$ is positive or negative on the interval.
If $a < 0$, then we reduce to the above estimate by using the symmetry $f(t) = f(1-t)$. Note that $e^{at} = e^{-a(1-t)} \cdot e^a$, so then we get
$$\int_0^1 f(t)e^{at} dt = e^a\int_0^1 f(1 - t) e^{-a(1-t)} dt = e^a \int_0^1 f(t) e^{-at} dt,$$
which is non-negative as well.
Note that by making $f(1/2)$ much less than zero and $\epsilon$ much smaller depending on the value of $f(1/2)$, this gives examples where $f$ is negative on a set of arbitrarily small measure in $I$ but takes on arbitrarily large negative values.
A: The answer is no. For instance, let $A$ and $B$ be any random variables with continuous density functions $g$ and $h$ supported on $[0,1]$ such that $g\ne h$ and $A$ dominates $B$ in terms of the convex stochastic ordering. E.g., it is enough that $g$ and $h$ be symmetric about $1/2$ and such that $g/h$ is increasing on $[1/2,1]$; in particular, $g(t)=4|t-1/2|$ and $h(t)=1$ for all $t\in[0,1]$ will do. Letting now $f:=g-h$ and noting that $\int_0^1 f=0$ and $f\ne0$, we see that $f(t)<0$ for some $t\in(0,1)$. On the other hand, since the exponential functions $t\mapsto e^{at}$ are convex, by the convex stochastic domination we have
$$\int_0^1 f(t)e^{at}\,dt=\int_0^1 g(t)e^{at}\,dt-\int_0^1 h(t)e^{at}\,dt=Ee^{aA}-Ee^{aB}\ge0$$
for all real $a$.
