Skip to main content
Logo image

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]
Consider the general second order linear differential equation
A(x)yβ€³+B(x)yβ€²+C(x)y=F(x).
We usually divide through by A(x) to get
(2.1)yβ€³+p(x)yβ€²+q(x)y=f(x),
where p(x)=B(x)/A(x), q(x)=C(x)/A(x), and f(x)=F(x)/A(x). The word linear means that the equation contains no powers nor functions of y, yβ€², and yβ€³.
In the special case when f(x)=0, we have a so-called homogeneous equation
(2.2)yβ€³+p(x)yβ€²+q(x)y=0.
We have already seen some second order linear homogeneous equations.
yβ€³+k2y=0Two solutions are:y1=cos⁑(kx),y2=sin⁑(kx).yβ€³βˆ’k2y=0Two solutions are:y1=ekx,y2=eβˆ’kx.
If we know two solutions of a linear homogeneous equation, we know many more of them.
That is, we can add solutions together and multiply them by constants to obtain new and different solutions. We call the expression C1y1+C2y2 a linear combination of y1 and y2. Let us prove this theorem; the proof is very enlightening and illustrates how linear equations work.
Proof: Let y=C1y1+C2y2. Then
yβ€³+pyβ€²+qy=(C1y1+C2y2)β€³+p(C1y1+C2y2)β€²+q(C1y1+C2y2)=C1y1β€³+C2y2β€³+C1py1β€²+C2py2β€²+C1qy1+C2qy2=C1(y1β€³+py1β€²+qy1)+C2(y2β€³+py2β€²+qy2)=C1β‹…0+C2β‹…0=0.β—»
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
Ly=yβ€³+pyβ€²+qy.
The differential equation now becomes Ly=0. The operator (and the equation) L being linear means that L(C1y1+C2y2)=C1Ly1+C2Ly2. It is almost as if we were β€œmultiplying” by L. The proof above becomes
Ly=L(C1y1+C2y2)=C1Ly1+C2Ly2=C1β‹…0+C2β‹…0=0.
Two different solutions to the second equation yβ€³βˆ’k2y=0 are y1=cosh⁑(kx) and y2=sinh⁑(kx). Recalling the definition of sinh and cosh⁑, we note that these are solutions by superposition as they are linear combinations of the two exponential solutions: cosh⁑(kx)=ekx+eβˆ’kx2=(1/2)ekx+(1/2)eβˆ’kx and sinh⁑(kx)=ekxβˆ’eβˆ’kx2=(1/2)ekxβˆ’(1/2)eβˆ’kx.
The functions sinh and cosh are sometimes more convenient to use than the exponential. Let us review some of their properties:
cosh⁑0=1,sinh⁑0=0,ddx[cosh⁑x]=sinh⁑x,ddx[sinh⁑x]=cosh⁑x,cosh2⁑xβˆ’sinh2⁑x=1.

Exercise 2.1.1.

Derive these properties using the definitions of sinh and cosh in terms of exponentials.
Linear equations have nice and simple answers to the existence and uniqueness question.
For example, the equation yβ€³+k2y=0 with y(0)=b0 and yβ€²(0)=b1 has the solution
y(x)=b0cos⁑(kx)+b1ksin⁑(kx).
The equation yβ€³βˆ’k2y=0 with y(0)=b0 and yβ€²(0)=b1 has the solution
y(x)=b0cosh⁑(kx)+b1ksinh⁑(kx).
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 y1 and y2 to the homogeneous equation (2.2). Can every solution be written (using superposition) in the form y=C1y1+C2y2?
Answer is affirmative! Provided that y1 and y2 are different enough in the following sense. We say y1 and y2 are linearly independent if one is not a constant multiple of the other.
For example, we found the solutions y1=sin⁑x and y2=cos⁑x for the equation yβ€³+y=0. It is not hard to see that sine and cosine are not constant multiples of each other. Indeed, if sin⁑x=Acos⁑x for some constant A, plugging in x=0 would imply A=0. But then sin⁑x=0 for all x, which is preposterous. So y1 and y2 are linearly independent. Hence,
y=C1cos⁑x+C2sin⁑x
is the general solution to yβ€³+y=0.
For two functions, checking linear independence is rather simple. Let us see another example. Consider yβ€³βˆ’2xβˆ’2y=0. Then y1=x2 and y2=1/x are solutions. To see that they are linearly independent, suppose one is a multiple of the other: y1=Ay2, we just have to find out that A cannot be a constant. In this case we have A=y1/y2=x3, this most decidedly not a constant. So y=C1x2+C21/x is the general solution.
If you have one nonzero 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 y1 as a solution of yβ€³+p(x)yβ€²+q(x)y=0, then we try a second solution of the form y2(x)=y1(x)v(x). We just need to find v. We plug y2 into the equation:
0=y2β€³+p(x)y2β€²+q(x)y2=y1β€³v+2y1β€²vβ€²+y1vβ€³βŸy2β€³+p(x)(y1β€²v+y1vβ€²)⏟y2β€²+q(x)y1v⏟y2=y1vβ€³+(2y1β€²+p(x)y1)vβ€²+(y1β€³+p(x)y1β€²+q(x)y1)0v.
In other words, y1vβ€³+(2y1β€²+p(x)y1)vβ€²=0. Using w=vβ€², we have the first order linear equation y1wβ€²+(2y1β€²+p(x)y1)w=0. After solving this equation for w (integrating factor), we find v by antidifferentiating w. We then form y2 by computing y1v. For example, suppose we somehow know y1=x is a solution to yβ€³+xβˆ’1yβ€²βˆ’xβˆ’2y=0. The equation for w is then xwβ€²+3w=0. We find a solution, w=Cxβˆ’3, and we find an antiderivative v=βˆ’C2x2. Hence y2=y1v=βˆ’C2x. Any C works and so C=βˆ’2 makes y2=1/x. Thus, the general solution is y=C1x+C21/x.
Since we have a formula for the solution to the first order linear equation, we can write a formula for y2:
y2(x)=y1(x)∫eβˆ’βˆ«p(x)dx(y1(x))2dx
However, it is much easier to remember that we just need to try y2(x)=y1(x)v(x) and find v(x) as we did above. The technique works for higher order equations too: You get to reduce the order by one 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.

