Differential Equations for EngineersXYZ Homework Edition

⇩ Download ▾

2.1 Second order linear ODEs

Let us consider the general second order linear differential equation

A ( x ) y + B ( x ) y + C ( x ) y = F ( x ) . A(x)y'' + B(x)y' + C(x)y = F(x). \nonumber

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

y + p ( x ) y + q ( x ) y = f ( x ) , y'' + p(x)y' + q(x)y = f(x), \nonumber

where p(x)=B(x)A(x)p(x) = \frac{B(x)}{A(x)}, q(x)=C(x)A(x)q(x)=\frac{C(x)}{A(x)}, and f(x)=F(x)A(x)f(x) = \frac{F(x)}{A(x)}. The word linear means that the equation contains no powers nor functions of yy, yy', and yy''.

In the special case when f(x)=0f(x)=0 we have a so-called homogeneous equation

y + p ( x ) y + q ( x ) y = 0 , \label{eq:3}y'' + p(x)y' + q(x)y = 0,

(2.1.1)

We have already seen some second order linear homogeneous equations:

y + k 2 y = 0 Two solutions are: y 1 = cos ( k x ) , y 2 = sin ( k x ) . y k 2 y = 0 Two solutions are: y 1 = e k x , y 2 = e k x . \begin{array}{lll}{y''+k^{2}y=0}&{\text{Two solutions are:}}&{y_{1}=\cos(kx),\quad y_{2}=\sin (kx).} \\ {y''-k^{2}y=0}&{\text{Two solutions are:}}&{y_{1}=e^{kx},\quad y_{2}=e^{-kx}.} \end{array} \nonumber

If we know two solutions of a linear homogeneous equation, we know a lot 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+C2y2C_1y_1+C_2y_2 a linear combination of y1y_1 and y2y_2. Let us prove this theorem; the proof is very enlightening and illustrates how linear equations work.

Proof

Let y=C1y1+C2y2y = C_1y_1 + C_2y_2. Then

y + p y + q y = ( 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 ) = 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 = C 1 ( y 1 + p y 1 + q y 1 ) + C 2 ( y 2 + p y 2 + q y 2 ) = C 1 .0 + C 2 .0 = 0 \begin{aligned} y'' + py' + qy &= (C_1y_1 + C_2y_2)'' + p(C_1y_1 + C_2y_2)' + q(C_1y_1 + C_2y_2)\\ &= C_1y''_1 + C_2y''_2 + C_1py'_1 + C_2py'_2 + C_1qy_1 + C_2qy_2 \\ &= C_1(y''_1 + py'_1 + qy_1) + C_2(y''_2 + py'_2 + qy_2) \\ & = C_1.0 + C_2.0 = 0 \end{aligned} \nonumber

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, which eats numbers and spits out numbers). Define the operator LL by

L y = y + p y + q y . Ly=y''+py'+qy. \nonumber

The differential equation now becomes Ly=0Ly=0. The operator (and the equation) LL being linear means that L(C1y1+C2y2)=C1Ly1+C2Ly2L(C_1y_1 + C_2y_2) = C_1Ly_1 + C_2Ly_2. The proof above becomes

L y = L ( C 1 y 1 + C 2 y 2 ) = C 1 L y 1 + C 2 L y 2 = C 1 .0 + C 2 .0 = 0 Ly = L(C_1y_1 + C_2y_2) = C_1Ly_1 + C_2Ly_2 = C_1.0 + C_2.0 = 0 \nonumber

Two different solutions to the second equation yk2y=0y'' - k^2y = 0 are y1=cosh(kx)y_1 = \cosh(kx) and y2=sinh(kx)y_2 = \sinh (kx). Let us remind ourselves of the definition, coshx=ex+ex2\cosh x = \frac {e^x + e^{-x}}{2} and sinhx=exex2\sinh x = \frac {e^x - e^{-x}}{2}. Therefore, these are solutions by superposition as they are linear combinations of the two exponential solutions.

The functions sinh\sinh and cosh\cosh are sometimes more convenient to use than the exponential. Let us review some of their properties.

cosh 0 = 1 sinh 0 = 0 , d d x [ cosh x ] = sinh x , d d x [ sinh x ] = cosh x , cosh 2 x sinh 2 x = 1 . \begin{array}{lll}{\cosh 0=1}&{\quad}&{\sinh 0=0,} \\ {\frac{d}{dx}\left[\cosh x \right]=\sinh x,} &{\quad}&{\frac{d}{dx}\left[\sinh x\right] =\cosh x,} \\ {\cosh^{2}x-\sinh^{2}x=1.}&{}&{}\end{array} \nonumber

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

