# Differential Equations (DEQ): All the Basics Everyone Should Know

## Table of contents

- What is a differential equation? Here you will learn how to identify a differential equation and which problems involve DEQ's.
- Different notations of a differential equation Here you will learn the Leibniz, Newton and Lagrange notations of a differential equation.
- What should I do with a differential equation? Here you will learn what it means to solve a DEQ and whether it is always possible.
- How to identify a differential equation? What characterizes a DEQ and how do I know if I have a DEQ in front of me? This is the first question you have to answer before solving a DEQ!
- Classification: Which DEQ types are there? Here you will learn how to recognize when a DEQ is ordinary, partial, linear, homogeneous, inhomogeneous, and of what order it is.
- Constraints: Boundary and initial conditions Here you will learn why constraints to a DEQ are important and what the difference is between boundary and initial conditions.

## Video - Differential Equations explained simply in 47 minutes!

For example, if you plan to deal with...

the atomic world,

the movement of the planets,

chemical processes,

electrical circuits,

weather forecasts

or with the spread of a virus

then you will eventually encounter **differential equations**.

Once you understand how differential equations work and how to solve them, you will be able to see into the past and into the future. In this lesson you will learn the basics for it.

## What is a differential equation?

Let's look at Hooke's Law as a simple example:

**Hooke's Law**

This law describes the restoring force \(F\) on a mass attached to a spring. The mass experiences this force when you displace it by the distance \(y\) from the equilibrium position. \(D\) is a constant coefficient that describes how hard it is to stretch or compress the spring.

The mass \(m\) is hidden in the force. We can write the force according to Newton's second law as \(m \, a \):

**Newton axiom equal to Hooke's law**

Here \(a\) is the acceleration that the mass experiences when it is displaced by the distance \(y\) from its rest position. As soon as you pull on the mass and release it, the spring will start swinging back and forth. Without friction, as in this case, it will never stop swinging.

While the mass oscillates, the displacement \(y\) changes. The displacement is therefore dependent on the time \(t\). Thus also the acceleration \(a\) depends on the time \(t\). The mass of course remains the same at any time, no matter how much the spring is displaced. This is also true in good approximation for the spring constant \(D\):

**Newton axiom equal to Hooke's law with time dependence**

If we now bring \(m\) to the other side, we can use this equation to calculate the acceleration experienced by the mass at each displacement \(y\):

**Acceleration using Newton's axiom and Hooke's law**

But what if we are interested in the question:

*At which displacement \(y\) will the spring be after 24 seconds?*

To be able to answer such a future question, we must know how exactly \(y\) depends on the time \(t\). We only know that \(y\) DOES depend on time, but not HOW.

And exactly when dealing with such future questions differential equations come into play. We can easily show that the acceleration \(a\) is the second time derivative of the distance traveled, so in our case it is the second derivative of \(y\) with respect to time \(t\):

**Second time derivative of the deflection - differential equation for the spring law**

Now we have set up a differential equation for the displacement \(y\)! You can recognize a differential equation (in short: *DEQ*) by the fact that *in addition to the searched function* \(y(t)\) it also contains *derivatives of this function*. Like in this case the second derivative of \(y\) with respect to time \(t\).

## Different notations of a differential equation

You will certainly encounter many notations of a differential equation. We have written down our differential equation 1.4

in the commonly called **Leibniz notation**:

**Leibniz notation**

You will often encounter this notation in physics. We can also write it down a bit more compactly without mentioning the time dependence:

If the function \(y\) depends only on the time \(t\), then we can write down the time derivative even more compactly with the **Newton notation**. One time derivative of \(y\) corresponds to one point above \(y\). So if there is a second time derivative as in our case, there will be two points:

**Newton notation**

Obviously, this notation is rather unsuitable if you want to consider the tenth derivative...

Another notation you are more likely to encounter in mathematics is the Lagrange notation. Here we use primes for the derivatives. So for the second derivative, two primes:

**Lagrange notation**

In Lagrange notation, it should be clear from the context, with respect to which variable the function is differentiated. If it is not clear, then you should write out explicitly on which variables \(y\) depends:

**Spring law-DEQ in Lagrange notation**

