Rewriting S in terms of Z gives S = − − k B ∑ ∑ i ρ ρ i ln ⁡ ⁡ ρ ρ i = − − k B ∑ ∑ i ρ ρ i ( λ λ 2 k B E i − − ln ⁡ ⁡ ( Z ) ) = − − λ λ 2 ∑ ∑ i ρ ρ i E i + k B ln ⁡ ⁡ ( Z ) ∑ ∑ i ρ ρ i = − − λ λ 2 U + k B ln ⁡ ⁡ ( Z ) .