version of 8 December 1997

VI.  Notes (played) on the vibrating string†

There are three basic models in the subject of partial differential equations, which describe very different physics and have very different mathematical properties.  They are simple in form, yet realistic for many problems in science and engineering.  Moreover, they teach us what to expect when we encounter more complicated equations used to model complicated laboratory situations.  They are:

The wave equation,

	utt = c2 uxx;							(WE)

the heat equation, also known as the diffusion equation,

	ut = k uxx;							(HE)

and the potential equation, also known as Poisson’s equation,

	uxx + uyy = a r(x,y),					(PE)

where r is a given function corresponding in electrostatics to a charge distribution, and the other quantities c, k, and a are physical constants.  Often there is no charge in the region where you want to measure a potential , and (PE) reduces to Laplace’s equation

	uxx + uyy = 0.						(LE)

One thing you are likely to notice if you take several advanced courses in science or engineering is that these same equations arise in many different contexts.  The function u may have a different interpretation in each incarnation, but the mathematics remains the same.  For example, the function u in (PE) or (LE) might be an electric potential, a magnetic potential, the height of a taut membrane, or the potential of the velocity field in a fluid.

The reason these equations arise again and again is that they are the most symmetric second order partial differential equations that can be written down.  Fundamental physical principles usually do not involve derivatives of higher than second order.  If a physical model is isotropic, has a superposition principle, and is based on fundamental physical principles, it is very likely to lead to an equation of one of these forms.  In the appendix, however, you will find a derivation of the wave equation for the problem of the vibrating string.

The mathematics and physics of the three types of equations differ in important ways, and lead to a classification of the equations as hyperbolic  (WE), parabolic  (HE), and elliptic (PE/LE).   Other second-order equations of a given type will share the qualitative features of our three models.

We shall begin our study of the method of separation of variables with the wave equation, which was in fact the first of these equations to be analyzed in this way.  The wave equation (WE) can be written with the aid of a wave operator
	
so that (WE) is the equation for the kernel of this operator.  This operator is also known as the d'Alembertian.  The wave equation is a linear, homogeneous equation, so the superposition principle holds for its solutions.  If we can find some solutions u1, ..., uk, then any linear combination of these solutions is again a solution.  We also classify it as "second-order," since derivatives up to second order occur, but no higher-order derivatives.  This will be the case for the great majority of PDE's in this class.  

We shall solve the wave equation in two entirely different ways.  The first method is known as separation of variables.  Let's set c = 1 for convenience.  (Equivalently, we could choose a clock with time variable t' = c t.)  Let's test out the wave operator by calculating its action on some representative functions:

	

Somewhat surprisingly, the second seemingly arbitrary function is a solution of the PDE!  As we shall see, there are lots of them, and several strategies for finding them.

With the method of separation of variables, we try to find solutions of a special form, u = T(t) X(x). This is a special assumption of form - what is referred to as an ansatz, to give some definiteness to our search for solutions.  Some other physical circumstances, called the boundary and initial conditions, will be quite important, and will constrain us in choosing T and X; a partial differential equation coupled with some boundary 
conditions will be called a boundary-value problem  .  For the vibrating string, the most common boundary conditions are the zero Dirichlet conditions, named after the German mathematician Gustav Lejeune-Dirichlet (1805-1859), a pioneer in the study of PDEs:
                      u(t,0) = 0,      u(t,L) = 0                                         (DBC)
This means that the string is fastened at two ends, x=0 and x=L.  Actually, if we assigned some other fixed values to u besides 0 at the end points, we could just redefine the dependent variable:
            If       u(t,0) = a,      u(t,L) = b,
            then define v := u(t,x) - a - (b-a) x/L.
Then v will still solve the wave equation, but will have the simpler boundary conditions (DBC).  When we act on a product T(t)X(x) with the wave operator and divide the result by T(t)X(x), we get

