Alexander Fufaev
My name is Alexander FufaeV and here I write about:

Exponential Ansatz and How to Solve Linear Differential Equations (of 2nd order)

DGL types: Ordinary, arbitrary order, linear
Exponential approach is suitable for ordinary DEQ of any order, which are linear.

The exponential ansatz is suitable for...

  • differential equations of arbitrary order with constant coefficients

  • and which are linear.

Of course, the method quickly becomes complex for higher orders. The method is best suited for second order differential equations. The general form of a 2nd order linear differential equation looks like this:

Here we assume that the coefficients \(K_1\) and \(K_0\), as well as the perturbation function are independent of \(x\). They are constant.

If the perturbation function is not zero, then you must first ask a mathematician. Then he will tell you that a general solution \(y\) of an inhomogeneous linear differential equation is composed of two parts:

  • a homogeneous solution \( y_{\text h} \) of the homogeneous differential equation

  • and of a particular solution, which we denote by \( y_{\text p} \).

The homogeneous solution \(y_{\text h}\) solves the differential equation 1 if you set the perturbation function \(S\) equal to zero:

In the method of the exponential ansatz, as the name suggests, we make the guess that the homogeneous solution \(y_{\text h}\) has the form of an exponential function:

Since the first and second derivatives of \(y_{\text h}\) occur in the general form 3 of the differential equation, we must differentiate our exponential ansatz twice. The first derivative is:

And the second derivative of the ansatz is:

Now we can insert the exponential ansatz and the corresponding derivatives into the homogeneous differential equation 3:

Let us factor out \(C \, \mathrm{e}^{\lambda \, x} \):

If we divide by this factor \(C \, \mathrm{e}^{\lambda \, x} \), then we get the so-called characteristic equation for \(\lambda\):

When we solve this equation, we find the unknown \(\lambda\). Since it is a quadratic equation for \(\lambda\), we get two solutions \(\lambda_1\) and \(\lambda_2\). We have to consider both of them.

Basically, you can set up the characteristic equation directly by looking at your differential equation without having to do all these steps. Compare the homogeneous differential equation with the characteristic equation. The coefficient in front of \(\lambda^2\) is in front of the second derivative of \(y\). In this case the coefficient is 1. The coefficient of \(\lambda\) is in front of the first derivative of \(y\), in this case \(K_1\). And the coefficient \(K_0\) in front of the function \(y\) itself stands alone in the characteristic equation. By the way, if you had a homogeneous 3rd order differential equation, then the characteristic equation would start with the cubic term \(\lambda^3\) and so on.

A quadratic equation has two solutions \(\lambda_1\) and \(\lambda_2\) and you can determine these for example with the quadratic formula:

Since you get two \(\lambda\) values, we have to consider both. To do this, you have to extend the exponential ansatz by another term in which the second \(\lambda\) value is in the exponent. With the corresponding \(\lambda\)-values this is the solution of the homogeneous 2nd order differential equation 3:

Depending on the values of the coefficients \(K_1\) and \(K_0\), the solutions may show different behavior. Because, if \(K_0\) is greater than \(\frac{{K_1}^2}{4}\), then you are taking the root of a negative number. In this case you get a solution that describes oscillations. I will show you this in an example.

On the other hand, if the differential equation to be solved is inhomogeneous, that is the perturbation function is not zero, then we still have to add the particular solution \( y_{\text p} \) to the homogeneous one to find a general solution.

For the particular solution we have to choose an appropriate approach depending on what form the perturbation function \(S\) has. Here we look at the simplest possible form, namely, when the perturbation function \(S\) is constant. Then the particular solution is given by perturbation function divided by the coefficient \(K_0\): \( y_{\text p} = \frac{S}{K_0} \). Now, to get a general solution of such an inhomogeneous differential equation, we have to add the homogeneous solution and the particular solution:

The two unknown constants \(C_1\) and \(C_2\) are determined by the constraints, as you know. Also note that this method of the exponential ansatz is a guess method. This is the case if the actual solution of the differential equation is not of exponential form. Therefore, if you use a solving method that contains the word 'ansatz' in its name, be sure to check your solution. You do this by substituting the solution you have found in the differential equation and checking if both sides are equal.

Example: Solve DEQ for an oscillating mass

Hooke Law: Displacement of the spring and restoring force Hover the image!
A mass on the spring experiences a restoring force when the spring is deflected.

