We develop a quantum theory of electron confinement in metal nanofilms. The
theory is used to compute the nonlinear response of the film to a static or
low-frequency external electric field and to investigate the role of boundary
conditions imposed on the metal surface. We find that the sign and magnitude of
the nonlinear polarizability depends dramatically on the type of boundary
condition used.Comment: Accepted to PRB in this for