Each notation has its advantages and disadvantages. However, remember that these are just different ways of writing down the same physics. Even rearranging and renaming does not change the physics under the hood of this differential equation. We could call the deflection \(y\) for example also as \(x\):

**Spring law-DGL in Lagrange notation all moved to one side**

## What should I do with a differential equation?

To answer our previous question:

*At which displacement \(y\) will the spring be after 24 seconds?*

we must solve the posed **differential equation**. Solving a differential equation means that you have to find out *how* the function \(y\) you are looking for exactly depends on the variable \(t\):

**Searched function in a DGL**

For simple differential equations, like the one of the oscillating mass, there are solving methods you can use to find the function \(y(t)\). Keep in mind, however, that there is no general recipe for how you can solve an *arbitrary* differential equation. For some differential equations there is not even an *analytic solution*! Here the expression '*not analytic*' means that you cannot write down a concrete equation for the function \(y(t)\):

**No solution of the DGL**

The only possibility in this case is to solve the differential equation on the computer *numerically*. Then the computer does not spit out a concrete formula, but data points, which you can represent in a diagram and then analyze the behavior of the differential equation.

## How to identify a differential equation?

Once you encounter a differential equation, the first thing you need to figure out is

which one is

*the function you are looking for*and

*which variables it depends on*.

In our differential equation 5

of the oscillating mass, the function we are looking for is called \(y\) and it depends on the variable \(t\):

**Hooke Law-DEQ**

As another example, look at the wave equation that describes the electric field of an electromagnetic wave propagating at the speed of light \(c\):

**Wave equation-DEQ for the E-field**

What is the function you are looking for in this differential equation? It is the function \(E\), because its derivatives occur here. On which variables does the function \(E\) depend? The dependence is not explicitly given here but from the derivatives you can immediately see that \(E\) must depend on \(x\), \(y\), \(z\) and on \(t\). That is, on a total of four variables: \(E(t,x,y,z)\).

Let's look at a slightly more complex example. This system of differential equations describes how a mass moves in a three dimensional gravitational field:

**DEQ for the motion of a mass point in the gravitational field**

\frac{\text{d}^2\class{green}{y}}{\text{d}\class{gray}{t}^2} &~=~ G \, \frac{m}{\sqrt{\class{red}{x}^2 + \class{green}{y}^2 + \class{blue}{z}^2}} \\\\

\frac{\text{d}^2\class{blue}{z}}{\text{d}\class{gray}{t}^2} &~=~ G \, \frac{m}{\sqrt{\class{red}{x}^2 + \class{green}{y}^2 + \class{blue}{z}^2}} \end{align} $$

Here you have a **coupled differential equation system**. In this case *a single* differential equation is not sufficient to describe the motion of a mass in the gravitational field. In fact, three functions are searched here, namely the trajectories \(x(t)\), \(y(t)\) and \(z(t)\), which determine a position of the mass in three-dimensional space. Each function describes the motion in one of the three spatial directions. And all three trajectories depend only on the time \(t\).

What does it even mean, if we have *coupled* differential equations? The word 'coupled' means that, for example, in the first differential equation for the function \(x\), there is also the function \(y\). So we cannot simply solve the first differential equation independently of the second one, because the second equation tells us how \(y\) behaves in the first equation. In all three differential equations, all of the searched functions \(x\), \(y\) and \(z\) occur, which means that we have to solve all three differential equations simultaneously.

## Classification: Which DEQ types are there?

There are various types of differential equations out there. However, if you look closely, you will notice that some differential equations have similarities between them.

After you have found out what function you are searching for and which variables it depends on, you should answer some more basic questions to get to know the differential equation better:

**Is the differential equation ordinary or partial?**

Partial differential equations describe multidimensional problems and are significantly more complex.**Of which order is the differential equation?**

1st order differential equations are usually easy to solve and describe, for example, exponential behavior such as radioactive decay or the cooling of a liquid. Differential equations of 2nd order, on the other hand, are somewhat more complex and also often occur in nature. Maxwell's equations of electrodynamics, Schrödinger's equation of quantum mechanics - these are all 2nd order differential equations. Only starting from the 2nd order a differential equation can describe an oscillation. And only starting from the third order a differential equation can describe chaos.**Is the differential equation linear or non-linear?**

