Is energy lost when a photon bounces of an electron? It was a long time ago I studied atomic physics but I remember that when a photon does not have enough energy to excite the electron to the next energy level it will "bounce off". This is anyway the standard explanation of how light bounces.
However, can this be an elastic scattering process where the photon does not lose any energy? I so, then in principle, could not a photon bounce around such atoms forever* as it never loses energy?
If the scattering is inelastic, where does the energy difference go? Does the electron or atom absorb it? This seems contradictory to the idea of discrete energy levels.
*When I say build something theoretically that can bounce a photon around forever it is loosely speaking since quantum fluctuations can easily destroy a machine on the atomic level. But what I mean is that that photon will not stop bouncing due to energy loss in the bounces.
Mathematical answers showing where the energy is lost is also welcomed.
 A: A low energy photon may not have enough energy to excite electrons to higher energy levels, but it can always transfer some energy into the electron's kinetic energy. This is known as Compton scattering and it is an inelastic process that only really becomes significant for x-rays and gamma rays
Indeed, if the photon bounces off the electron, some momentum must be transferred to the electron due to conservation of momentum. However, if an electron gains momentum, it must also gain energy as well. So, strictly speaking, a photon recoiling from an electron must always occur as an inelastic process.
However, one should always keep in mind that the amount of momentum passed onto the electron can be very small, as would be the case for a low energy photon that cannot excite electronic transitions. In this case, the energy transferred is tiny, so you can effectively treat the whole process as approximately elastic.
More formally, consider a photon which reflects 180 degrees from an electron. Then the momentum transfer to the electron is given by
$$\Delta p = 2\cdot\frac{ 2\pi \hbar}{\lambda}$$
So the energy gained by the electron is
$$\Delta E = \frac{\Delta p^2}{2m}=\frac{8\pi^2 \hbar^2}{m \lambda^2}$$
and the relative change in photon energy is given by
$$\frac{\Delta E}{E} = \frac{2 E}{m c^2}$$
where $E$ is the photon energy and $m c^2$ is the rest mass of the electron which is extremely large (511 keV) and is in the gamma ray range.
So for low energy photons (i.e. long wavelengths), $\lambda $ is large and $E \ll mc^2$ so the energy loss becomes tiny compared to the photon's energy. Therefore, you can treat the process as an effectively elastic collision.
