Microcanonical ensemble only deals with isolated systems, but a canonical ensemble deals will closed (energy exchange can happen).
A canonical ensemble is a collection of replicas of a system all having fixed number of particles (
Microcanonical ensemble has constant
Boltzmann definition of entropy:
where in the last step I used Taylor expansion. We know that
Hence,
Total number of microstates is the sum over