Solvent and vibrational effects on molecular electric properties. Static and dynamic molecular polarizabilities and hyperpolarizabilities in solution