The superposition principle applies to linear differential equations, which is incredibly useful, for example, in the description of electromagnetic phenomena. Non-linear differential equations are much more complex and occur, for example, in non-linear electronics in the description of superconducting currents. Moreover, chaos can only occur in non-linear differential equations of third order and higher. When you encounter such an equation sometimes the only thing you can do is throw away your pen and paper and solve the equation numerically on the computer. Many non-linear differential equations cannot even be solved analytically!**Is the linear differential equation homogeneous or inhomogeneous?**

Homogeneous linear differential equations are simpler than the inhomogeneous ones and describe, for example, an undisturbed oscillation, while inhomogeneous differential equations are also able to describe externally disturbed oscillations.

After you have classified a differential equation, you can then specifically apply an appropriate method to solve the equation. Even if there is no specific solving method, you will know how complex a differential equation is based on the classification.

### Is a differential equation ordinary or partial?

Our equation for the oscillating mass:

is an **ordinary** differential equation. Ordinary means that the function \(y(t)\) we are looking for only depends *on one* variable. In this case on the time \(t\).

The wave equation, on the other hand:

is a **partial** differential equation. 'Partial' means that the searched function \(E\) depends on at least two variables and derivatives with respect to these variables occur in the equation. In this case \(E\) depends on four variables: \(t\), \(x\), \(y\) and \(z\). And in the differential equation also derivatives with respect to these variables appear.

### Of which order is a differential equation?

Furthermore our equation for the oscillating mass is a **differential equation of 2nd order**. The order of a differential equation is the highest occurring derivative of the searched function:

Since in our equation the second derivative of \(y\) is *the highest one*, this is therefore the 2nd order differential equation.

**Convert higher order DEQ's into 1st order DEQ's**

It is always possible to convert a higher order differential equation into a system of 1st order differential equations. Sometimes this procedure is helpful in solving the differential equations. For example, we can convert this 2nd order differential equation into two coupled 1st order differential equations. For this we just have to introduce a new function, let's call it \(v\) and define it as the first time derivative of \(y\):

**Velocity as time derivative of the displacement is a first order DEQ**

This is already one of the two 1st order DEQ. Now we only have to express the second derivative in the original DEQ with the derivative of \(v\). Then we get the second DEQ of 1st order:

**First order DEQ for Hooke's law**

The two equations are *coupled* differential equations, which we must solve simultaneously. They are coupled because both \(y\) and \(v\) occur in the first DEQ as well as in the second DEQ. You can use this procedure whenever you want to reduce the order of a differential equation. The price you have to pay is additional coupled differential equations.

The differential equation for the radioactive decay law,

on the other hand, is a **first-order differential equation** because the highest occurring derivative of the searched function \(N(t)\) is the first derivative.

### Is a differential equation linear or non-linear?

Moreover, our equation for the oscillating mass is **linear**:

Linear means that the searched function and its derivatives contain *only powers of 1* and there occur *no products of derivatives with the function*, like \(y^2\) or \(y \, \frac{\text{d}^2y}{\text{d}t^2} \). There also occur *no composed* functions, such as \(\sin(y(t))\) or square root of \(y(t)\).

The radioactive decay law is also linear:

What about the wave equation? It is also linear:

The coupled differential equation system for the motion of a mass in the gravitational field, on the other hand, is **non-linear**:

**Example of a non-linear DEQ - mass in the gravitational field**

\frac{\text{d}^2y}{\text{d}t^2} &~=~ G \, \frac{m}{\sqrt{x^{\class{blue}{2}} ~+~ y^{\class{blue}{2}} ~+~ z^{\class{blue}{2}}}} \\\\

\frac{\text{d}^2z}{\text{d}t^2} &~=~ G \, \frac{m}{\sqrt{x^{\class{blue}{2}} ~+~ y^{\class{blue}{2}} ~+~ z^{\class{blue}{2}}}} \end{align} $$

Here the searched functions \(x(t)\), \(y(t)\) and \(z(t)\) occur in quadratic form. But even if the squares were not there, there would still be the square root and the fraction, which make the differential equation system non-linear!

### Is a linear differential equation homogeneous or inhomogeneous?

