In the canonical ensemble the entropy is given by S=kBlnZ+kBT(∂lnZ∂T)N,V, and the pressure by p=kBT(∂lnZ∂V)N,T. Similarly we can compute the chemical potential as μ=−kBT(∂lnZ∂N)V,T.