Vibrating String with Fixed Ends

Until now, we have been working only with the heat equation. Today, we are going to solve the one-dimensional wave equation with homogeneous boundary conditions and no sources, namely, utt=c2uxx,u(0,t)=0,u(L,t)=0,u(x,0)=f(x),ut(x,0)=g(x). As before, we want to use the method of separation of variables by setting u(x,t)=ϕ(x)h(t) and substituting above: ϕh=c2ϕh. We want to ignore trivial solutions. This implies our boundary conditions are ϕ(0)=0, and ϕ(L)=0.

Separating variables yields ϕϕ=hc2h=λ, Because functions of distinct independent variables can only be equal if they equate to the same constant, we have introduced the equality in blue (the negative sign is purely out of convenience later on).

We now have a system of two ordinary differential equations: (1)ϕ=λϕ,(2)h=λc2h. Equation (1) has three cases:

  1. λ<0:
  2. ϕ(x)=c1sinhλx+c2coshλx. Applying the boundary conditions to this yields ϕ(0)=c2=0,ϕ(L)=c1sinhλL=0c1=0. This is the trivial solution, so we drop it.
  3. λ=0:
  4. ϕ(x)=c1x+c2. Applying the boundary conditions to this yields ϕ(0)=c2=0,ϕ(L)=c1L=0c1=0. This is the trivial solution, so we drop it.
  5. λ>0:
  6. ϕ(x)=c1sinλx+c2cosλx. Applying the boundary conditions to this yields ϕ(0)=c2=0,ϕ(L)=c1sinλL=0λn=(nπL)2,ϕn(x)=CnsinnπxL.
Now that we know the value of λn, we can use it to solve equation (2): hn(t)=AnsinnπctL+BncosnπctL. Therefore, by the principle of superposition, we find that the solution to this partial differential equation is u(x,t)=n=1(GnsinnπctL+FncosnπctL)sinnπxL. The coefficients Fn and Gn can be found by applying the initial conditions: u(x,0)=n=1FnsinnπxL=f(x). ut(x,t)=n=1nπcL(GncosnπctLFnsinnπctL)sinnπxL,ut(x,0)=n=1GnnπcLsinnπxL=g(x). Finally, applying orthogonality principles to the above equations to find Fn and Gn yields Fn=2L0Lf(x)sinnπxLdx,Gn=2nπc0Lg(x)sinnπxLdx. Letting c=1, L=1, f(x)=sinx and g(x)=0 gives us the following wave (the approximation is very low):