We present an accurate analytical formulation to determine the chemical potential of an ultrarelativistic spherical degenerate Fermi gas interacting with nuclear matter by examining rigorously the three terms of the general mathematical expression for the chemical-potential energy namely, the Fermi energy, the optical-potential energy, and a third term which is negligible if the Fermi gas is dilute. In fact, we derive the above expression as a function of dis tance and absolute temperature. The Fermi velocity is also determined. In addition, essential aspects of the optical potential are disc ussed.