Analytic evaluation of the nuclear polarization contribution to the energy shift in heavy ions