A nonrelativistic, quantum-mechanical calculation of the second- and third-order electromagnetic nonlinearities of electrons in a solid at X-ray frequencies is presented. The case of Bloch electrons, as well as the case of electrons moving in a periodic potential together with a surface barrier potential, are considered. Because of the rapid variation of electronic density at the surface, it is shown that the surface terms must be retained in nonlinear current densities even at X-ray frequencies. Since the wavelength of X-rays is small, we have retained the interactions due to the electronic spin-moment and the spin-orbit coupling. However, it is found that when all the relevant frequencies are high, these terms do not contribute to the current density. We also consider the second-order difference mixing of waves in which the difference frequency is of the order of an optical transition frequency and the case of mixing of X-ray and optical frequencies. © 1972 Società Italiana di Fisica.