Derivation to second order in temperature
We seek an expansion that is second order in temperature, i.e., to
, where
is the product of temperature and the Boltzmann constant. Begin with a change variables to
:

Divide the range of integration,
, and rewrite
using the change of variables
:


Next, employ an algebraic 'trick' on the denominator of
,

to obtain:

Return to the original variables with
in the first term of
. Combine
to obtain:

The numerator in the second term can be expressed as an approximation to the first derivative, provided
is sufficiently small and
is sufficiently smooth:

to obtain,

The definite integral is known[3] to be:
.
Hence,

Higher order terms and a generating function
We can obtain higher order terms in the Sommerfeld expansion by use of a
generating function for moments of the Fermi distribution. This is given by

Here
and Heaviside step function
subtracts the divergent zero-temperature contribution.
Expanding in powers of
gives, for example [4]






A similar generating function for the odd moments of the Bose function is
