  We describe the transverse momentum spectra of $\pi^\pm$, $K^\pm$, $p$, and
$\bar{p}$ produced in different centralities gold-gold (Au-Au) collisions at
different collision energies range from 7.7 to 62.4 GeV by a two-component
Erlang distribution. The fitting results are consistent with the experimental
data, and the centrality- and energy-dependent yield ratios of negative to
positive particles are obtained from the normalization constants. Based on the
yield ratios, the energy- and centrality-dependent chemical potentials of light
hadrons and quarks are extracted. The study shows that the dependences of the
three types of particle yield ratios on centrality are not significant,
especially for $\pi$. The logarithms of the three yield ratios show obvious
linear dependence on $1/\sqrt{s_{NN}}$ over a range from 7.7 to 62.4 GeV. The
extracted chemical potentials show obvious dependence on energy, and decrease
with the increase of energy. The dependences of the energy-dependent chemical
potentials of light hadrons and quarks on centrality are relatively more
obvious in low energy region. The derived curves of chemical potentials for all
centralities, from the linear fits of the logarithms of yield ratios vs energy,
have the extremum at the same energy of 3.526 GeV, which possibly is the
critical energy of phase transition from a liquid-like hadron state to a
gas-like quark state in the collision system. With the increase of energy, all
types of chemical potentials become small and tend to zero at very high energy,
which indicates that with the increase of energy, the hadronic interactions
gradually fade and the partonic interactions gradually become greater.
