Second Order differential equations

We are only going to look at a particular subset of all possible second order differential equations (that is, equations which contain at most second derivatives) but these particular equations are absolutely ubiquitous across every field of science. The particular subset we are going to look at are linear, homogenous second order differential equations with constant coefficients. These can be written in general as:

 

\frac{d^2y}{dx^2}+b\frac{dy}{dx}+c y=0

 

It is linear because it contains at most (and in this case at least) a single power of y in each term. It is homogenous because there is no term which has no powers of y (ie. the right hand side is not a constant), and the coefficients b and c are any real numbers (though you can extend this to having complex numbers very easily). We will see that depending on the relationship between these numbers (b and c) we can have very different behaviour of the equation. Let’s first of all rearrange this equation and see what it says:

 

\frac{d^2y}{dx^2}=-b\frac{dy}{dx}-c y

 

This says that we are looking for a function whose second derivative at any point is linked only to its first derivative and value. In fact we can guess a solution to this equation because we already know a function whose derivatives look very much like the function without any derivatives. These are exponential functions. Let’s take the original equation and plug in a trial solution. Let’s guess that the solution might look something like y=e^{rx} for some value of r. First we plug this into the original equation and see if this is a solution:

 

\frac{d^2e^{rx}}{dx^2}+b\frac{de^{rx}}{dx}+c e^{rx}=0

 

This can be rewritten as:

 

e^{rx}\left(r^2+rb+c\right)=0

 

r^2+rb+c is known as the characteristic equation for the differential equation.

Check that you understand where this comes from. We hoped to find a solution to the equation, but clearly this will only be a solution if either e^{rx}=0 or \left(r^2+rb+c\right)=0. The former can’t be true for all x except if r=-\infty and that’s not a very interesting solution. The latter however is a good constraint and says that:

 

r=\frac{-b\pm\sqrt{b^2-4c}}{2}

 

This means that the solution is:

 

y=e^{\frac{-b\pm\sqrt{b^2-4c}}{2}x}

 

Check that this is indeed a solution. In fact we can see that in general there will be two solutions (except when b^2=4c). Let’s take an example equation. Let’s look at:

 

\frac{d^2y}{dx^2}-2\frac{dy}{dx}-3y=0

 

Check that the solutions to this equation are y=e^{3x} and y=e^{-x}.

Now the linearity of the equation comes into effect. If y=e^{3x} is a solution then so is y=ke^{3x} for any k. This wouldn’t be true if the equation wasn’t linear or homogeneous.

 

Theorem: If y_1=e^{r_1x} and y_2=e^{r_2x} are two solutions to a differential equation \frac{d^2y}{dx^2}+b\frac{dy}{dx}+c y=0, then so is the combination y=k_1y_1+k_2y_2 for any constants k_1 and k_2.

This means that if we find two solutions to such a differential equation we can combine them in a linear fashion with whatever coefficients we want. In fact the two coefficients will turn out to be the free constants which we can fix with two initial conditions. For all of the differential equations that we are dealing with, the number of boundary conditions are equal to the order of the differential equation. A second order differential equation is fixed with two initial conditions.

A good example of a second order differential equation is the equation which governs projectile motion, like throwing a ball. A second order linear differential equation will tell you the trajectory of the ball after you let go. However, in order to predict the trajectory, you need to know two things. The initial position, and the initial velocity of the projectile.

In general you will fix the two constants for a second order differential equation by being given an initial value for y and also an initial gradient of y. Or you can fix the two constants by being given the value of y at two different values of x. Having the two constants k_1 and k_2 will be enough to fix everything. However, before we understand about completely general solutions and what we need for that, we have to understand about independent solutions.

Two solutions to a differential equation are said to be independent if one of them is not a constant multiple of the other. ie. y=3e^x and y=e^x are not independent but y=3e^x and y=5e^{2x} are independent.

It is a general theorem of these differential equations that ALL solutions to the equation can be written in the form y=k_1y_1+k_2y_2 where y_1 and y_2 are two independent solutions. It doesn’t matter which two independent solutions, you can always add together two independent solutions in two different ways to get two more independent solutions. For instance, let’s say we have found two independent solutions y_1 and y_2. Then y_3=y_1+y_2 and y_4=y_1-y_2 are also independent solutions. Then any solution can be written as y=k_1y_1+k_2y_2 or y=k_3y_3+k_4 y_4 for particular choices of k_1 and k_2 or k_3 and k_4.

Now, this means that as long as we can find two independent solutions, then we have found all of the solutions. This is the same statement that for a first order linear equation, as soon as we’ve found the general solution which includes a single integration constant, then we’ve found all of the solutions. It turns out that there are three different possible scenarios, depending on the particular constant coefficients in the original differential equation. We will deal with them all separately.

We are interested in finding the general solutions to the differential equation:

 

y''+by'+cy=0

 

The three scenarios are:

1) b^2-4c>0

Then there are two solutions to the characteristic equation, call them r_1 and r_2, and the general solution to this equation is:

 

y=k_1e^{r_1 x}+k_2 e^{r_2 x}

 

where k_1 and k_2 are fixed by initial conditions.

2) b^2-4c=0

