# 5.3: Second Order Ordinary Differential Equations with Boundary Conditions

• • Contributed by Marcia Levitus

Note

This section is also available in video format: http://tinyurl.com/n8tgbf6

You may have noticed that all the examples we discussed so far in this chapter involve initial conditions, or in other words, conditions evaluated at the same value of the independent value. We will see now how boundary conditions give rise to important consequences in the solutions of differential equations, which are extremely important in the description of atomic and molecular systems. Let’s start by asking ourselves whether all boundary value problems involving homogeneous second order ODEs have non-trivial solutions. The trivial solution is $$y(x)=0$$, which is a solution to any homogeneous ODE, but this solution is not particularly interesting from the physical point of view. For example, let’s solve the following problem:

$y''(x)+3y(x)=0; \;y('0)=0; \;y(1)=0 \nonumber$

Following the same procedure we have used in previous examples, we get the following general solution:

$y(x)=a\cos(\sqrt{3}x)+b\sin(\sqrt{3}x) \nonumber$

The first boundary condition is $$y'(0)=0$$:

$y'(x)=-\sqrt{3}a\sin(\sqrt{3}x)+\sqrt{3}b\cos(\sqrt{3}x)\rightarrow y'(0)=\sqrt{3}b=0 \rightarrow b=0 \nonumber$

Therefore, so far we have $$y(x)=a \cos({\sqrt{3}x})$$. The second boundary condition is $$y(1)=0$$, so

$y(1)=a \cos{\sqrt{3}}=0\rightarrow a=0 \nonumber$

Therefore, the only particular solution for these particular boundary conditions is $$y(x)=0$$, the trivial solution. Let’s change the question and ask ourselves now if there is any number $$\lambda$$, so that the equation

$y''(x)+\lambda y(x)=0; \;y'(0)=0; \;y(1)=0 \nonumber$

has a non-trivial solution. Our general solution depends on whether $$\lambda$$ is positive or negative. If $$\lambda>0$$ we have

$y(x)=a\cos(\sqrt{\lambda}x)+b\sin(\sqrt{\lambda}x) \nonumber$

Notice that we are using results be obtained in previous sections, but you would need to show all your work!

If $$\lambda<0$$ we have

$y(x)=ae^{\sqrt{ |\lambda|}x}+be^{-\sqrt{ |\lambda|}x} \nonumber$

where $$|\lambda|$$ is the absolute value of $$\lambda$$.

Let’s look at the case $$\lambda<0$$ first. The first boundary condition implies

$y'(x)= \sqrt{|\lambda|}a e^{\sqrt{ |\lambda|}x} -\sqrt{|\lambda|}b e^{-\sqrt{ |\lambda|}x}\rightarrow y'(0)=\sqrt{|\lambda|}(a-b)=0\rightarrow a=b \nonumber$

and therefore $$y(x)=a\left(e^{\sqrt{ |\lambda|}x}+e^{-\sqrt{ |\lambda|}x}\right)$$. Using the second boundary condition:

$y(1)=a\left(e^{\sqrt{ |\lambda|}}+e^{-\sqrt{ |\lambda|}}\right)=0\rightarrow a=0 \nonumber$

Therefore, if $$\lambda <0$$, the solution is always $$y(x)=0$$, the trivial solution.

Let’s see what happens if $$\lambda >0$$. The general solution is $$y(x)=a\cos(\sqrt{\lambda}x)+b\sin(\sqrt{\lambda}x)$$, and applying the first boundary condition:

$y'(x)=-\sqrt{\lambda}a\sin(\sqrt{\lambda}x)+\sqrt{\lambda}b\cos(\sqrt{\lambda}x)\rightarrow y'(0)=\sqrt{\lambda}b=0 \rightarrow b=0 \nonumber$

Therefore, so far we have $$y(x)=a \cos{\sqrt{\lambda}x}$$. The second boundary condition is $$y(1)=0$$, so

$y(1)=a \cos({\sqrt{\lambda}})=0 \nonumber$

As before, $$a=0$$ is certainly a possibility, but this again would give the trivial solution, which we are trying to avoid. However, this is not our only option, because there are some values of $$\lambda$$ that also make $$y(1)=0$$. These are $$\sqrt{\lambda}=\frac{\pi}{2}, \frac{3\pi}{2}, \frac{5\pi}{2}$$, or in terms of $$\lambda$$:

$\lambda=\frac{\pi^2}{4}, \frac{9\pi^2}{4}, \frac{25\pi^2}{4} \nonumber$

This means that

$y''(x)+ 3 y(x)=0; \;y'(0)=0; \;y(1)=0 \nonumber$

does not have a non-trivial solution, but

$y''(x)+ (\pi^2/4) y(x)=0; \;y'(0)=0; \;y(1)=0 \nonumber$

does. The values of $$\lambda$$ that guarantee that the differential equation has non-trivial solutions are called the eigenvalues of the equation. The non-trivial solutions are called the eigenfunctions of the equation. We just found the eigenvalues, but what about the eigenfunctions?

We just concluded that the solutions are $$y(x)=a \cos{\sqrt{\lambda}x}$$, and now we know that $$\sqrt{\lambda}=\frac{\pi}{2}, \frac{3\pi}{2}, \frac{5\pi}{2}$$. We can write the eigenfunctions as:

$y(x)=a \cos{\frac{(2n-1)\pi}{2}x} \; \; n=1, 2, 3... \nonumber$

We could also use $$(2n+1)$$ with $$n=0,1,2...$$. Notice that we do not have any information that allows us to calculate the constant $$a$$, so we leave it as an arbitrary constant.

Also, notice that although we have infinite eigenvalues, the eigenvalues are discrete. The term discrete means that the variable can take values for a countable set (like the natural numbers). The opposite of discrete is continuous (like the real numbers). These discrete eigenvalues have very important consequences in quantum mechanics. In fact, you probably know from your introductory chemistry classes that atoms and molecules have energy levels that are discrete. Electrons can occupy one orbital or the next, but cannot be in between. These energies are the eigenvalues of differential equations with boundary conditions, so this is an amazing example of what boundary conditions can do!