The Heat Kernel Expansion for the Electromagnetic Field in a Cavity