Then there is a single solution to the characteristic equation, call it r. It turns out however, that in this case, and this case only, there is another type of solution to this differential equation, which is of the form x e^{rx}. Thus, the general solution to this class of equations is:

 

y=k_1e^{rx}+k_2xe^{rx}

 

3) b^2-4c<0

This is perhaps the most interesting class of solutions. Again, there are two solutions, but now they will be complex. In fact they will be complex conjugates of one another. Let’s call them r_1=\alpha+i\beta and r_2=\alpha-i\beta. So, we can write the two general solution as:

 

y=k_1e^{\left(\alpha+i\beta\right)x}+k_2e^{\left(\alpha-i\beta\right)x}

 

=e^{\alpha x}\left(k_1e^{\left(i\beta\right)x}+k_2e^{\left(-i\beta\right)x}\right)

 

=e^{\alpha x}\left(k_1\left(\cos\beta x+i\sin\beta x\right)+k_2\left(\cos\beta x-i\sin\beta x\right)\right)

 

Where we chose to write the complex exponential in \sin and \cos form. If we choose k_1 and k_2 each to be \frac{1}{2} then we can see that there is a solution which is y=e^{\alpha x}\cos\beta x. If we let k_1=\frac{1}{2i} and k_2=-\frac{1}{2i} then there is also a solution which is y=e^{\alpha x}\sin\beta x. These are two good, independent solutions to the original equation (you can check this) and thus we can write down the general solution with two new integration constants:

 

y=k_3e^{\alpha x}\cos\beta x+k_4e^{\alpha x}\sin\beta x

 

Thus the solution to this particular form is an exponential growth or decay (depending on \alpha multiplied by periodic functions, the frequency of which is determined by \beta).

Let’s look at an example of each of these three classes of solution:

 

1) y''-2y'-y=0

 

Thus b^2-4c=8 and so we are in the first class. The solutions to the characteristic equation are r=1\pm\sqrt{2} and so the general solution to this equation is:

 

y=k_1e^{\left(1+\sqrt{2}\right)x}+k_2e^{\left(1-\sqrt{2}\right)x}

 

If we are given the initial condition y(1)=2 and y'(1)=-3 then we can simply write:

 

2=k_1e^{\left(1+\sqrt{2}\right)}+k_2e^{\left(1-\sqrt{2}\right)}

 

and, after taking the derivative of the solution:

 

-3=k_1\left(1+\sqrt{2}\right)e^{\left(1+\sqrt{2}\right)}+k_2\left(1-\sqrt{2}\right)e^{\left(1-\sqrt{2}\right)}

 

These two equations can be solved simultaneously and give the coefficients:

 

k_1=\frac{\left(2 \sqrt{2}-5\right) e^{-1-\sqrt{2}}}{2 \sqrt{2}}

 

k_2=\frac{1}{4} \left(4+5 \sqrt{2}\right) e^{\sqrt{2}-1}

 

So that the particular solution with these boundary conditions is:

 

y=\frac{1}{4} \left(4+5 \sqrt{2}\right) e^{\left(1-\sqrt{2}\right)x+\sqrt{2}-1}+\frac{\left(2 \sqrt{2}-5\right) e^{\left(1+\sqrt{2}\right)x-\sqrt{2}-1}}{2 \sqrt{2}}

 

 

2) y''-2y'+y=0

With the same boundary conditions as in the previous example. Show that the following is the solution:

 

y=k_1e^{x}+k_2xe^x

 

with k_1=7e^{-1} and k_2=-5e^{-1}

 

3) y''+y'+y=0

Thus the solutions to the characteristic equation are r=\frac{-1\pm i\sqrt{3}}{2}. This means that in our previous formulation, \alpha=-\frac{1}{2} and \beta=\frac{\sqrt{3}}{2}. So the general solution is:

 

y=k_1e^{-\frac{1}{2} x}\cos\frac{\sqrt{3}}{2}x+k_2e^{-\frac{1}{2} x}\sin\frac{\sqrt{3}}{2} x

 

If we set the boundary conditions as y(0)=3 and y'(0)=-2 then the particular solution is:

 

y=\frac{1}{3} e^{-x/2} \left(9 \cos \left(\frac{\sqrt{3} x}{2}\right)-\sqrt{3} \sin \left(\frac{\sqrt{3} x}{2}\right)\right)

 

In the following figure we plot a few different particular solutions to this equation with different boundary conditions.

Solutions to the equation $latex y''+y'+y=0$ with different boundary conditions. All of the solutions are trigonometric functions multiplied by decaying exponentials but the initial position and initial gradient affect the overall solution

Solutions to the equation y''+y'+y=0 with different boundary conditions. All of the solutions are trigonometric functions multiplied by decaying exponentials but the initial position and initial gradient affect the overall solution

Finally we will consider an equation which only has imaginary solutions to the characteristic equation. For instance:

 

4) y''+y=0

The characteristic equation has r=\pm i and therefore the solution has \alpha=0 and \beta=1 giving:

 

y=k_1\cos x+k_2\sin x

 

Check that indeed this is the solution to this equation. This is a very important equation because it produces purely periodic behaviour.

How clear is this post?