An Operator Method for Solving Second Order Differential Equations

In talking about power series in a previous post, I mentioned one of their uses: as an aid in solving differential equations. This reminds me of a neat trick for solving some differential equations, which I will discuss in this post.

A standard method for solving linear differential equations with constant coefficients is to assume a trial solution of the form $y = e^{rx}$, run it through the differential equation, solve the resulting algebraic equation for $r$, and then take it from there.

For example, consider the differential equation

$y^{\prime \prime} – y = 0$

Let’s suppose that there is a solution to the differential equation of the form $y = e^{rx}$. Then

$y^{\prime} = re^{rx} \quad$ and $y^{\prime \prime} = r^2e^{rx}$

Inserting the expressions for $y$ and $y^{\prime \prime}$ into the differential equation, we get

$r^2e^{rx} – e^{rx} = 0 \quad$ which means that $e^{rx}(r^2 – 1) = 0 $

Since the exponential factor is not equal to zero, it follows that

$r^2 – 1 = 0 \quad$ which is equivalent to $(r + 1)(r – 1) = 0$

The conclusion is that a function of the form $y = e^{rx}$  really is a solution to the differential equation, but only if $r = -1$ or $r = 1$. So we have found two solutions to the differential equation,

$y = e^{-x} \quad $ and $y = e^{x}$

The next step in this standard solution is to invoke some theory: There is a theorem that states that because the differential equation is second order, linear, and has constant coefficients, once we have found two linearly independent solutions, which we have done, then all possible solutions of the differential equation are of the form

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

where $c_1$ and $c_2$ are constants that are typically determined in each situation using initial conditions.

There is a nice linear algebra connection here, which dovetails nicely with our recent series of posts on the concept of a basis: The set of solutions of the differential equation $y^{\prime \prime} – y = 0$ is a two-dimensional vector space, and the two fundamental solutions (as they’re called in many textbooks), $y = e^{-x}$ and $y = e^{x}$, form a basis for the solution space.

An alternative method

Now there is something annoying about the standard solution method; at least it annoys some people. Even though the standard method amounts to the “guess and check” method, which is quite respectable, some people consider it an unmotivated “rabbit-out-of-the-hat” trick. They would prefer a more deductive procedure, where no assumptions about the solution have to be made.

OK, here goes. Adopt a more abstract approach, and write the differential equation $y^{\prime \prime} – y = 0$ in the form

$(D^2 – 1)y = 0$

In the previous line, $D$ stands for the operation of differentiation. That is, $Dy$ represents the operation of differentiating $y$, which results in $y^{\prime}$. Similarly, $D^2$ means to apply the $D$-operator twice, so that $D^2y$ results in $y^{\prime \prime}$. Thought of as operators, real numbers applied to functions result in multiplication of the function by the number. (One really ought to note that there is an identity operator present, as in $(D^2 – 1\cdot I)y = 0$, but it’s customary to omit it, and hope that readers understand the implicit meaning.)

Now for the trick: Treat the operator expression $(D^2 – 1\cdot I)$ as if it were an algebraic expression, and factor it as such. Then the differential equation takes the form

$(D – 1\cdot I)(D + 1\cdot I)y = 0$ or simply $(D – 1)(D + 1)y = 0$

Now let $z$ stand for the function $(D + 1)y$. Notice that we can thereby reduce the second order differential equation $(D – 1)(D + 1)y = 0$ to a pair of first-order equations:

$(D – 1)z = 0$ and $(D + 1)y = z$

Being first-order equations, they will be easier to solve; what we’re banking on is that solving two first-order equations is easier than solving one second-order equation. The savings may not be much in this example, but it’s a general idea worth keeping in mind.

The first equation, $(D – 1)z = 0$, can be translated back into usual form as

$z^{\prime} – z = 0$

This is a linear first order equation, and can be solved by multiplying each term by the integrating factor $e^{-x}$:

$e^{-x}z^{\prime} – e^{-x}z = 0$

$\dfrac{{\rm d}}{{\rm d}x} \left ( e^{-x}z \right ) = 0$

$e^{-x}z = c$              (where $c$ is a constant)

$z = ce^x$

Now take this expression, substitute it for $z$ in the other first-order equation, and solve for $y$:

$(D + 1)y = z$

$(D + 1)y = ce^x$

$y^{\prime} + y = ce^x$

$e^xy^{\prime} + e^xy = ce^{2x}$         (multiplying each term by the integrating factor $e^x$)

$\dfrac{{\rm d}}{{\rm d}x} \left ( e^xy \right ) = ce^{2x}$

$e^xy = \int ce^{2x}\, {\rm d} x$

$e^xy = \dfrac{c}{2}e^{2x} + b$

$y = \dfrac{c}{2}e^x + be^{-x} $         (multiplying each term by $e^{-x}$)

And this is exactly the same as the solution obtained by the standard method, if we identify the arbitrary constants $c_1$ with $b$ and $c_2$ with $c/2$.

It’s worth mentioning that $D$ is a linear operator, and from this it follows that the operator in the differential equation, $(D^2 – 1\cdot I)$, is also a linear operator. Solving the differential equation, in our example, amounts to finding the null-space (or kernel, if you’d rather call it that) of the linear operator, which is itself a subspace of the vector space that $(D^2 – 1\cdot I)$ acts on. We never did specify what that space is, did we? But it lends support to the comment made earlier that the solution of this differential equation is a two-dimensional vector space, so all one need do is find a basis for the space; then all possible solutions are linear combinations of the two basic solutions.

The operator approach works well for linear ordinary differential equations with constant coefficients. Of course, the resulting operator (i.e, the polynomial in $D$) must be factorable. But the method still works if the factors are complex. For example, consider the differential equation

$y^{\prime \prime} + y = 0$

which can be written in operator form as

$(D^2 + 1)y = 0$

and in factored form as

$(D – i)(D + i)y = 0$

Apply the operator method and see if you can solve this equation.

* * *

Here’s the result: The space of all possible solutions consists of functions of the form

$y = c_1e^{-ix} + c_2e^{ix}$

where $c_1$ and $c_2$ are constants. Typically we would like to extract real solutions from the complex expression, and by using Euler’s formula, you can write the solution in the form

$y = A\cos x + B\sin x$

where $A$ and $B$ are constants.

* * *

Click here to read An Operator Method for Solving Second Order Differential Equations, Part 2.

(This post first appeared at my other (now deleted) blog, and was transferred to this blog on 22 January 2021.)