I am an economist currently working with this book: Frank Cowell - Measuring Inequality
On page 25 a formulation of the relative mean deviation is given as follows: $$ M = 2 \left[ F\left(\bar{y}\right) - \Phi(\bar{y}) \right] $$
$F$ is the CDF, $\Phi$ is the proportion of total income received by persons who have an income less than or equal to $y$ ( per the book's definition: $\Phi=\frac{1}{\bar{y}} \int_0^y zdF(z)$), and $\bar{y}$ is the mean. All this is also defined on page 152 in the appendix. The appendix also gives a definition of $M$:
$$ M = \int \left| \frac{y}{\bar{y}} -1\right|dF $$
The book says that the former formulation can be derived from the latter, but I have no idea how to begin with this. How do I perform the integration here and get to the first formulation?