Expression deduction for energy density per wave length Energy density per frequency is defined by Planck formula as:
$$u(\nu,T)=\frac{8\pi h}{c^3} \frac{\nu^3}{e^{\frac{h\nu}{kT}}-1}$$
The relation between wave length, $\lambda$, and frequency, $\nu$, of a wave on vacuum is given by:
$$c=\lambda \nu$$
And the relation between energy density per frequency, $u(\nu,T)$, and energy density per wave length, $w(\lambda,T)$ is expressed as:
$$w(\lambda,T)d\lambda=u(\nu,T)d\nu$$
So, $w(\lambda,T)=\frac{d\nu}{d\lambda}u(\nu,T)$. I've seen in books that it's supposed to be the absolute value of $\frac{d\nu}{d\lambda}$, $\left|\frac{d\nu}{d\lambda}\right |$ instead of $\frac{d\nu}{d\lambda}$ as I wrote on the equation. But why?
 A: The reason is that $\lambda$ is a decreasing function of $\nu$, so that if $d\nu$ is positive then $d\lambda$ is (at least formally) negative, but we explicitly want to not care about that. We want $u(\nu,T)d\nu$ to be the energy content per non-directed unit frequency, and ditto for $w(\lambda,T)d\lambda$, and the absolute value ensures that that is the case.
More specifically, we want to use $u(\nu,T)$ to get the energy content between frequencies $\nu_1$ and $\nu_2>\nu_1$ as
$$
U(\nu_1,\nu_2,T)=\int_{\nu_1}^{\nu_2}u(\nu,T)d\nu
$$
and we similarly want to use $w(\lambda,T)$ to get the energy content between wavelengths $\lambda_2=c/\nu_2$ and $\lambda_1=c/\nu_1>\lambda_2$ (note the changed order) as
$$
W(\lambda_1,\lambda_2,T)=\int_{\lambda_2}^{\lambda_1}w(\lambda,T)d\lambda,
$$
and we want both contents to be equal and positive.
However, if you do the change of variable you get
$$
W(\lambda_1,\lambda_2,T)
=\int_{\lambda_2}^{\lambda_1}w(\lambda,T)d\lambda
=\int_{\nu_2}^{\nu_1}w(\lambda,T)\frac{d\lambda}{d\nu}d\nu
=\int_{\nu_1}^{\nu_2}w(\lambda,T)\left|\frac{d\lambda}{d\nu}\right|d\nu,
$$
with the absolute value coming from the minus sign in switching the limits of integration and the fact that $d\lambda/d\nu$ is negative.
