Solution (source code)

= Solution

Let $\varepsilon=E_{ph}$ and $\gamma=W/(M_0c^2)$. For a head-on <photon> and particle collision, boost to the particle's initial rest frame. The incident <photon> <energy> is $\varepsilon_* =\gamma(1+\beta)\varepsilon$. On the inverse-Compton branch $\varepsilon<\gamma\beta M_0c^2$, the maximal outgoing lab <energy> corresponds to rest-frame backscattering into the particle's forward direction. The exact <Compton scattering> recoil formula gives $\varepsilon'_* =\varepsilon_*/[1+2\varepsilon_*/(M_0c^2)]$. Boosting the backscattered <photon> back to the lab gives
$$
\boxed{\varepsilon'_{\max}=\frac{\gamma^2(1+\beta)^2\varepsilon}
{1+2\gamma(1+\beta)\varepsilon/(M_0c^2)}.}
$$
For $\gamma\gg1$ this becomes
$$
\boxed{\varepsilon'_{\max}\simeq\frac{4\gamma^2\varepsilon}
{1+4\gamma\varepsilon/(M_0c^2)}.}
$$
Only in the additional <Thomson scattering> limit $4\gamma\varepsilon\ll M_0c^2$ may the denominator be neglected, yielding the printed estimate $4[W/(M_0c^2)]^2E_{ph}$. Ultrarelativistic motion alone does not justify it. For example $\gamma=1000$ and $\varepsilon=M_0c^2$ would give $4\times10^6M_0c^2$ from that estimate, exceeding the available total <energy>; the recoil-corrected maximum is about $999.75M_0c^2$.

For an arbitrarily hard incident <photon>, maximizing over direction needs a further qualification: if $\varepsilon\geq\gamma\beta M_0c^2$, the largest outgoing <photon> <energy> is the unchanged $\varepsilon$, rather than this amplified backscattering branch. The exact <photon> <energy> gain is $\Delta\varepsilon_{\max}=\varepsilon'_{\max}-\varepsilon$. Calling the outgoing <energy> the gain is accurate only when amplification is large. These distinctions prevent the <inverse Compton scattering> estimate from violating <conservation of energy> outside its low-rest-frame-photon-energy regime.