y ( x ) = b 0 cos ( k x ) + b 1 k sin ( k x ) y(x) = b_0 \cos (kx) + \frac {b_1}{k} \sin (kx) \nonumber

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

y ( x ) = b 0 cosh ( k x ) + b 1 k sinh ( k x ) y(x) = b_0 \cosh (kx) + \frac {b_1}{k} \sinh (kx) \nonumber

Using cosh\cosh and sinh\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.

For example, we found the solutions y1=sinxy_1 = \sin x and y2=cosxy_2 = \cos x for the equation y+y=0y'' + y = 0. It is not hard to see that sine and cosine are not constant multiples of each other. If sinx=Acosx\sin x = A \cos x for some constant AA, we let x=0x=0 and this would imply A=0A = 0. But then sinx=0\sin x = 0 for all xx, which is preposterous. So y1y_1 and y2y_2 are linearly independent. Hence,

y=C1cosx+C2sinxy = C_1 \cos x + C_2 \sin x \nonumber

is the general solution to y+y=0y'' + y = 0.

For two functions, checking linear independence is rather simple. Let us see another example. Consider y2x2y=0y''-2x^{-2}y = 0. Then y1=x2y_1 = x^2 and y2=1xy_2 = \frac{1}{x} are solutions. To see that they are linearly independent, suppose one is a multiple of the other: y1=Ay2y_1 = A y_2, we just have to find out that AA cannot be a constant. In this case we have A=y1y2=x3A = \frac{y_1}{y_2} = x^3, this most decidedly not a constant. So y=C1x2+C21xy = C_1 x^2 + C_2 \frac{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 y1y_1 as a solution of y+p(x)y+q(x)y=0y'' + p(x) y' + q(x) y = 0 we try a second solution of the form y2(x)=y1(x)v(x)y_2(x) = y_1(x) v(x). We just need to find vv. We plug y2y_2 into the equation:

0=y2+p(x)y2+q(x)y2=y1v+2y1v+y1v+p(x)(y1v+y1v)+q(z)y1v=y1v+(2y1+p(x)y1)v+(y1+p(x)y1+q(x)y1)0v.\begin{align}\begin{aligned} 0 = y_2'' + p(x) y_2' + q(x) y_2 & = y_1'' v + 2 y_1' v' + y_1 v'' + p(x) ( y_1' v + y_1 v' ) + q(z) y_1 v \\ & = y_1 v'' + (2 y_1' + p(x) y_1) v' + \cancelto{0}{\bigl( y_1'' + p(x) y_1' + q(x) y_1 \bigr)} v. \end{aligned}\end{align} \nonumber

In other words, y1v+(2y1+p(x)y1)v=0y_1 v'' + (2 y_1' + p(x) y_1) v' = 0. Using w=vw = v' we have the first order linear equation y1w+(2y1+p(x)y1)w=0y_1 w' + (2 y_1' + p(x) y_1) w = 0. After solving this equation for ww (integrating factor), we find vv by antidifferentiating ww. We then form y2y_2 by computing y1vy_1 v. For example, suppose we somehow know y1=xy_1 = x is a solution to y+x1yx2y=0y''+x^{-1}y'-x^{-2} y=0. The equation for ww is then xw+3w=0xw' + 3 w = 0. We find a solution, w=Cx3w = Cx^{-3}, and we find an antiderivative v=C2x2v = \frac{-C}{2x^2}. Hence y2=y1v=C2xy_2 = y_1 v = \frac{-C}{2x}. Any CC works and so C=2C=-2 makes y2=1xy_2 = \frac{1}{x}. Thus, the general solution is y=C1x+C21xy = C_1 x + C_2\frac{1}{x}.

Since we have a formula for the solution to the first order linear equation, we can write a formula for y2y_2:

y2(x)=y1(x)ep(x)dx(y1(x))2dxy_2(x) = y_1(x) \int \frac{e^{-\int p(x)\,dx}}{{\bigl(y_1(x)\bigr)}^2} \,dx \nonumber

However, it is much easier to remember that we just need to try y2(x)=y1(x)v(x)y_2(x) = y_1(x) v(x) and find v(x)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.

Adapted from Differential Equations for Engineers by Jiří Lebl (https://www.jirka.org/diffyqs/), © Jiří Lebl, licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.