Skip to main content

Section 2.1 Second order linear ODEs

Subsection Introduction to Second Order Equations

The general second order ordinary differential equation is of the form
\begin{equation*} y'' = F(x, y, y') \end{equation*}
for \(F\) an arbitrary function of three variables. As with first order equations, if the function \(F\) is not in a nice or simple form, there really isn’t a hope to find a solution for this. For second order equations, we need to be even more specific about the structure of these equations in order to find solutions than we did for first order.

Definition 2.1.1.

The general second order linear differential equation is of the form
\begin{equation*} A(x) y'' + B(x)y' + C(x)y = F(x) . \end{equation*}
This equation can be written in standard form by dividing through by \(A(x)\) to get
\begin{equation} y'' + p(x)y' + q(x)y = f(x) ,\tag{2.1.1} \end{equation}
where \(p(x) = \nicefrac{B(x)}{A(x)}\text{,}\) \(q(x) = \nicefrac{C(x)}{A(x)}\text{,}\) and \(f(x) = \nicefrac{F(x)}{A(x)}\text{.}\)
The word linear means that the equation contains no powers nor functions of \(y\text{,}\) \(y'\text{,}\) and \(y''\text{.}\) In the special case when \(f(x) = 0\text{,}\) we have a so-called homogeneous equation
\begin{equation} y'' + p(x)y' + q(x)y = 0 .\tag{2.1.2} \end{equation}
We have already seen some second order linear homogeneous equations.
\begin{align*} \qquad y'' + k^2 y \amp = 0\\ y'' - k^2 y \amp = 0 \end{align*}
For the first equation above, two solutions are \(y_1 = \cos (kx) \) and \(y_2 = \sin(kx)\text{.}\) For the second, two possible solutions are \(y_1 = e^{kx}\) and \(y_2 = e^{-kx}\text{.}\)
With the examples above, we were able to find solutions. However, notice that these equations don’t have functions of \(x\) as coefficients of the \(y\) term. This means they are constant coefficient equations. It turns out that one of the few ways we can have a guaranteed method for finding solutions to these equation is if they have constant coefficients. For first order, we had a method for every linear equation, but for second order, we only have a formulaic method for constant coefficient and homogeneous linear equations.
If we know two solutions of a linear homogeneous equation, we know many more of them.

Proof.

Let \(y = C_1 y_1 + C_2 y_2\text{.}\) Then
\begin{align*} y'' + py' + qy \amp (C_1 y_1 + C_2 y_2)'' + p(C_1 y_1 + C_2 y_2)' + q(C_1 y_1 + C_2 y_2) \\ \amp C_1 y_1'' + C_2 y_2'' + C_1 p y_1' + C_2 p y_2' + C_1 q y_1 + C_2 q y_2\\ \amp C_1 ( y_1'' + p y_1' + q y_1 ) + C_2 ( y_2'' + p y_2' + q y_2 )\\ \amp C_1 \cdot 0 + C_2 \cdot 0 = 0 \text{.} \end{align*}
The proof becomes even simpler to state if we use the operator notation. An operator is an object that eats functions and spits out functions (kind of like what a function is, but a function eats numbers and spits out numbers). Define the operator \(L\) by
\begin{equation*} L[y] = y'' + py' + qy . \end{equation*}
The differential equation now becomes \(L[y]=0\text{.}\) The operator (and the equation) \(L\) being linear means that \(L[C_1y_1 + C_2y_2] = C_1 L[y_1] + C_2 L[y_2]\text{.}\) The proof above becomes
\begin{equation*} L[y] = L[C_1y_1 + C_2y_2] = C_1 L[y_1] + C_2 L[y_2] = C_1 \cdot 0 + C_2 \cdot 0 = 0. \end{equation*}
That is, we can add solutions together and multiply them by constants to obtain new and different solutions. We call the expression \(C_1 y_1 + C_2 y_2\) a linear combination of \(y_1\) and \(y_2\text{.}\) Let us prove this theorem; the proof is very enlightening and illustrates how linear equations work.

Checkpoint 2.1.3.

This fact does not hold if the equation is non-linear. Show that \(y_1(t) = e^t\) and \(y_2(t) = 1\) solve
\begin{equation*} y'' = \sqrt{y\cdot y'} \end{equation*}
but \(y(t) = e^t + 1\) does not.
Two different solutions to the second equation \(y'' - k^2y = 0\) are \(y_1 = \cosh (kx)\) and \(y_2 = \sinh (kx)\text{.}\) Let us remind ourselves of the definition, \(\cosh x = \frac{e^x + e^{-x}}{2}\) and \(\sinh x = \frac{e^x - e^{-x}}{2}\text{.}\) Therefore, these are solutions by superposition as they are linear combinations of the two exponential solutions.
The functions \(\sinh\) and \(\cosh\) are sometimes more convenient to use than the exponential. Let us review some of their properties:
\begin{align*} \cosh 0 \amp = 1 \\ \sinh 0 \amp = 0 \\ \frac{d}{dx} \Bigl[ \cosh x \Bigr] \amp = \sinh x \\ \frac{d}{dx} \Bigl[ \sinh x \Bigr] \amp = \cosh x\\ \cosh^2 x - \sinh^2 x\amp = 1 \end{align*}

Checkpoint 2.1.4.

Derive these properties using the definitions of \(\sinh\) and \(\cosh\) in terms of exponentials.

Subsection Intial Value Problems

For first order equations, a lot of problems were stated as Initial Value Problems, containing both a differential equation and an initial condition of the value of \(y\) at some point \(x_0\text{.}\) What do these initial condition(s) look like for second order equations?

Example 2.1.5. .

Solve the second-order differential equation
\begin{equation*} y'' = x. \end{equation*}
Solution.
We can attempt to find a solution to this problem by integrating both sides twice. A first integration gives
\begin{equation*} y' = \frac{x^2}{2} + C \end{equation*}
and a second integration leads to
\begin{equation*} y = \frac{x^3}{6} + Cx + D \end{equation*}
for any two constants \(C\) and \(D\text{.}\) We can check that differentiating this \(y\) function twice gives us back the function \(x\) that we wanted.
In the previous example, we ended up with two unknown constants in our answer, whereas for first order equations, we only had one. In order to specify these two constants, we will need to give two additional facts about this function. This could be the value of the function at two points, but more traditionally, it is given as the value of the function \(y\) and its first derivative \(y'\) at a value \(x_0\text{.}\) Fairly often, this value \(x_0\) is \(0\text{,}\) but it could be any other number.

Example 2.1.6. .

Solve the initial value problem
\begin{equation*} y'' = x, \qquad y(1) = 2,\ y'(1) = 3 \end{equation*}
Solution.
We previously found our solution with unknown constants as
\begin{equation*} y = \frac{x^3}{6} + Cx + D \end{equation*}
and also found that
\begin{equation*} y' = \frac{x^2}{2} + C. \end{equation*}
To find the values of \(C\) and \(D\text{,}\) we need to plug in the two initial conditions into their corresponding functions. The initial value of the derivative gives that
\begin{equation*} 3 = y'(1) = \frac{1^2}{2} + C = C + \frac{1}{2} \end{equation*}
so that we have \(C = \frac{5}{2}\text{.}\) We can then use the initial value of \(y\text{,}\) along with this \(C\) value, to conclude that
\begin{equation*} 2 = y(1) = \frac{1^3}{6} + \frac{5}{2}(1) + D = \frac{1}{6} + \frac{5}{2} + D = \frac{16}{6} + D. \end{equation*}
Solving this out gives that \(D = -\frac{4}{6} = -\frac{2}{3}\text{.}\) Putting these constants in gives that the solution to the initial value problem is
\begin{equation*} y = \frac{x^3}{6} + \frac{5}{2}x - \frac{2}{3}. \end{equation*}
For first-order equations, we have theorems that told us that solutions existed and were unique, at least on small intervals. Linear first-order equations in particular had a very nice existence and uniqueness theorem (Theorem TheoremΒ 1.5.5), guaranteeing existence on a full interval wherever the coefficient functions are continuous. Linear second-order equations have an existence and uniqueness theorem that gives the same type of result when the initial condition is stated properly.
For example, the equation \(y'' + k^2 y = 0\) with \(y(0) = b_0\) and \(y'(0) = b_1\) has the solution
\begin{equation*} y(x) = b_0 \cos (kx) + \frac{b_1}{k} \sin (kx) . \end{equation*}
The equation \(y'' - k^2 y = 0\) with \(y(0) = b_0\) and \(y'(0) = b_1\) has the solution
\begin{equation*} y(x) = b_0 \cosh (kx) + \frac{b_1}{k} \sinh (kx) . \end{equation*}
Using \(\cosh\) and \(\sinh\) in this solution allows us to solve for the initial conditions in a cleaner way than if we have used the exponentials.
As it did for first order equations, this theorem tells us what the proper form is for initial value problems for second order equations. The take-away here is that in order to fully specify a solution to an initial value problem, a second order equation requires two initial conditions. They are usually given in the form \(y(a)\) and \(y'(a)\text{,}\) but could be given as \(y(a_1)\) and \(y(a_2)\) in other applications. In any case, two pieces of information are needed to determine a problem of second order, where we only needed one for first order.

Subsection Constant Coefficient Equations - Real and Distinct Roots

Now we want to try to solve some of these equations. As discussed earlier in this section, there is no explicit solution method possible for second order equations. However, if we restrict to a very simple case (which is also one that shows up frequently in physical systems) we can start to develop a method for solving these equations. The type of equation we restrict to is linear and constant coefficient equations. Constant coefficients means that the functions in front of \(y''\text{,}\) \(y'\text{,}\) and \(y\) are constants, they do not depend on \(x\text{.}\) The most general second order, linear, constant coefficient equation is
\begin{equation*} ay'' + by' + cy = g(x) \end{equation*}
for real constants \(a, b, c\) and an arbitrary function \(g(x)\text{.}\) We will study the solution of nonhomogeneous equations (with \(g(x) \neq 0\)) in SectionΒ 2.5. We will first focus on finding general solutions to homogeneous equations, which are of the form
\begin{equation*} ay'' + by' + cy = 0. \end{equation*}
Consider the problem
\begin{equation*} y''-6y'+8y = 0. \end{equation*}
This is a second order linear homogeneous equation with constant coefficients, so it fits the type of equation where we want to hunt for solutions. To guess a solution, think of a function that stays essentially the same when we differentiate it, so that we can take the function and its derivatives, add some multiples of these together, and end up with zero. Yes, we are talking about the exponential.
Let us try
 1 
Making an educated guess with some parameters to solve for is such a central technique in differential equations, that people sometimes use a fancy name for such a guess: ansatz, German for β€œInitial placement of a tool at a work piece”. Yes, the Germans have a word for that.
a solution of the form \(y = e^{rx}\text{.}\) Then \(y' = r e^{rx}\) and \(y'' = r^2 e^{rx}\text{.}\) Plug in to get
\begin{align*} y''-6y'+8y \amp = 0 \\ \underbrace{r^2 e^{rx}}_{y''} -6 \underbrace{r e^{rx}}_{y'}+8 \underbrace{e^{rx}}_{y} \amp = 0 \\ r^2 -6 r +8 \amp = 0\\ (r-2)(r-4) \amp = 0 \end{align*}
where we got to the third line by dividing by \(e^{rx}\text{,}\) which is never zero. Hence, if \(r=2\) or \(r=4\text{,}\) then \(e^{rx}\) is a solution. So let \(y_1 = e^{2x}\) and \(y_2 = e^{4x}\text{.}\)

Checkpoint 2.1.8.

So we have found two solutions to this differential equation! That’s great, but there may be a few concerning ideas at this point:
  1. Did we just get lucky with this particular equation?
  2. How do we know that there aren’t other solutions that aren’t of the form \(e^{rx}\text{?}\) We made that assumption, so we could have missed something.
The second point comes back to the existence and uniqueness theorem. This differential equation satisfies the conditions of the existence and uniqueness theorem. That means that as long as we find a solution that can meet any initial condition, then we know that the solution we have found is the only solution. We have not yet verified the part about meeting initial conditions yet (that’’’s coming later), but once we do, we’ll know that making this assumption is completely fine, because it got us to a solution that works, and the uniqueness theorem tells us that this is the only solution.
For the first point, let’s try to generalize the calculation we did above into a method that will work for more equations. Suppose that we have an equation
\begin{equation} a y'' + b y' + c y = 0 ,\tag{2.1.3} \end{equation}
where \(a, b, c\) are constants. We can take our same assumption that the solution is of the form \(y = e^{rx}\) to obtain
\begin{equation*} a r^2 e^{rx} + b r e^{rx} + c e^{rx} = 0 . \end{equation*}
Divide by \(e^{rx}\) to obtain the so-called characteristic equation of the ODE:
\begin{equation*} a r^2 + b r + c = 0 . \end{equation*}
Solve for the \(r\) by using the \quadratic formula.
\begin{equation*} r_1, r_2 = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} . \end{equation*}
There are three cases that can arise based on this equation.
  1. If \(b^2 - 4ac > 0\text{,}\) then we have \(r_1\) and \(r_2\) as two real roots to the equation. This is the same as the example above, and we get \(e^{r_1x}\) and \(e^{r_2x}\) as two solutions. This is the larger class of problems to which this exact process applies.
  2. If \(b^2 - 4ac < 0\text{,}\) then \(r_1\) and \(r_2\) are complex numbers. We can still use \(e^{r_1x}\) and \(e^{r_2x}\) as solutions, but this runs into some issues, which will be addressed in SectionΒ 2.2.
  3. If \(b^2 - 4ac = 0\text{,}\) then we only get one root, since \(r_1 = r_2\text{.}\) We do get that \(e^{r_1x}\) as a solution, but that’s all we get. This is another issue, which is addressed in SectionΒ 2.3.
So, as long as we have \(b^2 - 4ac > 0\text{,}\) this method will work to give us two solutions to this differential equation.

Example 2.1.9.

Find two values of \(r\) so that \(e^{rx}\) is a solution to
\begin{equation*} y'' + 3y' - 10y = 0 \end{equation*}
Our first step is to find the characteristic equation by plugging \(e^{rx}\) into the equation. This gives that
\begin{equation*} r^2 + 3r - 10 = 0 \end{equation*}
This polynomial factors as \((r-2)(r+5)\text{,}\) so we know that values of \(r=2\) and \(r=-5\) will work. This means (check this!) that \(e^{2x}\) and \(e^{-5x}\) solve this differential equation.

Subsection Linear Independence

Since \(e^{2x}\) and \(e^{-5x}\) solve the linear differential equation in the previous example, we know that superposition applies, so that \(C_1e^{2x} + C_2e^{-5x}\) solves the differential equation for any \(C_1\) and \(C_2\text{.}\) The last thing to figure out is if this is all of the solutions to this problem, namely if we can pick \(C_1\) and \(C_2\) in order to meet any possible initial condition \(y(a) = b_0\) and \(y'(a) = b_1\text{.}\) If this is possible, then we know that our method using the characteristic equation to find \(e^{2x}\) and \(e^{-5x}\) as solutions was enough to always solve this problem. To begin, we’ll define a structure that we’ll use later in ChapterΒ 3 and may seem a bit irrelevant now, but it will all tie together.

Definition 2.1.10. Linear Independence of Functions.

Let \(y_1\text{,}\) \(y_2\text{,}\) ... \(y_n\) be any functions. We say that \(\{ y_1, \ldots, y_n\}\) are linearly independent if the only way to have the equation
\begin{equation*} C_1y_1 + C_2y_2 + \cdots + C_ny_n = 0 \end{equation*}
be true (as functions) is by choosing \(C_1 = C_2 = \cdots = C_n = 0\text{.}\)
Note that by having this true as functions, we need to have that this combination is always zero, for all values of the independent variable.

Example 2.1.11.

The two functions above, \(y_1 = e^{2x}\) and \(y_2 = e^{-5x}\) are linearly independent. There are a few ways to reason this out. The first is by manipulating the combination
\begin{equation*} C_1e^{2x} + C_2e^{-5x} = 0 \quad \Rightarrow \quad C_1e^{2x} = -C_2e^{-5x} \quad \Rightarrow \quad e^{7x} = -\frac{C_2}{C_1} \end{equation*}
which cannot be true for all values of \(x\) because \(e^{7x}\) is not a constant but \(-\frac{C_2}{C_1}\) is. Another way is by taking the derivative of the combination to get
\begin{align*} C_1e^{2x} + C_2e^{-5x} \amp= 0 \\ 2C_1e^{2x} - 5C_2e^{-5x} \amp= 0 \end{align*}
Setting \(x\) to zero in both the original and the derivative results in
\begin{align*} C_1 + C_2 \amp= 0\\ 2C_1 - 5C_2 \amp= 0 \end{align*}
and we can solve this last system to get that we must have \(C_1 = C_2 = 0\text{.}\)
Based on this example and the first way we worked it out, we can also see that for two functions, they are linearly dependent if and only if they are constant multiples of each other. The ratio of the two functions must be a constant. However, this is not the case once you get beyond two functions; the relationship can get more complicated at that point.
Now, what does this have to do with our initial conditions and showing that we can get all solutions via this method? The connection may not be obvious at first (without suitable experience in linear algebra) but we will get there. First, let’s start by just seeing what needs to happen in order to meet any initial condition at \(x=0\text{.}\) Assume that we are given \(b_0\) and \(b_1\) and want to solve the initial value problem
\begin{equation*} y'' + 3y' - 10y = 0 \qquad y(0) = b_0,\ y'(0) = b_1. \end{equation*}
We want to do this by picking \(C_1\) and \(C_2\) in the expression \(y=C_1e^{2x} + C_2e^{-5x}\text{.}\) Since
\begin{equation*} y' = 2C_1e^{2x} - 5C_2e^{-5x} \end{equation*}
we can plug zero into this equation and the equation for \(y\) to get that we would need to have
\begin{align*} b_0 = y(0) \amp = C_1 + C_2 \\ b_1 = y'(0)\amp 2C_1 - 5C_2\text{.} \end{align*}
We can solve this system of equations by elimination. Multiplying the first equation by 5 adding them together gives
\begin{equation*} 5b_0 + b_1 = 7C_1 \end{equation*}
so that
\begin{equation*} C_1 = \frac{5b_0 + b_1}{7}. \end{equation*}
We can then compute the value of \(C_2\) as
\begin{equation*} C_2 = b_0 - C_1 = b_0 - \frac{5b_0 + b_1}{7} = \frac{2b_0 - b_1}{7}. \end{equation*}
Therefore, we can appropriate values of \(C_1\) and \(C_2\) that will meet the initial conditions for arbitrary values \(b_0\) and \(b_1\text{.}\) This is great! This means that our method of finding solutions was sufficient for this problem.
Let’s look at this situation in more generality. Assume that we have two solutions \(y_1\) and \(y_2\) that solve a second order linear, homogeneous differential equation, and we want to know if \(C_1y_1 + C_2y_2\) can meet any initial condition for this problem. We have two unknowns and two equations (\(y(x_0)\) and \(y'(x_0)\) for some value \(x_0\)), so it should work out.
We can carry out the same steps as above. If we have initial conditions \(y(x_0) = b_0\) and \(y'(x_0) = b_1\text{,}\) we want to satisfy
\begin{align*} b_0 = y(x_0) \amp = C_1y_1(x_0) + C_2y_2(x_0) \\ b_1 = y'(x_0) \amp = C_1y_1'(x_0) + C_2y_2'(x_0) \text{,} \end{align*}
which we get by taking the derivative of \(y(x) = C_1y_1(x) + C_2y_2(x)\) and plugging in \(x_0\text{.}\) We will again use elimination to solve this. We can multiply the first equation by \(y_1'(x_0)\text{,}\) multiply the second by \(y_1(x_0)\text{,}\) and subtract them. This will cancel out the \(C_1\) term, leaving us with
\begin{equation*} b_0y_1'(x_0) - b_1y_1(x_0) = C_2(y_1'(x_0)y_2(x_0) - y_1(x_0)y_2'(x_0)). \end{equation*}
We want to solve for \(C_2\) here, and once we do that, solving for \(C_1\) happens by plugging back into one of the original equations. Most of the time, this will be completely fine, but there’s one issue left. We can’t divide by zero. So to be able to solve these equations for \(C_1\) and \(C_2\text{,}\) we need to know that
\begin{equation} y_1'(x_0)y_2(x_0) - y_1(x_0)y_2'(x_0) \neq 0.\tag{2.1.4} \end{equation}
The left side of this equation is often called the Wronskian of the functions \(y_1\) and \(y_2\) at the point \(x_0\text{.}\) In general, the Wronskian is the function \(y_1'(x)y_2(x) - y_2'(x)y_1(x)\) for two solutions to a second order differential equation. This relation (the Wronskian being non-zero) tells us that the two solutions \(y_1\) and \(y_2\) are different enough to allow us to meet every initial condition for the differential equation.
In order to bring everything together, the last statement we need to show is that if two solutions are linearly independent, then their Wronskian is non-zero, which will tell us that linear independence is enough to know that we can solve any initial value problem we want and have found all solutions to the problem in question.

Proof.

We’ll provide a description of how this proof works in this particular case. Assume that \(W(x)\) is never zero. Then, by the same methods we described previously, we can solve
\begin{equation} 0 = C_1y_1(x) + C_2y_2(x) \qquad 0 = C_1y_1'(x) + C_2y_2'(x)\tag{2.1.5} \end{equation}
as a function of \(x\) using elimination, and we’ll get that \(C_1\) and \(C_2\) must be zero. Since the second equation is the derivative of the first, if there was a non-zero solution for just the first equation (the one that defines linear independence), then that would apply to both equations. Therefore, the only way for that first equation to be true on its own is if \(C_1\) and \(C_2\) are zero, giving linear independence.
On the other hand, assume the solutions are linearly independent, and there is some point \(x_0\) where \(W(x_0) = 0\text{.}\) This means that
\begin{equation*} y_1'(x_0)y_2(x_0) = y_1(x_0)y_2'(x_0) \end{equation*}
or
\begin{equation*} \frac{y_1'(x_0)}{y_1(x_0)} = \frac{y_2'(x_0)}{y_2(x_0)} \end{equation*}
assuming that nothing in the denominator is zero. This means that the pair of equations in (2.1.5) are multiples of each other at \(x_0\text{,}\) meaning there is really only one equation, and so there are non-zero values of \(C_1\) and \(C_2\) that solve it. Letting \(K_1\) and \(K_2\) be these particular values, define
\begin{equation*} \phi(x) = K_1y_1(x) + K_2y_2(x). \end{equation*}
Since \(y_1\) and \(y_2\) are solutions to (2.1.2) and the choice of \(K_1\) and \(K_2\) to solve (2.1.5), we know that \(\phi\) solves (2.1.2) with \(\phi(x_0) = \phi'(x_0) = 0\text{.}\) However, \(0\) is also a solution to this initial value problem and says that solutions to this problem are unique. Therefore
\begin{equation*} 0 = K_1y_1(x) + K_2y_2(x), \end{equation*}
contradicting the linear independence of \(y_1\) and \(y_2\text{.}\) Therefore, \(W(x)\) must be non-zero everywhere.
Therefore, what this says is that for two solutions of a linear, homogeneous differential equation (which is more specific than just having two random functions), two solutions being linearly independent is equivalent to (2.1.4) holding for any
 2 
Abel’s Theorem, another theoretical result, says that the Wronskian \(y_1'y_2 - y_1y_2'\) is either always zero or never zero. That means that any one value can be checked to determine if two solutions are linearly independent. Picking \(0\) is usually a convenient choice.
value \(x_0\) where they are defined. Our work and calculations above leads to the following theorem:
Note that this theorem works for all linear homogeneous equations, not just constant coefficients ones. However, the methods that we have described here (and will in future sections) for finding these solutions will generally only work for constant coefficient equations.

Example 2.1.14.

Find the general solution of the differential equation \(y'' + y = 0\text{.}\)
Solution.
One of the four fundamental equations in Four fundamental equations showed that the two functions \(y_1 = \sin x\) and \(y_2 = \cos x\) are solutions to the equation \(y'' + y = 0\text{.}\) It is not hard to see that sine and cosine are not constant multiples of each other. If \(\sin x = A \cos x\) for some constant \(A\text{,}\) we let \(x=0\) and this would imply \(A = 0\text{.}\) But then \(\sin x = 0\) for all \(x\text{,}\) which is preposterous. So \(y_1\) and \(y_2\) are linearly independent. We could also have checked this by taking derivatives and plugging in zero. Since
\begin{equation*} y_1(0) = 0 \ \ y_1'(0) = 1\ \ y_2(0) = 1\ \ y_2'(0) = 0 \end{equation*}
we have that
\begin{equation*} y_1'(0)y_2(0) - y_1(0)y_2'(0) = (1)(1) - (0)(0) = 1 \neq 0 \end{equation*}
so these solutions are linearly independent. Hence,
\begin{equation*} y = C_1 \cos x + C_2 \sin x \end{equation*}
is the general solution to \(y'' + y = 0\text{.}\)
For two functions, checking linear independence is rather simple. Let us see another example using non-constant coefficient equations. Consider \(y''-2x^{-2}y = 0\text{.}\) Then \(y_1 = x^2\) and \(y_2 = \nicefrac{1}{x}\) are solutions. To see that they are linearly indepedent, suppose one is a multple of the other: \(y_1 = A y_2\text{,}\) we just have to find out that \(A\) cannot be a constant. In this case we have \(A = \nicefrac{y_1}{y_2} = x^3\text{,}\) this most decidedly not a constant. So \(y = C_1 x^2 + C_2 \nicefrac{1}{x}\) is the general solution.
Now, back to our discussion of constant coefficient equations. If \(b^2 - 4ac > 0\text{,}\) then we have two distinct real roots \(r_1\) and \(r_2\text{,}\) giving rise to solutions of the form \(y_1(x) = e^{r_1x}\) and \(y_2(x) = e^{r_2x}\text{.}\) Using condition (2.1.4) with \(x_0 = 0\text{,}\) we compute
\begin{equation*} y_1'(0)y_2(0) - y_1(0)y_2'(0) = (r_1)(1) - (1)(r_2) = r_1 - r_2. \end{equation*}
Since \(r_1 \neq r_2\text{,}\) this expression is not zero, so the two solutions are linearly independent. Therefore, in this case, we know that the general solution will be
\begin{equation*} y = C_1e^{r_1x} + C_2e^{r_2x}. \end{equation*}
Using the other formulation of linear independence of two functions, we would need to show that there is no constant \(A\) so that
\begin{equation*} e^{r_1x} = A e^{r_2x}. \end{equation*}
Since this can be rewritten as \(A = e^{(r_1-r_2)x}\) and we know that \(r_1 \neq r_2\text{,}\) this is not a constant, so we again know that these functions are linearly independent and give rise to a general solution.

Example 2.1.15.

Solve the initial value problem
\begin{equation*} y'' + 2y' - 3y = 0 \qquad y(0) = 2,\ y'(0) = 1. \end{equation*}
Solution.
To start, we find the characteristic equation of this differential equation and look for the roots. The characteristic equation here is
\begin{equation*} r^2 + 2r - 3 = 0 \end{equation*}
and this factors as \((r+3)(r-1) = 0\text{.}\) Thus, the two roots are \(r=1\) and \(r=-3\text{,}\) so that the general solution (and we know it is the general solution because these are different exponents and so the solutions are linearly independent) is
\begin{equation*} y(x) = C_1e^{x} + C_2e^{-3x}. \end{equation*}
In order to find the values of \(C_1\) and \(C_2\text{,}\) we need to use the initial conditions. Plugging zero into \(y(x)\) gives
\begin{equation*} y(0) = 2 = C_1 + C_2 \end{equation*}
and since the derivative \(y'(x) = C_1e^x - 3C_2e^{-3x}\text{,}\) the second condition gives that
\begin{equation*} y'(0) = 1 = C_1 - 3C_2. \end{equation*}
Subtracting the second equation from the first gives that
\begin{equation*} 1 = 4C_2 \end{equation*}
so that \(C_2 = 1/4\) and \(C_1 = 7/4\text{.}\) Thus, the solution to the initial value problem is
\begin{equation*} y(x) = \frac{7}{4}e^x + \frac{1}{4}e^{-3x}. \end{equation*}
In this second example, we solve a problem in the same way, but the roots of the characteristic equation do not work out as nicely. Even with that, the structure and process for the problem is identical to the previous example.

Example 2.1.16.

Solve the initial value problem
\begin{equation*} y'' - 2y' - y = 0 \qquad y(0) = 2,\ y'(0) = 3. \end{equation*}
Solution.
We start by looking for the characteristic equation of this differential equation and finding its roots. The characteristic equation is
\begin{equation*} r^2 - 2r - 1 = 0 \end{equation*}
which has roots
\begin{equation*} r = \frac{2 \pm \sqrt{(-2)^2 - 4(1)(-1)}}{2} = \frac{2 \pm \sqrt{8}}{2} = 1 \pm \sqrt{2}. \end{equation*}
There are two real and distinct roots, so we know that the two solutions \(y_1(x) = e^{(1+\sqrt{2})x}\) and \(y_2(x) = e^{(1-\sqrt{2})x}\) are linearly independent, so we have that the general solution to this problem is
\begin{equation*} y(x) = C_1e^{(1+\sqrt{2})x} + C_2e^{(1 - \sqrt{2})x}. \end{equation*}
Next, we need to find the constants \(C_1\) and \(C_2\) to meet the initial conditions. We can see that, by computing the first derivative,
\begin{align*} y(x) \amp = C_1e^{(1+\sqrt{2})x} + C_2e^{(1 - \sqrt{2})x}\\ y'(x) \amp = (1+\sqrt{2})C_1e^{(1+\sqrt{2})x} + (1 - \sqrt{2})C_2e^{(1 - \sqrt{2})x} \end{align*}
and plugging in \(x=0\) gives that we want \(C_1\) and \(C_2\) to solve
\begin{align*} 2 \amp = C_1 + C_2\\ 3 \amp = (1 + \sqrt{2})C_1 + (1 - \sqrt{2})C_2\text{.} \end{align*}
We can solve this by any method. One trick at the start is to subtract equation 1 from equation 2, giving that
\begin{align*} 2 \amp = C_1 + C_2\\ 1 \amp = \sqrt{2}C_1 - \sqrt{2}C_2 \end{align*}
which can be rewritten as
\begin{align*} 2 \amp = C_1 + C_2 \\ \frac{1}{\sqrt{2}} \amp = C_1 - C_2 \end{align*}
Adding these equations together and dividing by 2 gives that
\begin{equation*} 2C_1 = 2 + \frac{1}{\sqrt{2}} \end{equation*}
so that \(C_1 = 1 + \frac{1}{2\sqrt{2}}\text{,}\) and since \(C_1 + C_2 = 2\text{,}\) we have that \(C_2 = 1 - \frac{1}{2\sqrt{2}}\text{.}\) Therefore, the solution to the desired initial value problem is
\begin{equation*} y(x) = \left(1 + \frac{1}{2\sqrt{2}}\right)e^{(1 + \sqrt{2})x} + \left(1 - \frac{1}{2\sqrt{2}}\right)e^{(1 - \sqrt{2})x}. \end{equation*}

Exercises Exercises

2.

Are \(\sin(x)\) and \(e^x\) linearly independent? Justify.
Answer.
Yes. To justify try to find a constant \(A\) such that \(\sin(x) = A e^x\) for all \(x\text{.}\)

6.

Verify that \(y_1(t) = e^t \cos(2t)\) and \(y_2(t) = e^t \sin(2t)\) both solve \(y'' - 2y' + 5y = 0\text{.}\) Are these two solutions linearly independent? What does that mean about the general solution to \(y'' - 2y' + 5y = 0\text{?}\)
Answer.
Yes. This means the general solution is \(C_1e^{t}\cos(2t) + C_2\sin(2t)\text{.}\)

7.

Prove the superposition principle for nonhomogeneous equations. Suppose that \(y_1\) is a solution to \(L y_1 = f(x)\) and \(y_2\) is a solution to \(L y_2 = g(x)\) (same linear operator \(L\)). Show that \(y = y_1+y_2\) solves \(Ly = f(x) + g(x)\text{.}\)
Answer.
Hint: Plug in \(y_1 + y_2\) and see that it works correctly.

8.

Determine the maximal interval of existence of the solution to the differential equation
\begin{equation*} (t - 5)y'' + \frac{1}{t+1}y' + e^t y = \frac{\cos(t)}{t^2 + 1} \end{equation*}
with initial condition \(y(3) = 8\text{.}\) What about if the initial condition is \(y(-3) = 4\text{?}\)
Answer.
\((-1, 5)\) for \(y(3) = 8\text{.}\) \((-\infty, -1)\) for \(y(-3) = 4\text{.}\)

9.

For the equation \(x^2 y'' - x y' = 0\text{,}\) find two solutions, show that they are linearly independent and find the general solution. Hint: Try \(y = x^r\text{.}\)
Answer.
\(y = C_1 + C_2x^2\)

10.

Find the general solution to \(x y'' + y' = 0\text{.}\) Hint: It is a first order ODE in \(y'\text{.}\)
Answer.
\(y=C_1 \ln(x) + C_2\)

12.

Solve \(y'' + 9y' = 0\) with \(y(0) = 1\text{,}\) \(y'(0) = 1\text{.}\)
Answer.
\(y = \frac{10}{9} - \frac{1}{9}e^{-9t}\)

17.

Find the solution to \(y'' + y' -12y = 0\) with \(y(0) = 1\) and \(y'(0) = -2\text{.}\)
Answer.
\(y = \frac{5}{7}e^{-4t} + \frac{2}{7}e^{3t}\)

19.

Find the solution to \(2y''+y'-3y=0\text{,}\) \(y(0) = a\text{,}\) \(y'(0)=b\text{.}\)
Answer.
\(y = \frac{2(a-b)}{5} \, e^{-3x/2}+\frac{3 a+2 b}{5} \, e^x\)

20.

Find the solution to \(y''-(\alpha+\beta) y' + \alpha \beta y=0\text{,}\) \(y(0) = a\text{,}\) \(y'(0)=b\text{,}\) where \(\alpha\text{,}\) \(\beta\text{,}\) \(a\text{,}\) and \(b\) are real numbers, and \(\alpha \not= \beta\text{.}\)
Answer.
\(y = \frac{a \beta-b}{\beta-\alpha} e^{\alpha x} + \frac{b-a \alpha}{\beta-\alpha} e^{\beta x}\)

21.

Write down an equation (guess) for which we have the solutions \(e^x\) and \(e^{2x}\text{.}\) Hint: Try an equation of the form \(y''+Ay'+By = 0\) for constants \(A\) and \(B\text{,}\) plug in both \(e^x\) and \(e^{2x}\) and solve for \(A\) and \(B\text{.}\)
Answer.
\(y''-3y'+2y = 0\)

23.

Give an example of a 2nd-order DE whose general solution is \(y=c_1e^{-2t}+c_2e^{-4t}\text{.}\)
Answer.
\(y'' + 6y' + 8y = 0\)

Exercise Group.

Equations of the form \(a x^2 y'' + b x y' + c y = 0\) are called Euler’s equations or Cauchy-Euler equations. They are solved by trying \(y=x^r\) and solving for \(r\) (assume that \(x \geq 0\) for simplicity).
24.
Suppose that \({(b-a)}^2-4ac > 0\text{.}\)
(a)
Find a formula for the general solution of \(a x^2 y'' + b x y' + c y = 0\text{.}\) Hint: Try \(y=x^r\) and find a formula for \(r\text{.}\)
Answer.
\(r_1 = \frac{(a-b) + \sqrt{(b-a)^2 - 4ac}}{2a}\text{,}\) \(r_2 = \frac{(a-b) - \sqrt{(b-a)^2 - 4ac}}{2a}\text{,}\) General Solution: \(y = C_1x^{r_1} + C_2x^{r_2}\text{.}\)
(b)
What happens when \({(b-a)}^2-4ac = 0\) or \({(b-a)}^2-4ac < 0\text{?}\) We will revisit the case when \({(b-a)}^2-4ac < 0\) later.
Answer.
Only one solution or complex solutions.
25.
Same equation as in Exercise GroupΒ 24–25 Suppose \({(b-a)}^2-4ac = 0\text{.}\) Find a formula for the general solution of \(a x^2 y'' + b x y' + c y = 0\text{.}\) Hint: Try \(y=x^r \ln x\) for the second solution.
Answer.
\(y = C_1x^{\frac{a-b}{2a}} + C_2x^{\frac{a-b}{2a}}ln(x)\)