The oscillating mass we want to consider is called a harmonic oscillator in physics. This is what the corresponding differential equation looks like:

This is a 2nd order differential equation with constant coefficients. The perturbation function is zero. That means, we only have to find out the homogeneous solution. And we do that with the exponential ansatz we just learned. Let's first write the differential equation in the more compact Newton notation, with points for the time derivatives:

Let's take the fast way and directly write down the characteristic equation. We expect a quadratic equation, because we have a 2nd order differential equation. The second derivative is preceded by the coefficient 1, so we just write \(\lambda^2\). Then the coefficient in front of the first derivative. Since the first derivative is missing in the differential equation, the \(\lambda\) term is absent as well. Next up is the coefficient \(D/m\) that is in front of the searched function. This coefficient stands alone in the characteristic equation. Altogether the characteristic equation reads:

For this equation we don't even need the quadratic formula. We get the solution directly if we first bring \(D/m\) to the other side:

and then take the square root:

Consider that the inverse of squaring gives two solutions, a positive and a negative square root. Also, we have an interesting case here when the square root of a negative number is taken. Square root of a negative number is not a real number, but an imaginary number. Do you remember what that means? We expect that the system must oscillate!

Even if you don't know complex numbers yet, you can split the term inside the square root into a product of -1 and \(D/m\). According to the square root laws you can split this product into two square roots:

Root of -1 is defined as the imaginary unit, a number which we denote by \(i\). That's all you need to know about complex numbers:

If we simply insert the \(\lambda\) values we have just found into the exponential ansatz, we get the general solution for the considered differential equation. Let us denote \(\sqrt{\frac{D}{m}}\) shortly as \(\omega\):

This solution seems very abstract. But I will show you that this solution corresponds to an oscillation. Before that let us determine the unknown constants \(C_1\) and \(C_2\) with initial conditions for our problem.

For example we could have ovserved that at the time \(t=0\) the displacement of the spring was 1. The spring was displaced to the maximum: \(y(0) = 1\). Insert this condition into the solution to determine \(C_1\):

Rearranging for \(C_1\) we get:

Next step is to determine the unknown constant \(C_2\) using the second initial condition. For this we use the fact that at \(t = 0\) the velocity of the mass was 0. In physics you learn that velocity corresponds to the first time derivative of the displacement. So our second initial condition is given by: \(y'(0) = 0 \).

So lets differentiate our general solution with respect to time \(t\). I hope you know how to differentiate an exponential function. The factor in front of \(t\) becomes a factor in front the exponential function:

And then we insert the second initial condition into the derivative. The exponential functions become 1 and the factor \(i \, \omega\) cancels out:

Rearranging for \(C_2\) we find out that:

So we know that \(C_2\) must be equal to \(C_1\). Nice. Lets replace \(C_2 \) in \(C_1 ~=~ 1 ~-~ C_2\) with \(C_1\) to determine concrete value for the constants:

The equation results in \(C_1 = \frac{1}{2}\). Since \(C_1\) and \(C_2\) are equal, \(C_2\) must be also equal to \(\frac{1}{2}\). Insert \(\frac{1}{2}\) into our general solution:

Now lets find out what this abstract solution has to do with oscillations! For this we get our friend Euler to help us, who tells us his famous Euler formula:

This relation tells us how the complex exponential function \(\mathrm{e}^{i \, \omega \, t}\) is related to cosine and sine functions. So the first complex exponential in our solution becomes cosine and sine with positive \(\omega \, t\) and the second complex exponential becomes cosine and sine with negative \(-\omega \, t\):

We can omit the minus sign in the argument of the cosine function because cosine is symmetric. That means: It has the same value for arguments \(x\) and \(-x\): \( \cos(-x) = \cos(x) \). The sine function on the other hand is antisymmetric. Therefore we cannot omit the minus in the argument but rather pull it out in front of the sine function. Because if we swap the sign of the argument the value of the sine function also swaps sign: \( \sin(-x) = -\sin(x) \). Let's use this fact:

Now you see, why this transformation was meaningful. Now the two complex sine functions cancel each other out and with them the imaginary unit disappears. What remains are the real cosine functions, which we can add together:

As you can see: The displacement \(y(t)\) changes periodically with time. The mass attached to the spring oscillates back and forth and the oscillation is described by the cosine function.

Now you know how to solve 2nd order inhomogeneous differential equations using the exponential ansatz. In the next lesson we will deal with the partial differential equations and the product ansatz (Separation of variables for PDE's).