Theory of Hyper Rayleigh and Hyper Raman Scattering