  In this article we provide a practical prescription to harness the rigorous
microscopic, quantum level descriptions of light-matter systems provided by
Hopfield diagonalisation for quantum description of nonlinear scattering. A
general frame to describe the practically important second-order optical
nonlinearities which underpin sum and difference frequency generation is
developed for arbitrarily inhomogeneous dielectric environments. Specific
attention is then focussed on planar systems with optical nonlinearity mediated
by a polar dielectric $\beta$-SiC halfspace. In this system we calculate the
rate of second harmonic generation and the result compared to recent
experimental measurements. Furthermore the rate of difference frequency
generation of subdiffraction surface phonon polaritons on the $\beta$-SiC
halfspace by two plane waves is calculated. The developed theory is easily
integrated with commercial finite element solvers, opening the way for
calculation of second-order nonlinear scattering coefficients in complex
geometries which lack analytical linear solutions.
