We applied separation of variables to this problem in Example 3 of the previous section. So, if we assume the solution is in the form,

\[u\left( {x,t} \right) = \varphi \left( x \right)G\left( t \right)\]

we get the following two ordinary differential equations that we need to solve.

\[\begin{align*}\frac{{dG}}{{dt}} = - k\lambda G\hspace{0.25in} & \frac{{{d^2}\varphi }}{{d{x^2}}} + \lambda \varphi = 0\\ & \varphi \left( { - L} \right) = \varphi \left( L \right)\hspace{0.25in}\frac{{d\varphi }}{{dx}}\left( { - L} \right) = \frac{{d\varphi }}{{dx}}\left( L \right)\end{align*}\]

As we’ve seen with the previous two problems we’ve already solved a boundary value problem like this one back in the Eigenvalues and Eigenfunctions section of the previous chapter, Example 3 to be exact with \(L = \pi \). So, if you need a little more explanation of what’s going on here go back to this example and you can see a little more explanation.

We again have three cases to deal with here.

\(\underline {\lambda > 0} \)

The general solution to the differential equation is,

\[\varphi \left( x \right) = {c_1}\cos \left( {\sqrt \lambda \,x} \right) + {c_2}\sin \left( {\sqrt \lambda \,x} \right)\]

Applying the first boundary condition and recalling that cosine is an even function and sine is an odd function gives us,

\[\begin{align*}{c_1}\cos \left( { - L\sqrt \lambda } \right) + {c_2}\sin \left( { - L\sqrt \lambda } \right)& = {c_1}\cos \left( {L\sqrt \lambda } \right) + {c_2}\sin \left( {L\sqrt \lambda } \right)\\ - {c_2}\sin \left( {L\sqrt \lambda } \right) & = {c_2}\sin \left( {L\sqrt \lambda } \right)\\ 0 & = 2{c_2}\sin \left( {L\sqrt \lambda } \right)\end{align*}\]

At this stage we can’t really say anything as either \({c_2}\) or sine could be zero. So, let’s apply the second boundary condition and see what we get.

\[\begin{align*} - \sqrt \lambda \,{c_1}\sin \left( { - L\sqrt \lambda } \right) + \sqrt \lambda \,{c_2}\cos \left( { - L\sqrt \lambda } \right) & = - \sqrt \lambda \,{c_1}\sin \left( {L\sqrt \lambda } \right) + \sqrt \lambda \,{c_2}\cos \left( {L\sqrt \lambda } \right)\\ \sqrt \lambda \,{c_1}\sin \left( {L\sqrt \lambda } \right) & = - \sqrt \lambda \,{c_1}\sin \left( {L\sqrt \lambda
} \right)\\ 2\sqrt \lambda \,{c_1}\sin \left( {L\sqrt \lambda } \right) & = 0\end{align*}\]

We get something similar. However, notice that if \(\sin \left( {L\sqrt \lambda } \right) \ne 0\) then we would be forced to have \({c_1} = {c_2} = 0\) and this would give us the trivial solution which we don’t want.

This means therefore that we must have \(\sin \left( {L\sqrt \lambda } \right) = 0\) which in turn means (from work in our previous examples) that the positive eigenvalues for this problem are,

\[{\lambda _{\,n}} = {\left( {\frac{{n\pi }}{L}} \right)^2}\hspace{0.25in}n = 1,2,3, \ldots \]

Now, there is no reason to believe that \({c_1} = 0\) or \({c_2} = 0\). All we know is that they both can’t be zero and so that means that we in fact have two sets of eigenfunctions for this problem corresponding to positive eigenvalues. They are,

\[{\varphi _n}\left( x \right) = \cos \left( {\frac{{n\pi x}}{L}} \right)\hspace{0.25in}{\varphi _n}\left( x \right) = \sin \left( {\frac{{n\pi x}}{L}} \right)\hspace{0.25in}n = 1,2,3, \ldots \]

\(\underline {\lambda = 0} \)

The general solution in this case is,

\[\varphi \left( x \right) = {c_1} + {c_2}x\]

Applying the first boundary condition gives,

\[\begin{align*}{c_1} + {c_2}\left( { - L} \right) & = {c_1} + {c_2}\left( L \right)\\ 2L{c_2} & = 0\hspace{0.25in} \Rightarrow \hspace{0.25in}{c_2} = 0\end{align*}\]

The general solution is then,

\[\varphi \left( x \right) = {c_1}\]

and this will trivially satisfy the second boundary condition. Therefore \(\lambda = 0\) is an eigenvalue for this BVP and the eigenfunctions corresponding to this eigenvalue is,

\[\varphi \left( x \right) = 1\]

\(\underline {\lambda < 0} \)

For this final case the general solution here is,

\[\varphi \left( x \right) = {c_1}\cosh \left( {\sqrt { - \lambda } \,x} \right) + {c_2}\sinh \left( {\sqrt { - \lambda } \,x} \right)\]

Applying the first boundary condition and using the fact that hyperbolic cosine is even and hyperbolic sine is odd gives,

\[\begin{align*}{c_1}\cosh \left( { - L\sqrt { - \lambda } } \right) + {c_2}\sinh \left( { - L\sqrt { - \lambda } } \right) & = {c_1}\cosh \left( {L\sqrt { - \lambda } } \right) + {c_2}\sinh \left( {L\sqrt { - \lambda } } \right)\\ - {c_2}\sinh \left( { - L\sqrt { - \lambda } } \right) & = {c_2}\sinh \left( {L\sqrt { - \lambda } } \right)\\ 2{c_2}\sinh \left( {L\sqrt { - \lambda } } \right) & = 0\end{align*}\]

