Rewriting an integral of an absolutely continuous function

Let $$(X,M, \mu)$$ be a $$\sigma$$-finite measure space and $$f: X \rightarrow [0, \infty)$$ be measurable. For each $$\alpha \ge 0$$ Define $$E_\alpha = \{ x \in X : f(x) > \alpha \}$$ and $$\lambda(\alpha) = \mu(E_\alpha)$$.

Suppose that $$\phi : [0, \infty) \rightarrow [0,\infty)$$ is an increasing function which is absolutely continuous on [0,T] for every T $$\in (0, \infty)$$. Prove that for each $$\beta \ge 0$$,

$$\int_{E_\beta}(\phi(f(x))-\phi(\beta))d\mu(x) = \int_\beta^\infty \phi '(\alpha)\lambda(\alpha) d\alpha$$.

What I have so far:

$$\int_{E_\beta}(\phi(f(x))-\phi(\beta))d\mu(x)=\int_{E_\beta} \phi(\beta)-\int_\beta^{f(x)} \phi ' (t) dt-\phi(\beta)d\mu(x)$$ because $$\phi$$ is absolutely continuous.

$$=-\int_{E_\beta}\int_\beta^{f(x)}\phi ' (t)dt d\mu(x) = \int_\beta^\infty\int_{E_t} \phi ' (t) d\mu dt$$ (I'm not really sure why this is true?? Fubini-Tonelli allows us to switch the integrals, but I don't understand why the bounds change)

$$=\int_\beta^\infty\phi ' (t) \mu(E_t)dt=\int_\beta^\infty \phi '(t)\lambda(t)dt$$

Could someone please explain how the bounds change? Thanks!

We can write $$\begin{eqnarray} \int_{E_\beta}(\phi(f(x))-\phi(\beta))d\mu(x) &=&\int_{E_\beta}\left(\int_\beta^{f(x)}\phi'(t)dt\right)d\mu(x) \\ &=&\int_{E_\beta}\int_{\beta\beta}\int_{E_\beta\bigcap \{t\beta}\left(\int_{E_t} 1d\mu(x)\right)\phi'(t)dt\\ &=&\int_\beta^\infty \phi'(t)\lambda(t)dt, \end{eqnarray}$$ by Tonelli's theorem.
$$f(x) >\beta$$ and $$\beta iff $$\beta and $$f(x) >t$$. Hence $$x\in E_{\beta}$$ and $$\beta iff $$t >\beta$$ and $$x \in E_t$$.