Is $\int_{\mathbb{R}} |F(x)-G(x)|^2(f(x)-g(x))dx =0$ true, for $f,g$ probability densities and $F,G$ the corresponding distribution functions? I came across the following inequality while doing a problem. I guess it should be true, but I am not able to prove it. Here is the situation. Let $f$ and $g$ be two probability densities on $\mathbb{R}.$ Let $F$ and $G$ be the distribution function corresponding to $f$ and $g,$ respectively. I am looking at the following integral
$$I=\int\limits_{\mathbb{R}} |F(x)-G(x)|^2(f(x)-g(x))dx.$$
I guess that $I=0.$ The particular case I came across has further simplifications. For example, in my case, $g$ is uniform density on $[0, 1]$ and $f$ is a density supported on $[0, 1].$ The problem, in that case, reduces(?) to $$\int\limits_{0}^{1}|F(x)-x|^2(f(x)-1)dx=0.$$
Unfortunately, I could not come up with a proof. Any ideas?
 A: Integrating by parts gives
\begin{align*}
I&=\int_{\mathbb{R}} (F(x)-G(x))^2(f(x)-g(x))\,dx \\
&=(F(x)-G(x))^2 \bigg( \int (f(x)-g(x))\,dx \bigg) \bigg|_{-\infty}^\infty - \int_{\mathbb{R}} (F(x)-G(x)) \frac d{dx}\big( (F(x)-G(x))^2 \big) \,dx \\
&=(F(x)-G(x))^2 (F(x)-G(x)) \big|_{-\infty}^\infty - \int_{\mathbb{R}} (F(x)-G(x)) \cdot 2(F(x)-G(x))(f(x)-g(x) \big) \,dx \\
&=(0-0) - 2I
\end{align*}
and hence $I=0$. (The boundary term vanishes because $\lim_{x\to\infty} F(x) = \lim_{x\to\infty} G(x) = 1$ and $\lim_{x\to-\infty} F(x) = \lim_{x\to-\infty} G(x) = 0$.)
A: Let $H(x)=F(x)-G(x)$ and, to simplify notation, let $u(\infty)=\lim\limits_{x\to\infty}u(x)$ and $u(-\infty)=\lim\limits_{x\to-\infty}u(x)$.
Since $f(x)=F'(x)$ and $g(x)=G'(x)$, the integral can be written as
$$
\begin{align}
\int_{-\infty}^\infty H(x)^2\,\mathrm{d}H(x)
&=\frac13\left(H(\infty)^3-H(-\infty)^3\right)\\
&=0
\end{align}
$$
Since $F(\infty)=G(\infty)=1$ and $F(-\infty)=G(-\infty)=0$, we have $H(\infty)=H(-\infty)=0$.