Now, in this case we are assuming that \(\lambda < 0\) and so \(L\sqrt { - \lambda } \ne 0\). This turn tells us that \(\sinh \left( {L\sqrt { - \lambda } } \right) \ne 0\). We therefore must have \({c_2} = 0\).

Let’s now apply the second boundary condition to get,

\[\begin{align*}\sqrt { - \lambda } \,{c_1}\sinh \left( { - L\sqrt { - \lambda } } \right) & = \sqrt { - \lambda } \,{c_1}\sinh \left( {L\sqrt { - \lambda } } \right)\\ 2\sqrt { - \lambda } \,{c_1}\sinh \left( {L\sqrt { - \lambda } } \right) & = 0\hspace{0.25in} \Rightarrow \hspace{0.25in}{c_1} = 0\end{align*}\]

By our assumption on \(\lambda \) we again have no choice here but to have \({c_1} = 0\) and so for this boundary value problem there are no negative eigenvalues.

Summarizing up then we have the following sets of eigenvalues and eigenfunctions and note that we’ve merged the \(\lambda = 0\) case into the cosine case since it can be here to simplify things up a little.

\[\begin{align*}{\lambda _{\,n}} & = {\left( {\frac{{n\pi }}{L}} \right)^2} & \hspace{0.25in}{\varphi _n}\left( x \right) & = \cos \left( {\frac{{n\,\pi x}}{L}} \right)\hspace{0.25in}n = 0,1,2,3, \ldots \\ {\lambda _{\,n}} & = {\left( {\frac{{n\pi }}{L}} \right)^2} & \hspace{0.25in}{\varphi _n}\left( x \right) & = \sin \left( {\frac{{n\,\pi x}}{L}} \right)\hspace{0.25in}n = 1,2,3, \ldots \end{align*}\]

The time problem is again identical to the two we’ve already worked here and so we have,

\[G\left( t \right) = c{{\bf{e}}^{ - k{{\left( {\frac{{n\pi }}{L}} \right)}^2}\,t}}\]

Now, this example is a little different from the previous two heat problems that we’ve looked at. In this case we actually have two different possible product solutions that will satisfy the partial differential equation and the boundary conditions. They are,

\[\begin{align*}{u_n}\left( {x,t} \right) & = {A_n}\cos \left( {\frac{{n\pi x}}{L}} \right){{\bf{e}}^{ - k{{\left( {\frac{{n\pi }}{L}} \right)}^2}\,t}}\hspace{0.25in}n = 0,1,2,3, \ldots \\ {u_n}\left( {x,t} \right) & = {B_n}\sin \left( {\frac{{n\pi x}}{L}} \right){{\bf{e}}^{ - k{{\left( {\frac{{n\pi }}{L}} \right)}^2}\,t}}\hspace{0.25in}n = 1,2,3, \ldots \end{align*}\]

The Principle of Superposition is still valid however and so a sum of any of these will also be a solution and so the solution to this partial differential equation is,

\[u\left( {x,t} \right) = \sum\limits_{n = 0}^\infty {{A_n}\cos \left( {\frac{{n\pi x}}{L}} \right){{\bf{e}}^{ - k{{\left( {\frac{{n\pi }}{L}} \right)}^2}\,t}}} + \sum\limits_{n = 1}^\infty {{B_n}\sin \left( {\frac{{n\pi x}}{L}} \right){{\bf{e}}^{ - k{{\left( {\frac{{n\pi }}{L}} \right)}^2}\,t}}} \]

If we apply the initial condition to this we get,

\[u\left( {x,0} \right) = f\left( x \right) = \sum\limits_{n = 0}^\infty {{A_n}\cos \left( {\frac{{n\pi x}}{L}} \right)} + \sum\limits_{n = 1}^\infty {{B_n}\sin \left( {\frac{{n\pi x}}{L}} \right)} \]

and just as we saw in the previous two examples we get a Fourier series. The difference this time is that we get the full Fourier series for a piecewise smooth initial condition on \( - L \le x \le L\). As noted for the previous two examples we could either rederive formulas for the coefficients using the orthogonality of the sines and cosines or we can recall the work we’ve already done. There’s really no reason at this point to redo work already done so the coefficients are given by,

\[\begin{align*}{A_0} & = \frac{1}{{2L}}\int_{{\, - L}}^{L}{{f\left( x \right)\,dx}}\\ {A_n} & = \frac{1}{L}\int_{{\, - L}}^{L}{{f\left( x \right)\cos \left( {\frac{{n\,\pi x}}{L}} \right)\,dx}}\hspace{0.25in}n = 1,2,3, \ldots \\ {B_n} & = \frac{1}{L}\int_{{\, - L}}^{L}{{f\left( x \right)\sin \left( {\frac{{n\,\pi x}}{L}} \right)\,dx}}\hspace{0.25in}n = 1,2,3, \ldots \end{align*}\]

Note that this is the reason for setting up \(x\) as we did at the start of this problem. A full Fourier series needs an interval of \( - L \le x \le L\) whereas the Fourier sine and cosines series we saw in the first two problems need \(0 \le x \le L\).