If u solves the wave equation, this expression must be zero.  (We could quibble about what happens when T or X = 0, but that would either mean that u is the uninteresting "trivial" solution or else the problem occurs only at isolated values of x and t.)  Thus 
           T''/T  = X''/X.
Since the left side is independent of x and the right side is independent of t, both sides must in fact a constant.  We don't know its value yet, so let us call it -m.  (It turns out to be negative.  

Thus   
	-X''(x) =  m X(x)						(6.1)

This sort of equation is similar to a matrix-vector equation in linear algebra and is called an eigenvalue equation.  The function X and the number m are both unknown, and are called and eigenfunction and eigenvalue.  We do not allow the possibility X(x) = 0 for all x.  While it is always a solution for all m, it is not useful.  By definition, an eigenfunction must be a nonzero solution of an equation like (6.1).  Along with (6.1) we have the boundary conditions
	X(0) = X(L) = 0						(6.2)
and this will restrict the m's for which (6.1) has nonzero solutions.  Eq. (6.1) is an elementary ordinary differential equation with the familiar solution (also obtainable with software),
	X(x,m) := D1 cos(r(m) x) + D2 sin(r(m) x).
                                                                                                              
Because of the boundary condition at x=0, we see that D1 = 0.  We are left with only one constant, which we can scale to 1, remembering that we may want to multiply our solution by an arbitrary constant later.  Because of the BC at x=0, we now know that up to a constant multiple, X(x) = Sin(r(m) x).  The other boundary condition in (6.2) tells us what the allowable choices for m are, namely   r(m)  = n p/L, n = 1,2,....  Taking L=1 for convenience, the eigenfunctions and eigenvalues are:

	Xn(x) := sin(n p x)

	mn := (n p)2

Now let's look at the other part of the PDE which we "separated off":

              T''(t) = -  m T(t)						(6.3)
              
As we saw, there are many possible values of m which are consistent with the boundary condition for the function X, and the same possibilities occur in equation (6.3) (multiply m by c2 if c is not set to 1).  Therefore Tn(t) = An cos(n p t) + Bn sin(n p t).  We cannot go further with the T function without being given the initial condition, that is, information about what happens at t=0.

We already have something of  importance in science and engineering, however:
the normal modes .  Many physical systems, like the vibrating string, preferentially undergo simple motions with pure frequencies.  Such a possible motion is exactly what we find by positing a product solution, imposing any boundary conditions, and solving the resulting eigenvalue problem.

Definition VI.1.  
A normal mode  of a boundary value problem is a product solution of the form 
	T(t) X(x),
where X(x) incorporates all boundary conditions.

Here the spatial variable x might be more than one-dimensional, as for the problem of the vibrating drum, which will be encountered later.  I have generalized the notion of a normal mode so that any time dependence is allowed, although most commonly it will be sinusoidal, T(t) = sin(w t + f).  When it is sinusoidal, the angular frequency w is usually a simple function of the eigenvalue.

The general solution we come up with is a linear combination of the particular solutions we get by separating the equation.  It is not yet obvious that this is a completely general solution, but it is.

		(6.4)

The coefficients A and B have to be determined from the initial conditions, that is, by the condition of the string at t=0.

Suppose that 
                    u(0,x) = f(x)  and ∂u(0,x)/∂t = g(x)                             (IC)
              
are given.  Plugging in to formula (6.4) shows that:

	
In other words, An are the Fourier sine coefficients for f(x), and the more complicated expression 
            (n p) Bn 
gives the Fourier sine coefficients of g(x).  Notice that the stuff in the sine is n p x/L and not   2 n p x/L  (with L=1).  In other words, there are more sines in this series than in the usual Fourier series, but there are no cosines.  It is precisely as if we imagine the string to be defined on the interval [-1,1], twice as long as the actual interval, but on the nonphysical part from x=-1 to x=0 we pretend that the shape of the string is defined to give us an odd function:  f(-x) = -f(x).  This would give us only sine functions, as we have seen before.  Earlier we called those coefficients Bn, but here they happen to be called An.  The thing to remember is that since they go along with sine functions (of x) the formula for them contains sines.  we would thus write
	
but we can simplify this a bit by using the symmetry:
	
What about the other coefficients?  Well, this time it is the whole expression  (n p) Bn  which is a Fourier sine coefficient for g(x), so we need to divide through by the extra factor:

Here is an example to illustrate the situation. 

Model Problem VI.2.  Solve the problem of the vibrating string using Fourier sine series, and initial conditions u(x,0) = 0, ut(x,0) = 1.  

Solution.

We can easily calculate the formulae for the coefficients A and B, either by hand or with software:
	Am = 0
and

If n is even, Bn = 0, else Bn = f(4,n2 p2).

The general solution is:

Next we show some plots of the solution at various times.  For computational purposes we keep terms only up to n=7.  With software you can see the string vibrate by selecting the graphs and choosing "animate."  By the way, infinity is larger than 7, but 7 is close enough to give us a reasonable picture of the solution:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

The boundary conditions we have been using are not the only useful ones.  Suppose that our string is attached to a pair of tracks in the vertical direction perpendicular to the x-axis using a frictionless roller.  Then u(t,0) and u(t,L) are not specified, but instead we have:

	                      (NBC)

These are called Neumann boundary conditions. after the German physicist F.E. Neumann (1798-1895), who used them in his investigations of electricity and magnetism.  Obviously, as with DBC, it would be a minor change to impose them at x=a and x=b where a does not have to be 0.  At this stage, we can exactly repeat the analysis of separation of variables, until the point where we first used the boundary conditions, i.e., (6.1).  With NBC, we instead evaluate the x-derivative at 0:

Model Problem VI.3.  Set up the general solution of the vibrating string with Neumann BC., with the simplifications c = L = 1.

Solution.
The partial differential equation separates exactly as before, so we still know that when we assume u = X(x) T(t), we get separated equations (6.1) and (6.3).  The values of m will be different, however, because they were determined by the BC.  Since as before,
	X(x,m) := D1 cos(r(m) x) + D2 sin(r(m) x),
we see that
	X'(x,m) := - r(m)  D1 sin(r(m) x) + r(m)  D2 cos(r(m) x),
and for this to be 0 when x=0, there are two possibilities, namely D1=0 or m=0.  (We ignored the latter possibility before since sin(0) = 0 is not a useful solution, but cos(0) = 1 can be one.)

Possibility 1.  m=0, which means that the output just given is not really the solution to (6.1), which has become  X''(x) = 0.  The solutions of this are of the form A + B x, but B has to be 0 so that X'(0) = 0.  Thus with this possibility, X(x) = 1 (times any constant).  Eq. (6.3) now also becomes T''(t) = 0, which leads to the product solution of (WE):
	(A0 + B0 t) 1 = A0 + B0 t.

Since the boundary conditions do not apply to the t variable, we keep the general linear combination.  A0 and B0 will be determined by the initial conditions.

Possibility 2.  m > 0.  The boundary condition at x=0 now forces X(x) = cos(r(m) x) (again, up to a constant multiple), and the other boundary condition forces one of the values mn = (n p)2.  The product solutions become
	(An cos(n p t) + Bn sin(n p t)) cos(n p t)
and the general solution will be

		  (6.5)

The coefficients are determined by the initial conditions because:

and
	
The numbers An are the Fourier cosine coefficients of u(x,0) = f(x), while B0 and npBn are the Fourier cosine coefficients of ut(x,0) = g(x).  (Notice the extra factors of np.)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
A realistic string or optical fiber may not be uniform, so some of the simplifying assumptions in our derivation fo the wave equation are not valid. For example,
the constant c2 = (spring constant) / (mass density) for the spring may be different
at different positions, leading to an equation of the form

	                                                  (ModWE1)
