pressure in earth's atmosphere as a function of height above sea level While I was studying the measurements of pressure at earth's atmosphere,I found the barometric formula which is more complex equation ($P'=Pe^{-mgh/kT}$) than what I used so far ($p=h\rho g$).
So I want to know how this complex formula build up? I could reach at the point of
$${dP \over dh}=-{mgP \over kT}$$
 From this how can I obtain that equation. Please give me a Mathematical explanation.

This type of problem is known as a differential equation. In this particular case the solution can be guessed, since you have that the derivative of the function $P$ is just a constant times $P$. The only function satisfying this condition is the exponent, since:
$${d(A e^{a x}) \over dx} = a A e^x$$
Thus, if $${dP\over dh} = \left( \frac {-mg}{kT}\right) P$$
Then $P$ must be:
$$P(h) = A\exp\left(\frac {-mg}{kT} \cdot h\right)$$
Where $A$ is a constant. In particular, if the pressure $P_0$ at $h=0$ is known, then by substitution, We have:
$$P(h) = P_0\exp\left(\frac {-mg}{kT} \cdot h\right)$$
