I've got a problem that I don't know how to solve. The question: Suppose that Y is a continuous random variable with density f(y) that is positive only if y> or equal to zero. If F(y) is the distribution function, show that

$\displaystyle E(Y) = \int_{0}^{infty}{} yf(y) dy = \int_{0}^{infty}{} [1-F(y)] dy.$

The book also gives a hint: If y > 0, $\displaystyle y=\int_{0}^{y}{} dt$ and $\displaystyle E(Y) = \int_{0}^{+\infty} yf(y) dy = \int_{0}^{+\infty} [\int_{0}^{y} dt] f(y) dy$

Exchange the order of integration to obtain the desired result.

I've tried to change the integration order like this:

$\displaystyle E(Y) = \int_{0}^{+\infty} yf(y) dy = - \int_{+\infty}^{0} [\int_{0}^{y} dt] f(y) dy$

but how do I go on from there?

Thanks in advance.