## Section 2.1 Second order linear ODEs

¶*Note: 1 lecture, reduction of order optional, first part of §3.1 in [EP], parts of §3.1 and §3.2 in [BD]*

Let us consider the general *second order linear differential equation*

We usually divide through by \(A(x)\) to get

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

We have already seen some second order linear homogeneous equations.

If we know two solutions of a linear homogeneous equation, we know many more of them.

###### Theorem 2.1.1. Superposition.

Suppose \(y_1\) and \(y_2\) are two solutions of the homogeneous equation (2.2). Then

also solves (2.2) for arbitrary constants \(C_1\) and \(C_2\text{.}\)

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.

*Proof:* Let \(y = C_1 y_1 + C_2 y_2\text{.}\) Then

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

The differential equation now becomes \(Ly=0\text{.}\) The operator (and the equation) \(L\) being *linear* means that \(L(C_1y_1 + C_2y_2) =
C_1 Ly_1 + C_2 Ly_2\text{.}\) The proof above becomes

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:

Linear equations have nice and simple answers to the existence and uniqueness question.

###### Theorem 2.1.2. Existence and uniqueness.

Suppose \(p, q, f\) are continuous functions on some interval \(I\text{,}\) \(a\) is a number in \(I\text{,}\) and \(a, b_0, b_1\) are constants. The equation

has exactly one solution \(y(x)\) defined on the same interval \(I\) satisfying the initial conditions

For example, the equation \(y'' + k^2 y = 0\) with \(y(0) = b_0\) and \(y'(0) = b_1\) has the solution

The equation \(y'' - k^2 y = 0\) with \(y(0) = b_0\) and \(y'(0) = b_1\) has the solution

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.

The initial conditions for a second order ODE consist of two equations. Common sense tells us that if we have two arbitrary constants and two equations, then we should be able to solve for the constants and find a solution to the differential equation satisfying the initial conditions.

*Question:* Suppose we find two different solutions \(y_1\) and \(y_2\) to the homogeneous equation (2.2). Can every solution be written (using superposition) in the form \(y = C_1 y_1 + C_2 y_2\text{?}\)

Answer is affirmative! Provided that \(y_1\) and \(y_2\) are different enough in the following sense. We say \(y_1\) and \(y_2\) are *linearly independent* if one is not a constant multiple of the other.

###### Theorem 2.1.3.

Let \(p, q\) be continuous functions. Let \(y_1\) and \(y_2\) be two linearly independent solutions to the homogeneous equation (2.2). Then every other solution is of the form

That is, \(y = C_1 y_1 + C_2 y_2\) is the general solution.

For example, we found the solutions \(y_1 = \sin x\) and \(y_2 = \cos x\) for 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. Hence,

is the general solution to \(y'' + y = 0\text{.}\)

For two functions, checking linear independence is rather simple. Let us see another example. 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.

If you have one solution to a second order linear homogeneous equation, then you can find another one. This is the *reduction of order method*. The idea is that if we somehow found \(y_1\) as a solution of \(y'' + p(x) y' + q(x) y = 0\) we try a second solution of the form \(y_2(x) = y_1(x) v(x)\text{.}\) We just need to find \(v\text{.}\) We plug \(y_2\) into the equation:

In other words, \(y_1 v'' + (2 y_1' + p(x) y_1) v' = 0\text{.}\) Using \(w = v'\) we have the first order linear equation \(y_1 w' + (2 y_1' + p(x) y_1) w = 0\text{.}\) After solving this equation for \(w\) (integrating factor), we find \(v\) by antidifferentiating \(w\text{.}\) We then form \(y_2\) by computing \(y_1 v\text{.}\) For example, suppose we somehow know \(y_1 = x\) is a solution to \(y''+x^{-1}y'-x^{-2} y=0\text{.}\) The equation for \(w\) is then \(xw' + 3 w = 0\text{.}\) We find a solution, \(w = Cx^{-3}\text{,}\) and we find an antiderivative \(v = \frac{-C}{2x^2}\text{.}\) Hence \(y_2 = y_1 v = \frac{-C}{2x}\text{.}\) Any \(C\) works and so \(C=-2\) makes \(y_2 = \nicefrac{1}{x}\text{.}\) Thus, the general solution is \(y = C_1 x + C_2\nicefrac{1}{x}\text{.}\)

Since we have a formula for the solution to the first order linear equation, we can write a formula for \(y_2\text{:}\)

Although it is much easier to remember that we just need to try \(y_2(x) = y_1(x) v(x)\) and find \(v(x)\) as we did above. Also, the technique works for higher order equations too: you get to reduce the order for each solution you find. So it is better to remember how to do it rather than a specific formula.

We will study the solution of nonhomogeneous equations in Section 2.5. We will first focus on finding general solutions to homogeneous equations.

### Subsection 2.1.1 Exercises

###### Exercise 2.1.2.

Show that \(y=e^x\) and \(y=e^{2x}\) are linearly independent.

###### Exercise 2.1.3.

Take \(y'' + 5 y = 10 x + 5\text{.}\) Find (guess!) a solution.

###### Exercise 2.1.4.

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{.}\)

###### Exercise 2.1.5.

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{.}\)

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).

###### Exercise 2.1.6.

Suppose that \({(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\) and find a formula for \(r\text{.}\)

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.

###### Exercise 2.1.7.

Same equation as in Exercise 2.1.6. 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.

###### Exercise 2.1.8. reduction of order.

Suppose \(y_1\) is a solution to \(y'' + p(x) y' + q(x) y = 0\text{.}\) By directly plugging into the equation, show that

is also a solution.

###### Exercise 2.1.9. Chebyshev's equation of order 1.

Take \((1-x^2)y''-xy' + y = 0\text{.}\)

Show that \(y=x\) is a solution.

Use reduction of order to find a second linearly independent solution.

Write down the general solution.

###### Exercise 2.1.10. Hermite's equation of order 2.

Take \(y''-2xy' + 4y = 0\text{.}\)

Show that \(y=1-2x^2\) is a solution.

Use reduction of order to find a second linearly independent solution.

Write down the general solution.

###### Exercise 2.1.101.

Are \(\sin(x)\) and \(e^x\) linearly independent? Justify.

Yes. To justify try to find a constant \(A\) such that \(\sin(x) = A e^x\) for all \(x\text{.}\)

###### Exercise 2.1.102.

Are \(e^x\) and \(e^{x+2}\) linearly independent? Justify.

No. \(e^{x+2} = e^2 e^x\text{.}\)

###### Exercise 2.1.103.

Guess a solution to \(y'' + y' + y= 5\text{.}\)

\(y=5\)

###### Exercise 2.1.104.

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

\(y=C_1 \ln(x) + C_2\)

###### Exercise 2.1.105.

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{.}\)

\(y''-3y'+2y = 0\)