Integral of a CDF I'm solving a problem where I've this 'expectation':
$$ \int_{0}^y x\cdot f(x) dx $$
where $f(x)$ is a PDF with support on $[0, z]$, with $z>y$. Is there a way to rewrite it without the integral and as a function of the CDF? I've tried integration by parts, but without great success:
$$ \int_{0}^y x\cdot f(x) dx = y\cdot F(y) -\int_0^y F(x) dx $$
I have hard time to solve the second part.
 A: For cdfs $F$ of distributions with supports on $(0,a)$, $a$ being possibly $+\infty$, a  useful representation of the expectation is
$$\mathbb{E}_F[X]=\int_0^a x \text{d}F(x)=\int_0^a \{1-F(x)\}\text{d}x$$
by applying integration by parts,
\begin{align*}\int_0^a x \text{d}F(x)&=-\int_0^a x \text{d}(1-F)(x)\\&=-\left[x(1-F(x))\right]_0^a+\int_0^a \{1-F(x)\}\text{d}x\\&=-\underbrace{a(1-F(a))}_{=0}+\underbrace{0(1-F(0))}_{=0}+\int_0^a \{1-F(x)\}\text{d}x\end{align*}
In the special case when $a=+\infty$,
$$\lim_{x\to\infty}x(1-F(x))=\lim_{x\to\infty}\frac{1-F(x)}{1/x}
=\lim_{x\to\infty}\frac{-f(x)}{-1/x^2}=\lim_{x\to\infty}x^2f(x)=0$$
by L'Hospital's rule and the fact that $xf(x)$ is integrable at infinity (the expectation $\mathbb E_F[X]$ is assumed to exist).
In the current case, one can turn the integral into an expectation as
$$\int_0^y x\text{d}F(x)=F(y)\int_0^y x\frac{\text{d}F(x)}{F(y)}=\mathbb{E}_{\tilde{F}}[X]$$with $$\tilde{F}(x)=F(x)\big/F(y)\mathbb{I}_{(0,y)}(x)$$Thus
$$\int_0^y x\text{d}F(x)=F(y)\int_0^y \{1-F(x)\big/F(y)\}\text{d}x$$
which is the representation that you found.
A: No. You'll have to take it, unfortunately.
By the way, this integral shows up in expected shortfall (conditional value-at-risk) measure in risk management. It's used so much, that if there was a shortcut through CDF, people would have figured it out long ago. 
