Integral inequality: Prove $\int_0^1 f\int_0^1 1/f \leq 1$ for a certain function $f$ Let $g$ be a piecewise smooth, zero average, function over $[0,1]$ such that $\min g^2>0$. I would like to show that
$$
\int_0^1 g\sqrt{1-r/g^2}\int_0^1 \frac{1}{g\sqrt{1-r/g^2}} \leq 1
$$
for all $r \in \mathopen[-1,\min g^2\mathclose[$. I don't know that this is true but I am persuaded that it is, based on intuition (see motivation below), numerical tests and on a couple of, admittedly trivial, particular cases (e.g., $g^2$ is constant).
If it helps: note that second integral is almost the derivative of the first with respect to $r$.
Also, one could rescale $g$ to get rid of $r$. Say $0<r<\min g^2$. Let $g_r=g/\sqrt{r}$ so that $\min g_r^2>1$. Then, we're after
$$
\int_0^1 g_r\sqrt{1-1/g_r^2}\int_0^1 \frac{1}{g_r\sqrt{1-1/g_r^2}} \leq 1.
$$
We should be able to do something similar for $r<0$.
I am aware of an inequality $E(X)E(1/X)\geq 1$ for $X$ positive. Here, $g$ has zero average meaning it can't be positive.
Motivation: I am trying to show that a certain linkage (something like a carpenter's ruler) grows in span. The problem boils down to the above inequality. With that in mind, I've tried to apply something like Cauchy's arm lemma, to no avail.
The question is cross-posted.
For future generations: Inequality disproven thanks to @fedja's answer. To construct a counter example consider the case where $g$ takes three values $g_{1,2,3}$ over three intervals of lengths $p_{1,2,3}$. Suppose $g_{1,2}>0$ and $g_3<0$. This case is enough by @Iosif's observation. Also, let $f=\sqrt{g^2-1}$. Now consider the limit $p_1\to 0$, $g_1\to 1$. To disprove the inequality, we would also like for $p_1/f_1$ to go to infinity. Thus, take $g_1=1+p_1^3$ for instance. Then, the inequality reads, to leading order, $(p_2f_2-p_3f_3)p_1/f_1<1$. Disproving the inequality amounts to finding $p_{2,3}$ and $g_{2,3}$ such that $p_2+p_3=1$ and $p_2g_2+p_3g_3=0$ and such that $p_2f_2-p_3f_3>0$. It suffices to take $g_2>-g_3>1$ and $p_2=-g_3/(g_2-g_3)$ and $p_3=g_2/(g_2-g_3)$. For instance, $g_2=3$, $g_3=-2$, $p_1=0.004$ appear to do the trick.
 A: Matematika, shmatematika: any minimally decent CAS should immediately detect and tell the human operator that, for $r=1$, the inequality reads
$$
(\int_X F-\int_Y G)(\int_X 1/F-\int_Y 1/G)\le 1
$$
where $F=\sqrt{f^2-1}, G=\sqrt{g^2-1}$, $f,g> 1$, $\mu(X)+\mu(Y)=1$, and $\int_X f=\int_Y g$. Now it becomes obvious that the inequality can easily fail: Take any $f,g$ with the expression in the first parentheses not $0$. That first difference doesn't feel small moving of the distribution of $f$ or $g$ but the second one is extremely unstable: if you move a tiny portion of values of $f$ or $g$ sufficiently close to $1$ without changing the full integral, you can get arbitrarily large size and any sign you want.
The second part (negative r) is true and equally trivial:
Let $r=-1$ (scaling) and $F=\sqrt{f^2+1}, G=\sqrt{g^2+1}$. Then
$|F-f|,|G-g|\le 1$, so the first difference is at most $\mu(X)+\mu(Y)=1$ in absolute value (after subtracting integrals of $f$ and $g$ that compensate each other) and the second one is trivially bounded by the same quantity (since the denominators are at least $1$). So we get the bound $1$ for the absolute value of the product.
I would love to see an intelligent computer program for solving elementary inequalities and do not see any principal obstacles to creating it and even have some ideas about how this task could be possibly accomplished, but, alas, what is around is still nowhere close :-(.
A: The inequality in question is equivalent to the following:
$$L(X):=Ef(X)\,E\frac1{f(X)}\le1,$$
where
$$f(x):=x\sqrt{1-r/x^2}$$
and $X$ is a random variable (r.v.) such that $X^2>r$ and $EX=0$. By approximation, without loss of generality (wlog) $X$ takes only finitely many values $x$, and these values are such that $x^2>r$.
Fix any such finite set, say $S$, of values of $X$. Fix also any possible value (say $c$) of $Ef(X)$. Note that replacing $X$ by $-X$ only flips the signs of $Ef(X)$ and $E\frac1{f(X)}$, and thus does not change the value of $L(X)$. So, wlog $c=Ef(X)\ge0$.
So, wlog $X$ is a maximizer of $E\frac1{f(X)}$ over all zero-mean r.v.'s $X$ with values in $S$ and with $Ef(X)=c$.
The expectations $E1$, $EX$, $Ef(X)$, and $E\frac1{f(X)}$ are affine functions of the distribution (say $P_X$) of $X$. So, wlog $P_X$ is an extreme point of the convex compact set, say $K_S$, of all zero-mean distributions $P$ supported on the finite set $S$ such that $\int f(x)\,P(dx)=c$. In in view of the three restrictions -- $\int 1\,P(dx)=1$, $\int x\,P(dx)=0$, and $\int f(x)\,P(dx)=c$ --
it is easy to see that any extreme point of $K_S$ is a zero-mean distribution supported on a set $\{u,v,w\}$ of cardinality $\le3$.
Such a distribution is determined by the set $\{u,v,w\}$ and the corresponding probabilities $p_u,p_v,p_w$. The restrictions $p_u+p_v+p_w=\int 1\,P(dx)=1$ and $u\, p_u+v\, p_v+w\, p_w=\int x\,P(dx)=0$ allow us to eliminate the variables $p_v$ and $p_w$, say. Also, by rescaling, wlog $r\in\{-1,1\}$. Also, wlog
$$\text{$u<0<v<w$ if $r=-1\quad$ and $\quad u<-1<0<1<v<w$ if $r=1$},\tag{1}\label{1}$$ with the condition
$$\frac v{v-u}\le p_u\le\frac w{w-u}\tag{2}\label{2}$$
to ensure that $p_v,p_w,p_u$ are $\ge0$.
So, wlog $L(X)$ is a certain algebraic expression $l(u,v,w,p_u)$ (in the four variables $u,v,w,p_u$), which we have to show to be $\le1$ given the algebraic conditions \eqref{1} and \eqref{2}. (Note also that $l(u,v,w,p_u)$ is a quadratic polynomial in $p_u$.)
This is a problem of real algebraic geometry, and all such problems can in principle be solved purely algorithmically. However, in this case the problem seems too complicated to allow such a complete solution in a reasonable time.
The case $r=-1$ seems much easier, though. In this case, for the coefficient (say $k$) of $p_u^2$ in the quadratic polynomial $l(u,v,w,p_u)$ in $p_u$, we have
$$(w-v)^2k=(v-u)^2+(w-u)^2+(w-v)^2 \\ 
+\left(\sqrt{\frac{1+u^2}{1+v^2}}
+\sqrt{\frac{1+v^2}{1+u^2}}\right) (w-u)(w-v) \\ 
-\left(\sqrt{\frac{1+u^2}{1+w^2}}+\sqrt{\frac{1+w^2}{1+u^2}}\right) (w-v)(v-u) \\ 
-\left(\sqrt{\frac{1+w^2}{1+v^2}}+\sqrt{\frac{1+v^2}{1+w^2}}\right) (v-u) (w-u), \tag{3}\label{3}$$
which seems positive, so that $l(u,v,w,p_u)$ is convex in $p_u$ and hence wlog $p_u=0$ or $p_u=\frac w{w-u}$, and in both of these cases the Mathematica command Reduce quickly verifies the inequality in question.
In all cases, numerical calculations suggest that the inequality in question is true.
Update: It has now been shown by Peter Mueller that the expression in \eqref{3} is indeed positive, which completes the proof for $r<0$.

Here are supporting calculations in Mathematica:


