1. The wave equation for a string
Take a stretched string with tension and mass per unit length , and a short piece of it of length . If the string is curved there, the tension pulls on the two ends of the piece in slightly different directions, and the vertical parts don't cancel. For small displacements the net vertical force is — proportional to the curvature. Newton's second law for the piece (mass ) gives
\quad\Longrightarrow\quad \frac{\partial^2 y}{\partial t^2} = v^2\,\frac{\partial^2 y}{\partial x^2}, \qquad v = \sqrt{\frac{T}{\mu}}.$$ So tension and mass per length set the wave speed: a tighter or lighter string carries waves faster. ## 2. The fixed ends A guitar string is clamped at $x = 0$ (the bridge) and $x = L$ (the nut or your finger). Whatever the string does, those two points never move: $$y(0,t) = 0, \qquad y(L,t) = 0 \quad \text{for all } t.$$ These two **boundary conditions** are what select the notes. ## 3. Standing waves: an eigenvalue problem Look for motions in which the whole string keeps one shape and just oscillates in time: $y(x,t) = X(x)\cos(\omega t)$. Substituting into the wave equation, the $\cos(\omega t)$ cancels: $$\frac{\mathrm{d}^2 X}{\mathrm{d}x^2} = -k^2\,X, \qquad k = \frac{\omega}{v}.$$ Read it as: *take the curvature of the shape and you get the same shape back, multiplied by a number.* A function that an operation (here $\mathrm{d}^2/\mathrm{d}x^2$) only rescales is an **eigenfunction** of it, and the factor ($-k^2$) is its **eigenvalue**. The solutions are $\sin kx$ and $\cos kx$. The end $x = 0$ rules out $\cos kx$ (it equals 1 there), so $X(x) = A\sin kx$. The end $x = L$ then demands $\sin kL = 0$, so $kL$ must be a whole multiple of $\pi$: $$k_n = \frac{n\pi}{L}, \qquad \lambda_n = \frac{2\pi}{k_n} = \frac{2L}{n}, \qquad n = 1, 2, 3, \dots$$ That is $L = n\,\dfrac{\lambda_n}{2}$: only waves that fit a **whole number of half-wavelengths** between the ends survive. Any other wave, bouncing between the ends, meets its own reflections out of step and cancels. ## 4. The allowed notes Each allowed wavelength gives one allowed frequency, $f = \dfrac{\omega}{2\pi} = \dfrac{v\,k}{2\pi}$: $$f_n = \frac{n\,v}{2L} = \frac{n}{2L}\sqrt{\frac{T}{\mu}}.$$ $f_1$ is the **fundamental**; $f_2 = 2f_1$, $f_3 = 3f_1, \dots$ are the **harmonics**. Mode $n$ has $n$ loops and $n + 1$ nodes (counting both ends), at $x = mL/n$. Shorter, tighter or lighter strings play higher notes — exactly how a guitarist frets and tunes. ## 5. Pluck it anywhere A real pluck is not one pure mode. The string's motion is a **sum** of the modes (the equation is linear, so superposition holds): $$y(x,t) = \sum_{n} A_n \sin\!\left(\frac{n\pi x}{L}\right)\cos(2\pi f_n t + \varphi_n).$$ Where and how hard you pluck only changes the amplitudes $A_n$ — the mix of harmonics, i.e. the timbre. The frequencies $f_n$ come from $L$, $T$ and $\mu$ alone. (Pluck exactly in the middle and every even mode, which has a node there, gets $A_n = 0$.) A real string is slightly stiff, so its overtones sit a little above $n f_1$; the result above is for an ideal string. ## 6. The same maths as an atom An electron confined between two walls obeys the time-independent Schrödinger equation $$-\frac{\hbar^2}{2m}\,\frac{\mathrm{d}^2\psi}{\mathrm{d}x^2} = E\,\psi, \qquad \psi(0) = \psi(L) = 0.$$ It is the same eigenvalue problem with the same boundary conditions, so the same shapes and $k_n = n\pi/L$ come out. The only change is what the eigenvalue means: there it is an energy, $E_n = \dfrac{\hbar^2 k_n^2}{2m} = \dfrac{n^2 h^2}{8mL^2}$, which grows as $n^2$, while the string's frequency grows as $n$. Allowed notes and allowed energy levels are both eigenvalues.