Abstract
A generalized formulation of Madey's theorem, giving a relation between spontaneous emission and gain of an undulator, is proved to hold in a three-dimensional, multimode context. This formulation is then used to obtain an expression of the full transition matrix representing the small-signal gain and mode coupling of an undulator, both in the plane-wave and Gaussian-mode representations. On this basis, several approximate results are obtained, showing how this approach is able to take into account the finite section and divergence of the electron as well as the laser beam, and to give simple explanation of the operation of a wide-beam FEL and of the ACO mode-coupling measurements.