or, as a thorough examination of the derivation of the wave equation reveals,
we could more generally have:
	 			       (ModWE2)

for some potentially complicated positive functions p(x) and s(x). How well does 
the method of separation of variables do for problems like this?  Rather well, 
actually, although we may have to encounter some new functions.<P>

Model Problem VI.4. Suppose that the wave speed depends on position, so that

	c2 = 1/(1 + x), 0 < x < 1, with DBC at 0 and 1.
Find the normal modes of vibration

Solution (using software).

When we attempt to solve the equation with the ansatz u(t,x) = T(t) X(x), we find the 
following eigenvalue problem.

	- X"(x) = (1 + x) m X(x)

There are actually some special functions, called Airy functions, which solve the ODE 
y''(x) = x y. Two independent solutions are called Ai(x) and Bi(x):

	
		The Airy function Ai(x).

	
		The Airy function Bi(x).

The function Bi explodes exponentially to the right, while Ai decays exponentially. They 
both oscillate to the left (why?). By changing variables we can get these functions to solve 
our eigenvalue equation:  If 

	y(x) := Ai(- m1/3 (x+1)),
then
	y''(x) = - m (1+x) y(x),

and similarly for Bi(- m1/3 (x+1)).

We need a linear combination 
	u(x) = Ai(- m1/3 (1+x)) + C Bi ( - m1/3 (1+x)) which is 0 
at x=0 and 0 at x=1. Mathematica or Maple can solve for these conditions numerically, and we find:

	m1/3 = 1.87088, C = 0.819688.

A plot of the function u shows that it has no nodes between 0 and 1:

It thus resembles sin(p x), indicating that this is the spatial part of the fundamental (lowest-frequency) mode. The eigenfunction and eigenvalue are numerically:

	Ai(-1.87088 (1 + x)) + 0.819688 Bi(-1.87088 (1 + x)),
	m = 6.54844
   
The time-dependence is a combination 
	A0 cos(6.54844 t) + B0 sin(6.54844 t).

The second eigenfunction and eigenvalue correspond to a solution which changes sign once between 0 and 1:

	Ai(-2.98005 (1+x)) -1.75913 Bi(-2.98005 (1+x))
	m = 26.4649

		The second eigenfunction

Exercises VI

VI.1.  Solve the wave equation with NBC at 0 and 1 and:
                     f(x) = |x-1/2|,  g(x) = x2
Do you encounter any difficulties because the IC are not consistent with the BC?

VI.2.  Put DBC at x=0 and NBC at x=L.  Separate variables, solve the eigenvalue problem for X(x), and write down a general solution.

VI.3.  Solve the wave equation   utt = uxx  with IC:
                     f(x) = sin(px),  g(x) = 0
and
a)  DBC at x=0 and x=1
b)  NBC at x=0 and x=1
c)  DBC at x=0 and NBC at x=1

Plot the solutions and compare.

VI.4.  Solve the wave equation with IC:
                     f(x) = 0,  g(x) = 1
and
a)  DBC at x=0 and x=1
b)  NBC at x=0 and x=1
c)  DBC at x=0 and NBC at x=1

Plot the solutions and compare.

VI.5.  Solve the wave equation with IC:
                     f(x) = sin(px),  g(x) = 1
and
a)  DBC at x=0 and x=1
b)  NBC at x=0 and x=1
c)  DBC at x=0 and NBC at x=1

Plot the solutions and compare.

VI.6.  Solve the wave equation   utt = 4 uxx  for 0 < x < p, 0 < t < ∞, 
initial conditions:

and

Dirichlet boundary conditions at x=0 and x=p, i.e., u(t,0) = u(t,p) = 0, for 0 < t.  

VI.7.  Find all normal modes (product solutions) for the modified wave equation 
	utt + u =  uxx
with Neumann boundary conditions:
	ux(t,0) = 0
	ux(t,p) = 0

