Order Statistics with joint density I have an guess in a larger stochastic problem. I assume following:
Let $x,y$ be two variables, with $y<x$ and let $f(\cdot)$, $F(\cdot)$ be the a continous PDF and CDF with support $[0,z]$. I would like to know for which cases it holds that:
$$\int_0^{z} \int_0^{x} y f(x)f(y)\mathrm{d}y\mathrm{d}x=\int_0^{z}xf(x)(1-F(x))\mathrm{d}x,$$
with $z \in \mathbb{R}_{++}$
Ive tried to use differentation by parts, but assume that the solution has something to do with partial expectation. I know that I can rearrange the left hand-side, using Riemmann-Stieltje integral to:
$$\int_0^{z} \int_0^{x} y f(x)f(y)\mathrm{d}y\mathrm{d}x=\int_0^{z}f(x)\int_0^{x}(1-F(y))\mathrm{d}y\mathrm{d}xy-\int_0^{z}xf(x)(1-F(x))\mathrm{d}x$$
but here I'm stuck.
Im if I’m setting $f(\cdot)$ and $F(\cdot)$ as corresponding PDF and CDF of the uniform distribution $[0,1]$, and $z=1$, im getting the same values (1/6) on the lhs and rhs. Same holds for Beta distribution with random shape parameters, and Triangular distribution $[0,1]$ with random mode.
Does anybody has a clue?
 A: Under conditions I will describe, this is always true.
Let $X$ and $Y$ be iid random variables with common cdf $F$ and density function $f=F^\prime.$ Define $x = \max(X,Y),$ $y = \min(X,Y).$  The joint density of $(x,y)$ is
$$f_{x,y}(x,y)=2f(x)f(y)\mathcal{I}(y \lt x)$$
while the marginal density of $x$ is
$$f_x(x) = (F^2)^\prime(x) = 2 f(x)F(x).$$
Since $x+y=X+Y$ and $E[X]=E[Y],$ upon taking expectations we find
$$E[x] + E[y] = E[X] + E[Y] = 2E[X] .\tag{*}$$
Obtain the expectations in these three ways:
$$E[x] = \int x f_x(x)\,\mathrm{d}x = \int x (2f(x)F(x))\,\mathrm{d}x,$$
$$E[y] = \iint y f_{x,y}(x,y)\,\mathrm{d}y\mathrm{d}x = 2\iint_{y\lt x} y f(x)f(y)\,\mathrm{d}y\mathrm{d}x,$$
and
$$2E[X] =  2\int x f(x)\,\mathrm{d}x.$$
Subtracting $E[x]$ from both sides of $(*)$ and plugging in these three expressions gives
$$2\iint_{y\lt x}  y f(x)f(y)\,\mathrm{d}y\mathrm{d}x = 2\int x f(x)\,\mathrm{d}x - \int x (2f(x)F(x))\,\mathrm{d}x.$$
Dividing both sides by $2$ and combining the integrals on the right hand side yields
$$\iint_{y\lt x} y f(x)f(y)\,\mathrm{d}y\mathrm{d}x = \int x f(x)(1-F(x)) \,\mathrm{d}x,$$
QED.