Exercises Exercises

2.1.4.

Prove the superposition principle for nonhomogeneous equations. Suppose that y1 is a solution to Ly1=f(x) and y2 is a solution to Ly2=g(x) (same linear operator L). Show that y=y1+y2 solves Ly=f(x)+g(x).

2.1.5.

For the equation x2yβ€³βˆ’xyβ€²=0, find two solutions, show that they are linearly independent and find the general solution. Hint: Try y=xr.
Equations of the form ax2yβ€³+bxyβ€²+cy=0 are called Euler’s equations or Cauchy–Euler equations. They are solved by trying y=xr and solving for r (assume xβ‰₯0 for simplicity).

2.1.6.

Suppose that (bβˆ’a)2βˆ’4ac>0.
  1. Find a formula for the general solution of Euler’s equation (see above) ax2yβ€³+bxyβ€²+cy=0. Hint: Try y=xr and find a formula for r.
  2. What happens when (bβˆ’a)2βˆ’4ac=0 or (bβˆ’a)2βˆ’4ac<0?
We will revisit the case when (bβˆ’a)2βˆ’4ac<0 later.

2.1.7.

Same equation as in Exercise 2.1.6. Suppose (bβˆ’a)2βˆ’4ac=0. Find a formula for the general solution of ax2yβ€³+bxyβ€²+cy=0. Hint: Try y=xrln⁑x for the second solution.

2.1.8. reduction of order.

Suppose y1 is a solution to yβ€³+p(x)yβ€²+q(x)y=0. By directly plugging into the equation, show that
y2(x)=y1(x)∫eβˆ’βˆ«p(x)dx(y1(x))2dx
is also a solution.

2.1.9. Chebyshev’s equation of order 1.

Take (1βˆ’x2)yβ€³βˆ’xyβ€²+y=0.
  1. Show that y=x is a solution.
  2. Use reduction of order to find a second linearly independent solution.
  3. Write down the general solution.

2.1.10. Hermite’s equation of order 2.

Take yβ€³βˆ’2xyβ€²+4y=0.
  1. Show that y=1βˆ’2x2 is a solution.
  2. Use reduction of order to find a second linearly independent solution. (It’s OK to leave a definite integral in the formula.)
  3. Write down the general solution.

2.1.101.

Are sin⁑(x) and ex linearly independent? Justify.
Answer.
Yes. To justify try to find a constant A such that sin⁑(x)=Aex for all x.

2.1.102.

Are ex and ex+2 linearly independent? Justify.
Answer.
No. ex+2=e2ex.

2.1.104.

Find the general solution to xyβ€³+yβ€²=0. Hint: It is a first order ODE in yβ€².
Answer.
y=C1ln⁑(x)+C2

2.1.105.

Write down an equation (guess) for which we have the solutions ex and e2x. Hint: Try an equation of the form yβ€³+Ayβ€²+By=0 for constants A and B, plug in both ex and e2x and solve for A and B.
Answer.
yβ€³βˆ’3yβ€²+2y=0
For a higher quality printout use the PDF version: https://www.jirka.org/diffyqs/diffyqs.pdf