VI.8.  (Refer to the appendix for the derivation of the wave equation for this problem.)  Derive a wave equation for the vibrating string if the x-axis is horizontal and we take gravity into account.  The gravitational potential energy of the string is 
	
where g, the gravitational constant, is approximately 980 in the cgs system.

Appendix.  Derivation of the wave equation.

The physics and mathematics of the vibrating string were studied by Jean le Rond 
d'Alembert and later by Joseph Louis Lagrange, Leonhard Euler and Daniel Bernoulli, who gave the first satisfactory discussion of the physics of the vibrating string.  I have not been able to locate a detailed discussion of Bernoulli's derivation of the wave equation, but it is likely that he based it on an energy principle, somewhat as follows.

First let us recall that in classical mechanics, Newton's equations for the motion of a particle are equivalent to the vanishing of the first variation of the Lagrangian action integral, 

The kinetic energy is usually of the form
	
while the potential energy PE may be a function of position, U(q).  (I call the position q to avoid confusion with an x used below).  The action integral is calculated along a trajectory C = (q(t)) beginning at position and time coordinates (q0, t0) and ending at coordinates (q1, t1).  The trajectory chosen by physics is one which is stationary with respect to variations of the path.  In other words, if we replace C with 
	Cd = (q(t) + d h(t)), 
where h(t) is a smooth function with h(t0) = h(t1) = 0, and we calculate L(d), then 
	L' (0) = 0.
(You may hear that the physical trajectory minimizes the action, but this is only a necessary condition for minimum, and the physical trajectory is not always an actual minimum.)  If we expand L  in powers of d and retain only the first-order term, the stationary condition becomes
	
and if we integrate by parts, it is:
	
(The boundary terms vanish because of the conditions h(t0) = h(t1) = 0, which served to fix the beginning and end of the trajectory.)  If, now, we let the three components of h range over a complete set such as sin(n p t/L), with L = t1-t0, we see that the only possibility is for 
	
which is Newton's law.

The big advantage of Lagrangian mechanics is that it allows us relatively easily to find the equations of motion of an extended body, such as a string.  Suppose now that we have a taut string along the x-axis between positions a and b, but displaced laterally by an amount u(t,x).  If the density is r, then the kinetic energy of a small bit of string at position x is
	
so the total kinetic energy is 
	
It is plausible that the microscopic force transmitted by the string to a point x is proportional to the amount by which the string is stretched at x, i.e., it depends on the arc length element ds at x.  As we know, 
	
Thus we may assume that the differential potential energy depends on u only through ∂u/∂x.  The total potential energy would be of the form
	
The Lagrangian action integral will be the integral of KE - PE with respect to time.  Notice that it is u and not x which corresponds to the q used above; the "trajectory" of the string is specified by the function u(t,x), and a variation would entail replacing u(t,x) with
	u(t,x) + d h(t,x),
where h(t0,x) = h(t1,x) = 0.  If the ends of the string are fixed, we would also have
h(t,a) = h(t,b) = 0.  The action is a double integral,
	
and if we use Taylor's theorem to keep only the first-order term in d, Lagrange's condition reads:
	
This general formula may be useful in deriving realistic wave equations for non-homogeneous strings, but let us simplify at this stage by assuming that r and T := 2 F' are constants.  If we integrate the first integrand by parts in the t variable and the second by parts in the x variable, we now find that:

If h is arbitrary enough to run through a complete set, we must conclude that 
	utt = c2 uxx,                                                                  (WE)
with c2 = T/r a positive constant with dimensions of velocity2.

Judging from guitar strings, for which a 1 meter taut string gives a musical note in the mid range of the musical scale, typical values of c for thin metal strings are on the order of 1000 m./sec.  The wave equation (WE) also describes one-dimensional acoustic waves (c ≈ 344 m/sec. in air at room temperature or 330 m./sec. at 0 C) and light waves (c ≈ 3 ¥ 108 m./sec.), although the derivation is not the same in these cases.