A new computational approach to the chemical potential