standing wave
Standing wave

Standing waves, also known as stationary waves, are waves that oscillates in time but whose peak amplitude profile does not move in space. The peak amplitude of the wave oscillations at any point in space is constant with respect to time and the oscillations at different points throughout the wave are in phase, i.e. \[\Delta\phi\] is either zero or a multiple of \[2\pi\]. The locations at which the absolute value of the amplitude is minimum are called nodes, and the locations where the absolute value of the amplitude is maximum are called antinodes.
This phenomenon can occur in a stationary medium as a result of wave interference between two waves travelling in opposite directions or when the medium is moving in the direction opposite to the movement of the wave. The most common cause of standing waves is the phenomenon of resonance.
Mathematical description of a standing wave

Standing waves (most commonly) result from a right-moving travelling wave interfering with a left-moving one.
So, the wave equation for a right-moving wave is \[y_{R}(x,t)=A\sin \left( kx-\omega t+\phi_{1} \right)\] and for a left-moving wave, it is \[y_{L}=A\sin(kx+\omega t+\phi_{2})\]. To get rid of the phase shift, \[\phi\], one can either assume both they both have no phase shift, \[\phi_{1}=\phi_{2}=0\] or \[\phi_{2}-\phi_{1}=\pi\], i.e. the original wave hits a boundary (like the wall of a pipe as shown above) and gets its phase flipped by \[\pi\] upon reflection. We will show that both assumptions will lead to the same result.
So, starting with assuming both waves have no phase shift and have equal amplitude, we have simplify both equations into \[y_{R}(x,t)=A\sin(kx-\omega t)\] and \[y_{L}(x,t)=A\sin(kx+\omega t)\], then adding both waves together (as they interfere), \[y(x,t)=y_{R}+y_{L}=A\sin(kx-\omega t)+A\sin(kx+\omega t)\]. Using the trigonometric identity \[\sin a\pm\sin b=2\sin(\frac{a\pm b}{2})\cos(\frac{a\mp b}{2})\] and \[\cos\theta=\cos(-\theta)\],
Similarly, if we were to define \[\phi_{2}-\phi_{1}=\pi\], assuming that the first wave does not have phase shift, i.e. \[\phi_{1}=0\], \[\phi_{2}=\pi\]. Thus \[y(x,t)=A\sin(kx-\omega t)+A\sin(kx+\omega t+\pi)\], similar to the process above,
or an easier way one could achieve this is by utilising \[\sin(\theta+\pi)=-\sin\theta\] to get \[y(x,t)=A\sin(kx-\omega t)-A\sin(kx+\omega t)\] and start solving from there.
Either way, while this equation is mathematically distinct from the first, to a physicist it is essentially just referring to the same standing wave observed at a different position and time coordinates.
Visit here and press play to watch the equation in action. Notice that the wave goes up and down but is stationary.
We can then calculate where the positions of the nodes and antinodes are on any standing wave by substituting \[\sin(kx)=0\] for nodes, \[kx=\frac{2\pi}{\lambda}x=0,\pi,2\pi,3\pi,\dots\], which tells us that each node can be found at the positions \[x=0,\frac{\lambda}{2},\lambda,\frac{3\lambda}{2},\dots\], which is indeed consistent to our observations. Then, for antinodes, or positions where \[y\] oscillates between \[\pm A\], we substitute \[\sin(kx)=\pm1\], similar to the above, \[\sin(kx)=\pm1\implies x=\frac{\lambda}{4},\frac{3\lambda}{4},\frac{5\lambda}{4},\dots\].
Harmonics
When standing waves are formed due to boundaries enforced on a medium through which the waves propagate, such as a string with two ends fixed, we know that two ends have to be nodes. This means that only specific wavelengths can fit on the string of a fixed length, with nodes always at the ends, and otherwise nodes and antinodes alternating on the length of the string.
Harmonics for two fixed ends

Note that the first harmonic is the simplest standing wave that can form under these circumstances and has one antinode in the middle, making its wavelength twice the length of the boundaries. In the second harmonic, the wavelength then becomes equal to the distance between the boundaries, so on and so forth. This tells us that there are in fact an infinite number of harmonics for this system.
Harmonics for two free ends

This is similar to the scenario of two fixed ends. However, an open end will always be an antinode. If we imagine the waves to represent the displacement of air particles caused by sound waves, the open ends (and beyond) represent maximum displacement (antinode) of the air particles.
If the antinode at a open end is difficult to comprehend, think of it as sound waves between a restricted volume (by the boundaries) in the pipe and an unrestricted volume outside the pipe.
Harmonics for one fixed and one free end

The wavelengths for each harmonic relative to the length of the boundaries is slightly different than the previous two examples.