Calculus

A Complete Guide to Understanding Second Order Differential Equations

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.

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)$
• $y’’$ indicates the second derivative of $y$ with respect to $x$

• $y’$ indicates the first derivative of $y$ with respect to $x$

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

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)$, we’re solving for a function or set of functions $y$ that satisfy the following condition: the product of some function $P(x)$ and the second derivative $y’’$, plus the product of some function $Q(x)$ and the first derivative $y’$, plus the product of some function $R(x)$ and the function $y$, is equal to another function $G(x)$.

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

$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)$, $Q(x)$, and $R(x)$ are constant coefficients. Then our equation looks like this, where $a, b$, and $c$ are constants:

$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 $\frac{dy}{dx} + 2xy = x$, the highest derivative is $\frac{dy}{dx}$. So, this equation is a first order differential equation.

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

• In the equation $y^{(3)} + 3xy’ - 5y = e^x$, the highest derivative is $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)$

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

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

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

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

We want to find the function (or set of functions) $y$ 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 = 0$:

$ar^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 $r_1$ and $r_2$:

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

The expression $b^2-4ac$ is called the discriminant. Finding the roots $r_1$ and $r_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:

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 $ar^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) = e^{rx}$ for some constant $r$. Its derivative $f’(x) = re^{rx}$ is simply a constant multiple of $f(x)$ itself. Its second derivative is $f’’(x) = r^2e^{rx}$, which is again a constant multiple of the function $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 = 0$. We can rewrite this equation as $y’’ = y$. This equation is asking us, “what function is equal to its second derivative?”

The exponential function $y = e^x$ satisfies that question, as does $Ce^x$ or $Ce^{-x}$. We can verify this by finding the auxiliary equation using $a = 1, b = 0$, and $c = -1$ to get $r^2 - 1 = 0$. By factoring this equation, we find that the roots are $r = 1$ and $r + 1$. Then, the general solution to $y = e^x$ is $y = 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’’ + 3y’ - 10y = 0$.

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

$r^2 + 3r - 10 = 0$
$(r+5)(r-2) = 0$
$r_1 = -5, r_2 = 2$

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

So, our general solution is:

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

Example 2 - Repeated Roots

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

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

Now, we can factor this equation to find:

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

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

So, our general solution is:

$y = c_1e^{3x} + c_2xe^{3x}$

Example 3 - Complex Roots

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

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

$r=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$
$r=\frac{4\pm\sqrt{4^2-4(1)(13)}}{2(1)}$
$r=\frac{4\pm\sqrt{16-52}}{2}$
$r=\frac{4\pm\sqrt{-36}}{2}$

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

$r=\frac{4\pm\sqrt{36}\cdot \sqrt{-1}}{2}$
$r=\frac{4\pm 6i}{2}$
$r=2\pm 3i$

So, $r_1 = 2 + 3i$ and $r_2 = 2 - 3i$. Now, using our table, this means that $\alpha = 2$ and $\mathcal{B} = 3$. We can now plug $\alpha = 2$ and $\mathcal{B} = 3$ into the general solution formula $y = e^{\alpha x}(c_1\cos{(\mathcal{B}x)} + c_2\sin{(\mathcal{B}x)}$.

So, our general solution is:

$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:

Explore course

Explore course

Explore course