  Response functions are at the heart of any comparison of theory with
experiment in studies of the nuclear dynamics with electroweak probes.
Calculations performed in the laboratory frame often suffer from center of mass
contaminations that need to be removed. By confining the system in a harmonic
oscillator, we derive a set of analytical formulas to subtract the center of
mass effects from calculations of response functions and associated sum rules.
After a general analytical derivation, we first deal specifically with the
longitudinal response function appearing in electron scattering and provide
expressions for the center of mass correcting functions. Next, we present a
proof of principle study for the case of the electric dipole sum rules in a
two-body problem with a numerical implementation of our formalism. These steps
pave the way to applying the proposed method to heavier nuclei in the future.