In the next types of differential equations the *coefficients* multiplied by the searched function and its derivatives are important. In some solving methods it is important to distinguish between...

**constant coefficients**- do NOT depend on the variables on which the searched function also depends.**non-constant coefficients**- do DEPEND on the variables on which the searched function depends.

A coefficient must not necessarily be multiplied with the searched function or its derivative. It can also stand *alone*! In this case we call the single coefficient a **perturbation function**.

In our differential equation for the oscillating mass there is an interesting coefficient which is multiplied by the searched function \(y\), namely \(D/m\). Strictly speaking, there is also a coefficient in front of the second derivative, namely 1, and the single coefficient, i.e. the perturbation function, is 0 here. So it does not exist:

The wave equation is also homogeneous:

Because here there is also no single coefficient, the perturbation function is zero.

The differential equation for a forced oscillation, on the other hand, is inhomogeneous:

**Example of an inhomogeneous DEQ - Forced oscillation**

Here the external force \(F(t)\) corresponds to the perturbation function. As you can see, it stands alone without being multiplied by the function \(y(t)\) or its derivatives. Moreover, the perturbation function \(F(t)\) is time dependent, so it is a non-constant coefficient.

## Constraints: Boundary and initial conditions

A differential equation alone, is not sufficient to describe a physical system *uniquely*. The solution of a differential equation describes quite a few possible systems that have a certain behavior. For example, the solution of the radioactive decay law describes an *exponential* behavior. However, the knowledge about an exponential behavior is not sufficient to be able to say concretely how many atomic nuclei have decayed after 10 seconds.

This is exactly why for every differential equation there are usually given **constraints**. These are additional information, which must be given to a differential equation, in order to specify the solution of the equation. The *number* of necessary constraints depends on the \textit{order} of the differential equation.

For a 1st order differential equation, *a single constraint* is necessary, namely

a function value of the searched function \(y(t)\).

For the radioactive decay law, for example, it should be stated how many not yet decayed atomic nuclei \(N\) were present at the time \(t = 0 \). For example one 1000 atomic nuclei: \(N(0) = 1000 \).

For a 2nd order differential equation *two constraints* are necessary:

a function value of the searched function \(y(t)\) and

for example a function value of the first derivative \(y'(t)\)

For an oscillating mass, the function value could be \( y(0) = 1\), which sets the initial displacement, and the function value of the first derivative could be \(y'(0) = 0\), which sets the initial velocity of the mass.

For a 3rd order differential equation then *three constraints* would be necessary to describe a system uniquely:

a function value of the searched function \(y(t)\)

a function value for example of its first derivative \(y'(t)\) and

a function value for example of its second derivative \(y''(t)\)

For a 4th order differential equation then *four constraints* would be necessary and so on...

Most of the time you will come across *initial conditions* and *boundary conditions*. These are also just names for constraints that tell you what kind of information you have about the system.

Sometimes, for example, you know in which state the system was at a certain time. This could be the initial time at which you displaced and released a mass on a spring. In such a case we speak of **initial conditions**. You specify *at one certain* point in time, for example at time \(t=0\), wich value the displacement \(y(0)\) had. And since we need two constraints, you also specify which value the derivative \(y'(0)\) (that is the velocity) had at that same point in time \(t = 0\).

Sometimes you are unlucky and do not know the velocity of the oscillating mass at a certain initial time \(t = 0\). So you don't know the derivative of \(y'(0)\) at the time \(t = 0\), at which you also know the displacement \(y(0\). But you really need two constraints, otherwise you can't calculate concrete numbers... But maybe you know that for example after \( t = 6 \, \text{s}\) the oscillating mass was in the maximum displaced state. So you know the displacement \(y(6)\).

If you have constraints, such as \(y(t_1)\) and \(y(t_2)\), given to describe the system at two \textit{different} points in time \(t_1\) and \(t_2\), then we call them **boundary conditions**.

The 'function values at two different points in time' was of course just an example. Instead of time, it could be any variable that fixes the system at the boundaries. At different times, at different positions, at different angles and so on.

So, now you have learned all the necessary basics about differential equations. In the next lesson, we will take a look at how we can solve differential equations using different methods.