The divergence theorem is used to handle the physics required at interfaces for acoustic and elastic wave propagation in heterogeneous media. The physics required at regular and irregular interfaces is incorporated into numerical schemes by integrating across the interface. The technique, which can be used with many numerical schemes, is applied to finite differences.A derivation of the acoustic wave equation, which is readily handled by this integration scheme, is outlined. Since this form of the equation is equivalent to the scalar SH wave equation, the scheme can be applied to this equation also. Each component of the elastic P-SV equation is presented in divergence form to apply this integration scheme, naturally incorporating the continuity of the normal and tangential stresses required at regular and irregular interfaces.