Isothermal Atmosphere I was taught that for isothermal atmosphere:
$\frac{dP}{dz}=-\rho g$
How come the equation is only true for isothermal atmosphere? I suppose $dP$ can be caused by changed in temperature as well?
 A: 
How come the equation is only true for isothermal atmosphere?

Whoever taught you that that equation is valid for an isothermal atmosphere and only for an isothermal atmosphere was just wrong.
The equation in question is for a fluid in hydrostatic equilibrium. Imagine a small cylindrical plug of fluid, oriented vertically. That little cylinder has two forces that act it, the downward gravitational force due to the mass of the fluid in the cylinder, and the pressure on the top, bottom, and sides of the plug. Horizontal movement results if the pressure on one side is greater than the pressure on the opposite side. Vertical movement results if the force due to the pressure differential between bottom and top doesn't exactly balance out the downward gravitational force. With only a tiny bit of calculus, the condition that results in that balance is
$$\frac{dP}{dz}=−\rho g$$
where $z$ is the radial distance from the center (or height above some reference), $P$ is pressure, $\rho$ is the local density, and $g$ is the local acceleration due to gravitation.
One way to look at this expression is that it represents a stability condition. It says that a cylindrical plug of fluid will fall / stay in place /rise if the pressure gradient is less than / equal to / greater than the gradient specified by the hydrostatic equilibrium condition.
 There is nothing in that expression that restricts its use to an isothermal atmosphere. This expression applies to the Earth's atmosphere, the interior of our Sun, and even the interior of the Earth. The first two are anything but isothermal, and the latter obviously isn't even a gas.

Suppose the fluid in question is an ideal gas. The way in which temperature varies with altitude combined with the hydrostatic equilibrium condition and the ideal gas law ($P = \rho R^\ast T$, where $P$ is pressure, $\rho$ is density, $T$ is temperature, and $R^\ast$ is the gas constant for the gas in question) specifies how pressure and density must vary in order for the gas to be in hydrostatic equilibrium.
Assuming $g$ and $T$ are constant, this results in an exponential drop in pressure with increased altitude:
$$\frac{P(z)}{P_0} = \exp\left(-\frac{g}{R^\ast T} (z-z_0)\right)$$
where $z_0$ is a reference altitude and $P_0$ is the pressure at that altitude. Density follows a similar exponential drop with altitude.
With if temperature isn't constant? Suppose temperature changes linearly with altitude: $T(z) = T_0 + \alpha (z-z_0)$. Instead of an exponential drop, this results in a power law drop in pressure with increased altitude:
$$\frac{P(z)}{P_0} = \left(\frac {T(z)} {T_0}\right)^{-g / (\alpha R^\ast)}$$
A constant temperature and a temperature that varies linearly with altitude both result in nice closed form expressions. Many of the older models of the Earth's atmosphere split the atmosphere into regions where the temperature is either constant or varies linearly with altitude precisely because of this. More modern versions numerically integrate the relevant equations.
