The theory for the calculation of the frequency-dependent hyperpolarizabilities beta(-2-omega; omega, omega), beta(-omega; 0, omega), and beta(0; omega, -omega) is discussed. New relations between these tensors are derived for those wave functions that obey the time-dependent Hellmann-Feynman theorem (e.g., the self-consistent field [SCF] or the exact wave function). Using second-order Moller-Plesset perturbation theory (MP2), expressions are obtained for the hyperpolarizabilities in terms of derivatives of appropriately defined linear polarizability tensors with respect to a static electric field. Results are presented for ammonia and formaldehyde for the optical Kerr effect and for second-harmonic generation. These results indicate that it is desirable to determine the frequency-dependent contribution to the hyperpolarizability at the MP2 rather than the SCF level of theory, in cases where the static hyperpolarizability has a large contribution from electron correlation and/or where the frequency-dependent contribution may be more significant, such as for second-harmonic generation.