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.

If 
$\frac{dP}{dh} = (-\frac{mgP}{kT})$,
then
$\frac{1}{P} \frac{dP}{dh} = (-\frac{mg}{kT})$,
or
$\frac{d(ln P)}{dh} = (-\frac{mg}{kT})$.
Integrating with respect to $h$ over the interval $[h_0, h]$ yields
$ln(P(h)) - ln(P(h_0)) = (-\frac{mg}{kT})(h - h_0)$,
or
$ln(\frac{P(h)}{P(h_0)}) = (-\frac{mg}{kT})(h - h_0)$,
or
$\frac{P(h)}{P(h_0)} = exp(-\frac{mg}{kT}(h - h_0))$,
or
$P(h) = P(h_0)exp(-\frac{mg}{kT}(h - h_0))$.
If we now take $h_0 = 0$, and set $P = P(0)$, $P' = P(h)$, the desired formula is had.
