  We study the dynamics of a transmon qubit that is capacitively coupled to an
open multimode superconducting resonator. Our effective equations are derived
by eliminating resonator degrees of freedom while encoding their effect in the
Green's function of the electromagnetic background. We account for the
dissipation of the resonator exactly by employing a spectral representation for
the Green's function in terms of a set of non-Hermitian modes and show that it
is possible to derive effective Heisenberg-Langevin equations without resorting
to the rotating wave, two level or Markov approximations. A well-behaved time
domain perturbation theory is derived to systematically account for the
nonlinearity of the transmon. We apply this method to the problem of
spontaneous emission, capturing accurately the non-Markovian features of the
qubit dynamics, valid for any qubit-resonator coupling strength.
