  We develop a Hamiltonian theory for a time dispersive and dissipative (TDD)
inhomogeneous medium, as described by a linear response equation respecting
causality and power dissipation. The canonical Hamiltonian constructed here
exactly reproduces the original dissipative evolution after integrating out
auxiliary fields. In particular, for a dielectric medium we obtain a simple
formula for the Hamiltonian and closed form expressions for the energy density
and energy flux involving the auxiliary fields. The developed approach also
allows to treat a long standing problem of scattering from a lossy
non-spherical obstacle and, more generally, wave propagation in TDD media.
