To get from equation 1 to equation 2, you must differentiate the mean pressure function with respect to z:
That's to EQ2.
All they do for EQ3 is just substitute p_0 for P, and since I'm not too familiar with this topic, I'd just go with it.
EQ 2 and 3 are only the left side of EQ 1. Further I set the solution of the diff like right side of EQ 1. So g will be back in EQ 4.
Thanks, this helped me further on. (By the way, P is pressure. And the next steps will end up with a function of temperature with respect to z (after substitude with a gas law). z is height from sea level).