The microcanonical ensemble holds for an isolated system whose energy is conserved. The canonical ensemble, on the other hand, represents a sample in contact with a heat bath that is held at a certain temperature.
Although their distributions look quite quite different, they essentially give the same ensemble averages for macroscopic samples.
Consider the integral in phase space:
<br />
\langle f \rangle_{\mathrm{micro}} = \frac{1}{A(E)} \, \int{dq dp \, f(q, p) \, \delta(H(q, p) - E)}<br />
of a quantity f(q, p) that is a function of the generalized coordinates q, and generalized momenta p. The delta function ensures that we take into account only points that lie on a constant energy E hypersurface with equal weight. These kinds of integrals are essentially what is evaluated for the average in a microcanonical ensemble. It is not hard to see that this integral is a parametric function of E. The normalization constant A(E) is chosen so that \langle 1 \rangle = 1.
Now, represent the delta function by an inverse Laplace transform:
<br />
\delta(x - E) = \frac{1}{2 \pi i} \, \int_{\eta - i \infty}^{\eta + i \infty}{e^{s (x - E)} \, ds} <br />
Then, the above integral may be rewritten as:
<br />
I_{\mathrm{micro}}(E) = \frac{1}{2 \pi i} \, \int_{\eta - i \infty}^{\eta + i \infty}{ds \, e^{-s \, E} \, \int{dq dp f(q, p) \, e^{s H(q, p)}}}<br />
Notice that the integral over phase space is essentially what is evaluated in the canonical ensemble, albeit with a complex variable s.
We want to evaluate this integral within the stationary phase approximation. We will do it first for the normalization constant A(E). Let us introduce:
<br />
\tau^D \, e^{s \, F(s)} \equiv \int{dq dp e^{s H(q, p)}}<br />
where \tau is a quantity with the dimension of action (\int dq_{j} dp_{j}). Then
<br />
A(E) = \tau^D \, \frac{1}{2 \pi \, i} \, \int_{\eta - i \infty}^{\eta + i \, \infty}{ds \, e^{s \, (F(s) - E)}}<br />
Now, we choose \eta = \beta such that:
<br />
\frac{d}{ds} \left. s \, (F(s) - E) \right\vert_{s = \beta} = 0<br />
In other words, if we know F(s), then E is a function of \beta:
<br />
E = \frac{d}{d\beta} \left( \beta \, F(\beta) \right)<br />
The method of stationary approximation then gives
<br />
A \sim \tau^D \, \frac{1}{\sqrt{2\pi \, \vert F''(\beta)\vert}} \, e^{\beta \, (F(\beta) - E)}<br />
When evaluating the integral we treat the same approximation, and we essentially get:
<br />
\langle f \rangle_{\mathrm{micro}}(E) \sim \int{\frac{dq dp}{\tau^D} \, e^{\beta \, (F(\beta) - H(q, p))} \equiv \langle f \rangle_{\mathrm{canon}}(T = \frac{1}{\beta}})<br />
which is the canonical ensemble average if we accept F as the free energy of the system. Notice that the energy is then expressed as:
<br />
\frac{d}{d\beta} = \frac{dT}{d\beta} \, \frac{d}{dT} = -T^2 \, \frac{d}{dT}<br />
<br />
E = -T^{2} \, \frac{d}{dT} \left( \frac{F}{T} \right) = F - T \, F'(T) = F + T \, S<br />
which is the correct thermodynamic relation.