  We present an efficient perturbative method to obtain both static and dynamic
polarizabilities and hyperpolarizabilities of complex electronic systems. This
approach is based on the solution of a frequency dependent Sternheimer
equation, within the formalism of time-dependent density functional theory, and
allows the calculation of the response both in resonance and out of resonance.
Furthermore, the excellent scaling with the number of atoms opens the way to
the investigation of response properties of very large molecular systems. To
demonstrate the capabilities of this method, we implemented it in a real-space
(basis-set free) code, and applied it to benchmark molecules, namely CO, H2O,
and paranitroaniline (PNA). Our results are in agreement with experimental and
previous theoretical studies, and fully validate our approach.
