An enhanced Cauchy-Schwarz inequality of the integral form

We all know the very famous Cauchy-Schwaz inequality (of the integral form):

Let ff and gg be real functions continuous in [a,b][a,b]. Then the following equality holds:

(abf(x)g(x)dx)2ab(f(x))2dxab(g(x))2dx\left(\int_a^bf(x)g(x)\mathrm{d}x\right)^2\le\int_a^b(f(x))^2\mathrm{d}x\int_a^b(g(x))^2\mathrm{d}x

The purpose of this blog is to prove an enhanced version of this inequality, which is stated as follows:

Let f,gL2[a,b]f,g\in L^2[a,b], 0<mfM0<m\le f\le M, and abg(x)dx=0\int_a^bg(x)\mathrm{d}x=0. Prove that

(abf(x)g(x)dx)2(MmM+m)2ab(f(x))2dxab(g(x))2dx\left(\int_a^bf(x)g(x)\mathrm{d}x\right)^2\le\left(\frac{M-m}{M+m}\right)^2\int_a^b(f(x))^2\mathrm{d}x\int_a^b(g(x))^2\mathrm{d}x

Step 1: Substract kk from ff

From the vanilla C-S inequality, we know that if ff and gg are linear, i.e., f=kgf=kg, the equality holds. However in this problem, we know that there does not exist such kk that f=kgf=kg because f>0f>0 and gg has non-positive values in [a,b][a,b]. This suggests us that, to reach its minimum value as much as possible, we should manage to push ff to be as linear as gg as possible. To this end, we can substract a constant kk, from ff, so that ff and gg can hold the same sign at any given input x[a,b]x\in[a,b].

So what should we choose for kk. An intuitive choice is the average of ff, i.e., k=1baabf(x)dxk=\frac{1}{b-a}\int_a^bf(x)\mathrm{d}x, which lies within the minimum value mm and maximum value MM.

A more important property of substracting a constant number kk from ff is, it does not change the value of abf(x)g(x)dx\int_a^bf(x)g(x)\mathrm{d}x as abg(x)dx=0\int_a^bg(x)\mathrm{d}x=0 is given. Then it follows that:

(abf(x)g(x)dx)2=(ab(f(x)k)g(x)dx)2[abf(x)2dx1ba(abf(x)dx)2]abg(x)2dx\left(\int_a^bf(x)g(x)\mathrm{d}x\right)^2=\left(\int_a^b\left(f(x)-k\right)g(x)\mathrm{d}x\right)^2\le \left[\int_a^bf(x)^2\mathrm{d}x-\frac{1}{b-a}\left(\int_a^bf(x)\mathrm{d}x\right)^2\right]\int_a^bg(x)^2\mathrm{d}x

The last inequality applies the standard C-S inequality.

Now all we need to do is to prove that:

abf(x)2dx1ba(abf(x)dx)2(MmM+m)2abf(x)2dx\int_a^bf(x)^2\mathrm{d}x-\frac{1}{b-a}\left(\int_a^bf(x)\mathrm{d}x\right)^2\le \left(\frac{M-m}{M+m}\right)^2\int_a^bf(x)^2\mathrm{d}x

Step 2: Discriminant of a quadratic equation

Rearranging the above inequality, we have:

4Mm(ba)abf(x)2dx((M+m)abf(x)dx)24Mm(b-a)\int_a^bf(x)^2\mathrm{d}x\le \left((M+m)\int_a^bf(x)\mathrm{d}x\right)^2

It is clear that if we treat B=(M+m)abf(x)dxB=(M+m)\int_a^bf(x)\mathrm{d}x, A=abf(x)2dxA=\int_a^bf(x)^2\mathrm{d}x and C=Mm(ba)C=Mm(b-a), we obtain the discriminant of a quadratic equation:

B24AC0B^2-4AC\ge 0

We can construct such quadratic equation:

p(y)=(abf(x)2dx)y2+((M+m)abf(x)dx)y+Mm(ba)p(y)=\left(\int_a^bf(x)^2\mathrm{d}x\right) y^2+\left((M+m)\int_a^bf(x)\mathrm{d}x\right)y + Mm(b-a)

Then B24ACB^2-4AC is equivalent to fact that there exists at least one point on p(y)p(y) where p(y)0p(y)\le 0. The last of our work is to find such point.

Step 3: Find a point

The easiest way to find such point that the value of p(y)p(y) on that point is non-positive is by trying some common values. For example, when y=0y=0, p(0)=Mm(ba)>0p(0)=Mm(b-a)>0. When y=1y=1, we have:

p(1)=abf(x)2dx+(M+m)abf(x)dx+Mm(ba)=ab(f(x)2+(M+m)f(x)+Mm)dx=ab(f(x)+M)(f(x)+m)dxp(1)=\int_a^bf(x)^2\mathrm{d}x+(M+m)\int_a^bf(x)\mathrm{d}x + Mm(b-a)=\int_a^b\left(f(x)^2+\left(M+m\right)f(x)+Mm\right)\mathrm{d}x=\int_a^b(f(x)+M)(f(x)+m)\mathrm{d}x

It is a nice form but still not what we expect as the result is positive. However, if we change the sign of BB, that is to turn BB to B-B: B=(M+m)abf(x)dxB=-(M+m)\int_a^bf(x)\mathrm{d}x, the new p(1)p(1) will become:

p(1)=ab(f(x)M)(f(x)m)dx0p(1)=\int_a^b(f(x)-M)(f(x)-m)\mathrm{d}x\le 0

This is exactly what we want: a value on p(y)p(y) that is non-positive. Now p(y)p(y) is:

p(y)=(abf(x)2dx)y2((M+m)abf(x)dx)y+Mm(ba)p(y)=\left(\int_a^bf(x)^2\mathrm{d}x\right) y^2-\left((M+m)\int_a^bf(x)\mathrm{d}x\right)y + Mm(b-a)

and p(1)0p(1)\le 0 implies the discriminant B24AC0B^2-4AC\ge 0, which closes our proof.