In electromagnetic theory, do photons obey the inverse-square law? The energy ($E$) of a photon depends on its frequency ($f$):
$$E = hf = hc/\lambda$$
Notes:

*

*$E$ = energy of the photon (in joules)
*$h$ = the Plank constant ($6.63 \times 10^{-34}$ joules)

*$f$ = frequency in hertz, Hz

*$c$ = speed of light

*$\lambda$ = wavelength

This seems to yield an invariant value of $E$.
How can that be reconciled with the inverse-square law, whereby the intensity (field strength) of a light-source reduces with increasing distance from the light-source?
 A: The confusion comes from mixing the classical and QM theories of light. In reality, the classical theory is beautifully built up by the herd of photons as described in QM.
https://motls.blogspot.com/2011/11/how-classical-fields-particles-emerge.html
In your example, as you move away from the source, the same number of photons is distributed over a larger area.

Therefore, if you move away from a light source, the same number of photons is distributed over a larger area, thus decreasing the intensity. So it is not an effect of an individual photon, but of the distribution of all the photons emitted.

How does a photon lose intensity as it passes through space?
What this tells us is that the number of photons per unit area (as you say intensity) decreases as you go away from the source. Of course, because the EM wave spreads spherically from the point source, and as it does, the same EM wave has to cover a larger surface area (the expanding sphere if you will). Since the unit area is constant, and the energy content of the EM wave is constant (in your example), the number of photons per unit area has to decrease as the surface area increases.
A: The electromagnetic field is to photons what the Schrödinger or Klein-Gordon wave function is to electrons. It gives the probability of finding photons or their properties, such as energy and momentum. It is this probability that falls off as $r^{-2}$ for all but exact plane waves, which do not exist.
