[See final additions at bottom for a restatement of the paradox.]
I have seen the assertion in a couple of places that if you trap light in a reflective resonator, or any other kind of sealed trap, then (as another user here put it in answering a different question) by "calculating the Doppler shift at either end and then finding the difference between the red and blue photon momentums", one can show that it's equivalent to "the same mass $m$... that defines how it responds to force". The net momentum of the light will match that of an equivalent mass moving at the speed of the resonator, the net energy will match the relativistic total energy of that mass at that speed, and the net force when accelerated will match the inertia of that mass, all due to Doppler shifts.
I have been trying to do this calculation, getting the doppler-shifted frequencies and then finding the change of energy and momentum that results from viewing it in another reference frame, to show that they are the same as the energy and momentum of an equivalent rest mass with the velocity of the enclosing resonator. But I can't do it -- the results keep coming out wrong.
As I understand it, you calculate doppler shifts with a factor of $\sqrt{\frac{1-\beta}{1+\beta}}$ where $\beta$ is the fraction of lightspeed by which the frames differ in velocity. I'll call that $R$. It can also be expressed as $\gamma(1-\beta)$, where $\gamma$ is the Lorentz factor $1/\sqrt{1-\beta^2}$. If I have things understood correctly, when a light source is receding then the light you observe from it has its wavelength divided by $R$ and its frequency multiplied by $R$. But if light hits a moving mirror, the factor needs to be applied twice: the outgoing light gets shifted by $R^2$.
So I modeled a simple resonator, or laser, and looked at a small sample of light in it, which might be one photon. In its rest frame the laser has length $d$, and the light sample has frequency $f$, wavelength $\lambda$, and energy $E$. So when moving the forward-going light will have frequency $f/R$ and wavelength $\lambda R$, and vice versa for the reverse-moving light. And energy is proportional to frequency. And I thought, if we average the forward momentum with the backward momentum we should get the total, and likewise for energy. This led me to a pair of naive first-approximation formulas: for momentum, $\frac{1}{2}(\frac{1}{R} – R)E∕c$, and for energy, $\frac{1}{2}(\frac{1}{R} + R)E$. For a numeric example, consider $\beta=\frac{1}{2}$: in this case $R=\sqrt{\frac{1}{3}}$, and the blue-shifted forward light has three times the frequency of the red-shifted backward light. The resulting energy is $1.1547E$ and the momentum is $0.57735E/c$, which are correct. Then I did some algebra and verified that this momentum formula is indeed equivalent to $\gamma\beta E/c$ and the energy formula is equivalent to $\gamma E$. Problem solved, right?
Not so fast. I then noticed a problem. I'd been doing a simple average of forward and backward globs of light, giving them equal weight. But the light isn't weighted equally! It spends more time going forward than going backward. In the $\beta=\frac{1}{2}$ case, it spends three fourths of its time going forward and one fourth going backward. This means that at any given time, three fourths of the photons in the laser are going forward, and have blue-shifted energy rather than red-shifted energy.
Here, I made a spacetime diagram of it:
Another way to look at it is that if the Doppler shift increases frequency by $R$, it increases power by $R^2$. The rate of photon reception per second goes up, as well as the energy in each photon. No matter how I look at it, I have to conclude that in this case, there is nine times as much energy and momentum in the forward-moving light as in the backward-moving light: three times as many photons with three times as much oomph apiece.
But this produces a completely wrong result when I try to compare the resulting mass or energy to what it should be. Like, instead of $1.1547E$ for the energy, I get $1.443E$. I got this by weighting the forward light by $(1+\beta)$ and the backward light by $(1-\beta)$ before averaging. And that is way too much, apparently violating conservation of energy.
Where have I gone wrong in my understanding?
Update: In an earlier update which I've deleted, I said that I thought I was getting to an answer. I was wrong. I fooled myself and didn't notice I was subtly slipping back into the rest frame of reference.
During the time I thought my new approach was working, I made a new spacetime diagram, showing a more continuously operating resonator, which at some given time opens both its mirrors, dumping half of the light out of each end:
This diagram confirms that at speed $\frac{1}{2}c$, photons or wavefronts moving to the right are three times as frequent in both space and time as those going to the left. (Though if you measure along the rest-frame diagonals everything is even.) This difference in photons per second is enough to completely account for all of the expected change of net energy in the system, without leaving any room for each photon to also have differing energy due to its changed frequency.
While I was at it, I recast some of my equations using momentary energy in terms of continuous power. In these, the light's "mass" is $2Pd/c^3$, where $P$ is the power in one direction in the rest frame. There were no surprises and it left the question unchanged. The boosted state still has too much energy relative to the resting state.
Later update, ignoring the mirrors: I tried to clarify exactly how the energy would change with frame of reference, and ended up kind of ignoring the mirrors and looking at two opposing beams of light, which have equal frequencies and power in the rest frame. How much energy does each beam have within a window of length $d$? The energy is $hfk$ where $h$ is Planck's constant and $k$ is the count of photons. How does that transform when the window moves at speed $\beta$? I believe $d_\beta=d_0/ \gamma$, $f_\beta=f_0/R$, and $k_\beta=k_0(1+\beta)=k_0/\gamma R$. More photons fit in the window when blue-shifted (photon density changes with frequency), but the narrowing of the window cuts that down a bit. So $E_\beta=E_0(1+\beta)/R = E_0\gamma(1+\beta)^2$. You would then apply a boost of $-\beta$ to the opposing beam. Note that the total photon count is still $2k_0$. The total energy is $E_\beta+E_{-\beta}$, and that's supposed to add up to $2\gamma E_0$ (the energy that an equivalent mass would have at that speed), but it doesn't. [Edit: it adds up to $2\gamma(1+\beta^2)E_0$, just as in udrv's answer.]
Similarly, the momentum in each direction would be $p_\beta=E_0(1+\beta)/Rc$, and the total would be $p_\beta-p_{-\beta}$. That's supposed to add up to $2\beta\gamma E_0/c$. It doesn't.
Summation, after udrv's answer: We now have a total of five different mathematical approaches, from my first try which took a weighted average of a small sample of light over time, to udrv's final approach using a segment of spacetime shaped like a hyperwedge. I believe all five ended up producing the same answer. They all say that the energy of the system in a moving observer's frame is greater than the energy of the bare photons in the rest frame by a factor of $\gamma(1+\beta^2)$, when I would expect the change to be a factor of $\gamma$ only. So it's pretty clear that the answer to this question is not to fix the math. No matter how you come at it, the math is coming out consistent.
So the question now is, how can this make sense physically? Where can that much energy come from? How can it be reconciled with the apparent fact that if we were boosting massive particles instead of light, the resulting energy would be smaller?
I end up imagining the following scenario. Let's say you have a reservoir of cold electrons and positrons, and when you release them, you convert them into gamma rays which then get trapped in the resonator. (Yeah, I know this is a stretch.) If you convert them in the rest frame, the energy of the resulting photons equals the energy of the particles' mass. If you first boost the particles into a moving frame, their mass-energy goes up by a factor of $\gamma$, and if you then convert them into photons, the energy must be the same. But if you convert them into photons in the rest frame and then switch to a moving view of those photons while they're in the resonator, this finding seems to say that you end up with more total energy than you do if you convert already boosted particles. This is a paradox.
How do we resolve this? How can we either show that these boosted energies which appear to be different are really the same, or show that energies which appear the same in the rest frame are actually different, or show that it's somehow not contradictory for the two to have conflicting results?
Udrv's second answer (the one with the +100 bounty awarded) points out that the issue doesn't just apply to light, but to trapped massy particles as well. This is true. If I model massy particles trapped between things that bounce them back into the enclosed volume, or equivalently if I examine an arbitrary volume into which streams of massy particles flow from opposite directions (the former may be imagined as a string on two pulleys, and the latter as two rods passing through an open-ended box), then I get the same paradox. The forward-moving mass contains more particles and spends more time in transit than the backward-moving mass does, to a degree that increases with the relative speed between the forward and backward masses, apparently becoming lightlike at the limit. This paradox goes away if you imagine two masses that stay entirely enclosed in the volume and duration under examination, so that the forward and backward groups have the same number of particles.
The two scenarios (reflector vs selecting a window from a larger set of passing particles) can be seen as equivalent when viewed in terms of flux at the boundaries. Each end has an equal number of particles passing inward and outward at that surface, but not an equal amount of energy except in the rest frame.
ANYWAY, where it stands now, it sounds like the original idea -- that light trapped in a resonator is externally equivalent to mass of equal energy -- must be false. Is that what people are concluding?
I am going to try to frame the paradox one last time, in terms which are as clear and unambiguous as possible. The physical situation depicted in the thought experiment is quite implausible in practical terms, but setting it up this way is beneficial, from my point of view, for the absence of potential distractions.
The thought experiment in question is the one I mentioned earlier, where we annihilate electron-positron pairs inside a resonator. The setup is as follows: we have $n$ electrons and $n$ positrons, which have an arbitrarily small velocity relative to each other. At some time, they start to collide and annihilate in pairs. The annihilation occurs at a steady rate for a finite time $\Delta t$. By an amazing coincidence, all of the annihilations produce photons that happen to be directed parallel to some given x axis, half of them going each way along it. The result is two beams emitted in opposite directions, each having steady power while it lasts (to some arbitrary degree of precision), and then ceasing simultaneously.
If we observe this experiment from the rest frame of the particles, each electron and positron has a mass of 0.5110 MeV, and each emitted photon has that same energy. The total energy in the system never changes.
Now we repeat the experiment, except this time it happens between a pair of perfectly reflective gamma-ray mirrors. Once again, everything coincidentally lines up on the x axis. The distance between the mirrors is exactly $c\Delta t$, which means that the reflected photons from the first annihilations reach the center just as the last annihilations are finishing up. The result is that photons are shuttling continuously in both directions with no gaps. The numbers and energies of the photons are exactly as they were without the mirrors -- they're just confined to a smaller volume. The total energy again does not change.
Now let us watch these two experiments from a viewpoint boosted to a speed of ½$c$ along the x axis. First, without mirrors. Before annihilation, each electron and positron now has its apparent mass increased by a factor of $\sqrt{4/3}$, so they now weigh 0.59005 MeV. After annihilation, we have two groups of $n$ photons, one being blueshifted by a factor of $\sqrt{3}$ and the other redshifted by $\sqrt{⅓}$, resulting in energies of 0.8851 and 0.2950 MeV, which adds up to 2 × 0.59005. Again the total does not change.
But how does it look to the ½$c$ observer with the mirrors in place? After the annihilation is complete, we have $2n$ photons, but instead of being split fifty-fifty between red and blue frequencies, we've got $1.5n$ blue photons and only $0.5n$ red ones. All of the math we've thrown at this agrees that with the mirrors in place, the total energy of the system is now no longer 1.1801 MeV per pair, it's now 1.4752 MeV per pair. The average over time per photon says the excess is there, the stress tensor integration says it's there, the spacetime wedgie says it's there, the half-volume pressure balance says it's there... (for details, see entire rest of thread.)
BUT THIS ADDITIONAL ENERGY CANNOT EXIST. There is no source for it. It comes from nowhere, and if you open both ends of the resonator simultaneously in proper time to let the photons out, it vanishes into nowhere, reverting to what we saw in the mirrorless case. Why does our math keep saying it's there? It cannot be real actual energy, it is clearly illusory in some sense. So why do we see more than is actually there?