  We study the joint probability distribution function of the work and the
change of photon number of the nonequilibrium process of driving the
electromagnetic (EM) field in a three-dimensional cavity with an oscillating
boundary. The system is initially prepared in a grand canonical equilibrium
state and we obtain the analytical expressions of the characteristic functions
of work distributions in the single-resonance and multiple-resonance
conditions. Our study demonstrates the validity of the fluctuation theorems of
the grand canonical ensemble in nonequilibrium processes with particle creation
and annihilation. In addition, our work illustrates that in the high
temperature limit, the work done on the quantized EM field approaches its
classical counterpart; while in the low temperature limit, similar to Casimir
effect, it differs significantly from its classical counterpart.
