We may make a more elaborate calculation by treating the atmosphere as compounded of many thin layers. For each such layer, at height y and thickness dy, the weight of this layer in determining the radiation temperaure seen from outer space is a generalization of the expression arrived at earlier for the troposphere. It is:
where OD(y) is the optical depth of the part of the atmosphere from y upwards.
The total effect of CO on the radiation at wavelengths &lambda; to &lambda;+d&lambda; is therefore:
where B is the expression for radiation according to Planck's law presented above: 
and the infinity here can be taken actually as the top of the tropopause.
Thus the effect of a relative change in CO concentration, dN/N = dn/n (where n is the density number near ground), would be (noting that dN/N = d(ln N) = d(ln n):
where we have used integration by part.
Because B does not depend on N, and because , we have:
Now,  is constant in the troposphere and zero in the tropopause. We denote the height of the border between them as U. So:
The optical depth is proportional to the integral of the number density over y, as does the pressure. Therefore, OD(y) is proportional to the pressure p(y), which within the troposphere (height 0 to U) falls exponentially with decay constant 1/H (H~5.6 km for CO), thus:
Since  + constant, viewed as a function of both y and N, we have:
And therefore differentiating with respect to ln N is the same as differentiating with respect to y, times a factor of .
We arrive at:
Since the temperature only changes by ~25% within the troposphere, one may take a (rough) linear approximation of B with T at the relevant wavelengths, and get:
Due to the linear approximation of B we have:
with T taken at H, so that totally:
giving the same result as in the one-layer model presented above, as well as the logarithmic dependence on N, except that now we see T is taken at 5.6 km (the pressure drop height scale), rather than 6.3 km (the density drop height scale).