Physical origin of transverse waveguide modes I've been working with multimode lasers for a couple of months now, and whilst I have a good understanding of what their output looks like and what longitudinal modes are, I continue to be absolutely baffled by the idea of transverse modes, which determine the intensity distribution pattern across the width of the laser beam.
Extensive googling and reading hasn't returned more than 'this is because of the waveguide boundary conditions' or 'they are field distributions which reproduce themselves after one round trip' and something about 'cutoff frequency', none of which means anything to me.
What is different about photons in different modes? Is it the amplitude of the electric field that's different? Or is it something else?
I just don't understand how photons which all have the same wavelength can produce the electric fields shown in the figure below.

If someone could explain quantitatively and in simple terms how this is achieved I will be eternally grateful.
EDIT: so (I think) my question is, how do the electric fields of photons with the same wavelength (and therefore also the same electric field?) combine to give these different electric fields?
 A: First of all, you can use a classical formalism in order to understand a problem. Secondly, it is easier to consider a parallel plate wave guide instead of rectangular one. So you have an infinite dimension over x dimension an d dimension over y. There are several parameters determining a transverse wave. For example, $\beta = \sqrt{k-k_c^2}$ and $k_c =\frac{n\pi d} {d}$. As for a ${TM}_n$ wave you have
$$ E_z = A \sin{(n \pi y/d)} e^{-j\beta z}$$
$$ E_y = -\frac {j\beta}{k_c} A \cos{(n \pi y/d)} e^{-j\beta z}$$
$$ H_x =  \frac {j\omega \epsilon}{k_c} A \cos{(n \pi y/d)} e^{-j\beta z}$$
So you can see that $E_z \propto (e^{j n \pi y/d - j \beta z} -e^{-j n \pi y /d - j \beta z})$
You can write down other components the same way. So, going back to physics, it means that you have two waves propagating with a certain angle to the z axis, with  $ \vec{H}$ orienting towards x axis. Also:
$$ k \sin{\theta} = n\pi/d $$
$$ k \cos{\theta} = \beta $$
Also it is interesting to note that in y direction we observe a standing wave.
To sum up, the nature of the transverse mode is the interference of two waves sent in a waveguide.
For more info you can check the waveguide section of [Pozar, Microwave engineering, fourth edition, John Wiley & Sons]
A: Waves with the same wavelength can enter the waveguide at different incidence angles. If incidence angle is zero, you just get a longitudinal mode like $\mathrm{TE}_{00}$ propagating inside the waveguide.
If the incidence angle is nonzero, the wave will enter the waveguide, reflect from its wall towards another wall, then back again, and the superposition of the reflected waves will form a standing wave. This standing wave is what is depicted by the red lines in the OP's image.
Of course, while the wave is partially directed transversally, its wavevector also has a component along the axis of the waveguide. So, although there's a standing wave in transversal direction, the wave does have net longitudinal propagation (unless it's evanescent), so eventually it'll be detected at the other end of the waveguide.
In other words, the number $n$ in the notation like $\mathrm{TE}_{n0}$ means how much tilted the wavevector is relative to the axis of the waveguide. The restriction of $n$ to integers is due to the fact that only a multiple of $\lambda/2$ can fit in the transversal size of the waveguide to form a stable standing wave.
A: As Petr Polovodov says, this is a classical problem, and depending on how comfortable you are with PDEs, it's... actually still hard to understand.
First things first, note that waveguides are not resonant devices. (However, the lowest-order mode, the dominant mode, has a cutoff frequency determined by resonance, and this gives us e.g. the transverse resonance technique for finding cutoff frequencies.) When you see the sinusoidal patterns in the transverse (xy plane for propagation in z) plane, that is not wave propagation, and it's also not related to the freespace wavelength of the wave, or to the phase constant of the wave. It's just the amplitude envelope in the transverse direction, so make sure you don't fall into the trap of thinking that only certain frequencies (harmonically related) will "fit" into the waveguide.
A short answer to your question is "the wave equation and boundary conditions allow it." An answer to a small sub-problem is that in rectangular waveguides, you can equivalently view some propagation modes as composed of two independent bouncing waves which combine to give the actual standing wave. It's a case where it's indistinguishable from the scenario, so there's no harm in preferring one interpretation or the other.
Another perspective: When I think of boundary conditions, I think of voltages in a circuit. If we know the voltage at A is x and the voltage at B is y, then the circuit is determined and we can solve it. The voltages throughout the circuit are considered as being due to those known points if they're connected to a power source. Same thing for boundary conditions, especially because those voltages are actually boundary conditions anyway.
Math
First order of business, recall that for phasors, the source-free curl equations are:
$$ 
\begin{align}
\nabla \times \mathbf{E} &= -j\omega \mu \mathbf{H} \\
\nabla \times \mathbf{H} &= -j\omega \epsilon \mathbf{E}
\end{align}
$$
Plane waves of course are a particular subset of the solutions to the wave equation, and the Helmholtz wave equation in particular. The wave equation is derived from the curl equations, but the sets of equations are independent, so you can use both (curl and wave) to determine a system. The E and H fields both obey Helmholtz equations of the form:
$$
\nabla^2 \mathbf{E} + k^2 \mathbf{E} = 0
$$
Because the curl equations and vector wave equation are extremely general, we restrict our attention to solutions of the form:
$$
\begin{align}
\mathbf{E} &= (\mathbf{e}(x,y)+\hat{z}e_z(x,y))e^{-j\beta z} \\
\mathbf{H} &= (\mathbf{h}(x,y)+\hat{z}h_z(x,y))e^{-j\beta z}
\end{align}
$$
Where $\mathbf{e},\mathbf{h},e_z,h_z$ are complex amplitudes with magnitude and phase, and the spatial variation must be sinusoidal according to $e^{-j\beta z}$ for some unknown constant $\beta$ in the $z$-direction. (For TEM waves, $\beta$ is the familiar phase constant, $2\pi/\lambda$; in general, it is not.) This is still very general, the form given only enforces the sinusoidal requirement, both sinusoidal in time as well as space.
The above forms contain all solutions for TEM, TE, and TM modes of electromagnetic waves, including TEM plane waves, and even more complicated solutions. We distinguish between the $z$-component of the E-field or H-field and the transverse components $\mathbf{e},\mathbf{h}$, because we often have either $e_z=0$ or $h_z=0$ in practical problems, and the transverse components are often considered together anyway.
Note: The E-field and H-field components, and the general field vector directions, are unrelated to the direction of propagation. In plane waves, they form three mutually orthogonal vectors, but there's nothing that inherently requires them to have a relationship. Until we prescribe boundary conditions.
The cases of TEM, TE, and TM waves are special cases of the above form that allow us to simplify the solution to the curl equations and the wave equation. So, first let's use our general-ish form to simplify the curl equations to four coupled PDEs.
$$
\begin{align}
H_x &= \frac{j}{k_c^2}\left(\omega \epsilon \frac{\partial E_z}{\partial y} - \beta \frac{\partial H_z}{\partial x}\right) \\[1em]
H_y &= \frac{-j}{k_c^2}\left(\omega \epsilon \frac{\partial E_z}{\partial x} + \beta \frac{\partial H_z}{\partial y}\right) \\[1em]
E_x &= \frac{-j}{k_c^2}\left(\beta\frac{\partial E_z}{\partial x} + \omega\mu\frac{\partial H_z}{\partial y}\right) \\[1em]
E_y &= \frac{j}{k_c^2}\left(-\beta \frac{\partial E_z}{\partial y} + \omega\mu\frac{\partial H_z}{\partial x}\right) \\[1em]
\end{align}
$$
Solving these curl equations with the wave equation will give us our solution. In general, you develop a wave equation in one of the z-components, then use the curl equations to solve the other components. Except in TEM waves, where you use a Laplace equation in place of the wave equation for the z-components.
What we find for the transverse electric case, is that the $H_z$ component follows a "transverse" (2D) wave equation,
$$
\left(\frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2} + k_c^2\right) h_z = 0
$$
Where $ k_c^2 = k^2-\beta^2$, $k=\omega\sqrt{\mu \epsilon}$, and $\beta$ is determined by the boundary conditions. This applies for any TE case, not just inside a rectangular waveguide. For the transverse magnetic case, we find
$$
\left(\frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2} + k_c^2\right) e_z = 0
$$
Another general result, for all TM propagation modes.
Finally, if you solve for the TE modes in a rectangular waveguide by first solving the transverse Helmholtz equation with separation of variables, you get
$$
h_z(x,y) = (A\cos k_x x + B\sin k_x x)(C\cos k_y y + D\sin k_y y)
$$
And, with boundary conditions, the full z-component of the H-field is
$$
H_z = A_{mn} \cos \frac{m\pi x}{a} \cos \frac{n\pi y}{b} e^{-j\beta z}
$$
So we can plug this into the curl equations above and obtain expressions for $E_x, E_y, H_x, H_y$ for different values of integers $m,n$ (modes) in the form
$$
E_x = \frac{j\omega\mu n\pi}{k_c^2 b} A_{mn} \cos \frac{m\pi x}{a} \sin \frac{n\pi y}{b} e^{-j\beta Z}
$$
If you've got some experience with PDEs, these solutions shouldn't be all that surprising or unfamiliar. The $\cos$ and $\sin$ terms are responsible for the amplitude envelopes in the X and Y directions for the $x$-component of the E-field (where $x$ is taken to be in the direction of the long side for a rectangular cross-section, $y$ is in the direction of the short side).
So far, we haven't found that the fields must obey this form, but that they can. The way you excite the waveguide will obviously play a big roll in what modes are excited. But in general, in order to satisfy the boundary conditions, you need to have those sines and cosines in the amplitude envelope.
