ocean waves representing second order differential equation

Calculus

A Complete Guide to Understanding Second Order Differential Equations

04.04.2022 • 7 min read

Rachel McLean

Subject Matter Expert

In this article, we’ll discuss the definition of second order differential equations, the difference between homogeneous and nonhomogeneous differential equations. Then, we’ll learn how to solve second order differential equations.

Share

In This Article

  1. Understanding Second Order Differential Equations

  2. What is the Difference Between the First Order and Second Order Differential Equations?

  3. How to Solve Homogeneous Linear Second Order Differential Equations

Understanding Second Order Differential Equations

What is a second order differential equation? A differential equation is an equation that involves an unknown function and its derivatives.

The general equation for a linear second order differential equation is:

P(x)y’’+Q(x)y+R(x)y=G(x)P(x)y’’ + Q(x)y’ + R(x)y = G(x)
  • y’’y’’ indicates the second derivative of yy with respect to xx

  • yy’ indicates the first derivative of yy with respect to xx

P(x)P(x), Q(x)Q(x), and R(x)R(x) are each functions of xx. We can call this equation linear because each of these functions is a function of xx only. Each term on the left-hand side of the equation has one of these functions of xx as its coefficient. Altogether, these terms are equal to G(x)G(x), another function of xx.

It can be helpful to verbalize exactly what we’re solving for. When we solve the differential equation P(x)y’’+Q(x)y+R(x)y=G(x)P(x)y’’ + Q(x)y’ + R(x)y = G(x), we’re solving for a function or set of functions yy that satisfy the following condition: the product of some function P(x)P(x) and the second derivative y’’y’’, plus the product of some function Q(x)Q(x) and the first derivative yy’, plus the product of some function R(x)R(x) and the function yy, is equal to another function G(x)G(x).

You might also see the differential equation P(x)y’’+Q(x)y+R(x)y=G(x)P(x)y’’ + Q(x)y’ + R(x)y = G(x) written using Leibniz’s notation, like this:

P(x)d2ydx2+Q(x)dydx+R(x)y=G(x)P(x)\frac{d^2y}{dx^2} + Q(x)\frac{dy}{dx} + R(x)y = G(x)

We will assume that the functions P(x)P(x), Q(x)Q(x), and R(x)R(x) are constant coefficients. Then our equation looks like this, where a,ba, b, and cc are constants:

ay’’+by+cy=G(t)ay’’ + by’ + cy = G(t)

A differential equation is an equation that involves an unknown function and its derivatives.

What is the Difference Between the First Order and Second Order Differential Equations?

What is the order of a differential equation? The order of a differential equation is determined by the highest order derivative contained in the equation. For example:

  • In the equation dydx+2xy=x\frac{dy}{dx} + 2xy = x, the highest derivative is dydx\frac{dy}{dx}. So, this equation is a first order differential equation.

  • In the equation y’’+5y+6y=0y’’ + 5y’ + 6y = 0, the highest derivative is y’’y’’. So, this equation is a second order differential equation.

  • In the equation y(3)+3xy5y=exy^{(3)} + 3xy’ - 5y = e^x, the highest derivative is y(3)y^{(3)}. So, this equation is a third order differential equation.

How to Solve Homogeneous Linear Second Order Differential Equations?

Next, we’ll learn how to find the general solution of homogeneous linear second order differential equations. To do this, we’ll first compare the difference between homogeneous and nonhomogeneous differential equations.

Nonhomogeneous Differential Equations

Take a look again at our general equation for a linear second order differential equation with constant coefficients:

ay’’+by+cy=G(x)ay’’ + by’ + cy = G(x)

If G(x)0G(x) \neq 0 for some xx, then the equation is called nonhomogeneous. For example, y’’+y2y=sin(x)y’’ + y’ - 2y = \sin{(x)} is a nonhomogeneous differential equation because sin(x)0\sin{(x)} \neq 0 for all xx.

Homogeneous Differential Equations

Once more, here’s our general equation for a linear second order differential equation with constant coefficients:

ay’’+by+cy=G(x)ay’’ + by’ + cy = G(x)

If G(x)=0G(x) = 0 for all xx and a0a \neq 0, then the equation is called homogeneous. Now, our equation looks like this:

ay’’+by+cy=0ay’’ + by’ + cy = 0

We want to find the function (or set of functions) yy that satisfies this equation. To solve for this function, it might be helpful to ask yourself this question: for what function is the product of a constant and the function’s second derivative, plus the product of another constant and the function’s first derivative, plus the product of a third constant and the function, equal to 0?

For each equation of this type, we can write its corresponding characteristic equation. This equation is also known as the auxiliary equation of ay’’+by+cy=0ay’’ + by’ + cy = 0:

ar2+br+c=0ar^2 + br + c = 0

Finding the roots of this equation helps us to find the general solution of the differential equation. The roots of an equation are the x-intercepts or “zeros.”

We can often find the roots of an equation by factoring. When factoring doesn’t work, we can use the quadratic formula to find the roots r1r_1 and r2r_2:

r=b±b24ac2ar=\frac{-b\pm\sqrt{b^2-4ac}}{2a}

The expression b24acb^2-4ac is called the discriminant. Finding the roots r1r_1 and r2r_2 of the auxiliary equation, and determining the sign of the discriminant, provides us with the general solution to the differential equation.

There are three possible cases:

Graph showing 3 simple steps to finding the general solution for a homogeneous linear second order differential equation

Using the table above, here are 3 simple steps to finding the general solution for a homogeneous linear second order differential equation:

Step 1

Write the auxiliary equation ar2+br+c=0ar^2 + br + c = 0.

Step 2

Find the roots of the auxiliary equation by factoring or using the quadratic formula.

Step 3

Based on the sign of the discriminant, use the table above to plug the roots into the general solution formula.

Let’s try to understand why the exponential function plays a large role in determining the general solution. Consider the function f(x)=erxf(x) = e^{rx} for some constant rr. Its derivative f(x)=rerxf’(x) = re^{rx} is simply a constant multiple of f(x)f(x) itself. Its second derivative is f’’(x)=r2erxf’’(x) = r^2e^{rx}, which is again a constant multiple of the function f(x)f(x).

To see how this plays out in finding the general solution, let’s take a simple example of a homogeneous linear differential equation, y’’y=0y’’ - y = 0. We can rewrite this equation as y’’=yy’’ = y. This equation is asking us, “what function is equal to its second derivative?”

The exponential function y=exy = e^x satisfies that question, as does CexCe^x or CexCe^{-x}. We can verify this by finding the auxiliary equation using a=1,b=0a = 1, b = 0, and c=1c = -1 to get r21=0r^2 - 1 = 0. By factoring this equation, we find that the roots are r=1r = 1 and r+1r + 1. Then, the general solution to y=exy = e^x is y=C1ex+C2exy = C_1e^x + C_2e^{-x}.

So, the exponential function plays a big role in answering the question, “what is the general solution of a second order differential equation”?

John Urschel, a doctoral candidate in applied mathematics at the Massachusetts Institute of Technology and a retired NFL guard, talks a bit more about exponential functions:

Example 1 - Distinct Real Roots

Find the general solution of y’’+3y10y=0y’’ + 3y’ - 10y = 0.

The auxiliary equation for y’’+3y10y=0y’’ + 3y’ - 10y = 0 is r2+3r10=0r^2 + 3r - 10 = 0. Now, we can factor this equation to find:

r2+3r10=0r^2 + 3r - 10 = 0
(r+5)(r2)=0(r+5)(r-2) = 0
r1=5,r2=2r_1 = -5, r_2 = 2

We have two real roots and our discriminant b24ac>0b^2 - 4ac > 0. Using the table, we can now plug our roots into the general solution formula y=c1er1x+c2er2xy = c_1e^{r_1x} + c_2e^{r_2x}.

So, our general solution is:

y=c1e5x+c2e2xy = c_1e^{-5x} + c_2e^{2x}

Example 2 - Repeated Roots

Find the general solution of y’’6y+9y=0y’’ - 6y’ + 9y = 0.

The auxiliary equation for y’’6y+9y=0y’’ - 6y’ + 9y = 0 is r26r+9=0r^2 - 6r + 9 = 0.

Now, we can factor this equation to find:

r26r+9=0r^2 - 6r + 9 = 0
(r3)(r3)=0(r-3)(r-3) = 0
(r3)2=0(r-3)^2 = 0
r=3r = 3

This means that r=3r = 3 is a repeated root and our discriminant b24ac=0b^2 - 4ac = 0. Using the table, we can now plug our root into the general solution formula y=c1erx+c2xerxy = c_1e^{rx} + c_2xe^{rx}.

So, our general solution is:

y=c1e3x+c2xe3xy = c_1e^{3x} + c_2xe^{3x}

Example 3 - Complex Roots

Find the general solution of y’’4y+13y=0y’’ - 4y’ + 13y = 0.

The auxiliary equation for y’’4y+13y=0y’’ - 4y’ + 13y = 0 is r24r+13=0r^2 - 4r + 13 = 0. Now, using the quadratic formula, let’s find the roots of this equation using a=1,b=4a = 1, b = -4, and c=13c = 13.

r=b±b24ac2ar=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
r=4±424(1)(13)2(1)r=\frac{4\pm\sqrt{4^2-4(1)(13)}}{2(1)}
r=4±16522r=\frac{4\pm\sqrt{16-52}}{2}
r=4±362r=\frac{4\pm\sqrt{-36}}{2}

At this point, notice that our discriminant b24ac=36b^2-4ac = -36. This means that we will have two complex roots. As we continue, remember that i=1i = \sqrt{-1}.

r=4±3612r=\frac{4\pm\sqrt{36}\cdot \sqrt{-1}}{2}
r=4±6i2r=\frac{4\pm 6i}{2}
r=2±3ir=2\pm 3i

So, r1=2+3ir_1 = 2 + 3i and r2=23ir_2 = 2 - 3i. Now, using our table, this means that α=2\alpha = 2 and B=3\mathcal{B} = 3. We can now plug α=2\alpha = 2 and B=3\mathcal{B} = 3 into the general solution formula y=eαx(c1cos(Bx)+c2sin(Bx)y = e^{\alpha x}(c_1\cos{(\mathcal{B}x)} + c_2\sin{(\mathcal{B}x)}.

So, our general solution is:

y=e2x(c1cos(3x)+c2sin(3x)y = e^{2 x}(c_1\cos{(3x)} + c_2\sin{(3x)}

Explore Outlier's Award-Winning For-Credit Courses

Outlier (from the co-founder of MasterClass) has brought together some of the world's best instructors, game designers, and filmmakers to create the future of online college.

Check out these related courses:

Calculus I

Calculus I

Explore course

Intro to Statistics

Intro to Statistics

Explore course

Intro to Microeconomics

Intro to Microeconomics

Explore course