S U M M A R YLaterally varying interfaces cause coupling between wavenumbers so that seismograms in two-dimensionally layered media can be synthesized by means of 'supermatrices', which include the coupled contributions of all the wavenumbers. We introduce reflection and transmission 'supennatrices' in order to eliminate numerical problems arising from loss of precision for evanescent waves in the seismogram synthesis. An interface is assumed to be such that the reflected and transmitted wavefields on its two sides can be represented as purely upgoing and downgoing waves, i.e. the Rayleigh ansatz is imposed. The computational demands of this method can be kept to a minimum by exploiting propagation invariants in the coupled wavenumber domain.The superior performance of this 'invariant embedding' approach when compared to propagator or finite difference schemes is illustrated by application to the response of sedimentary basins to excitation by an incident plane wave or a line force. The results are in good general agreement with the other methods, but show greater numerical stability and computational efficiency. In the case of a single interface the 'invariant embedding' procedure for P-SV-waves takes 45 per cent less computation time and 29 per cent less memory than the propagator method of Koketsu (1987a,b). The gains are reduced in a multilayer case because of the level of computation required to calculate the addition rules for the large reflection and transmission supermatrices.