Show that $E[x]=\int_0^\infty(1-F_X(x))dx$ The solution is as follows: $$\begin{align} \int_0^\infty P(X>x)dx &=\int_0^\infty \int_x^\infty f_X(y)dydx\\ &=\int_0^\infty \int_0^y dxf_X(y)dy\\ &=\int_0^\infty yf_X(y)dy\\ &=E[X] \end{align}$$
I don't understand step 3 in the solution, specifically while the limit of integration changed from $\infty$ to $y$.