## Level 3

# Differential equations (DEQ): Important basics + 4 solving methods

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

**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 video I will teach you the basics for it.

## What is a differential equation?

Let's look at Hooke's Law as a simple example:`1\[ F ~=~ -D\,y \]`

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 \):`1.1\[ m \, a ~=~ -D\,y \]`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\):`1.2\[ m \, a(t) ~=~ -D\,y(t) \]`

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\):`1.3\[ a(t) ~=~ -\frac{D}{m}\,y(t) \]`

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\):`1.4\[ \frac{\text{d}^2y(t)}{\text{d}t^2} ~=~ -\frac{D}{m}\,y(t) \]`

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 equation1.4in the so-called Leibniz notation:

**Leibniz notation**

`2\[ \frac{\text{d}^2y(t)}{\text{d}t^2} ~=~ -\frac{D}{m}\,y(t) \]`

You will often encounter this notation in physics. We can also write it down a bit more compactly without mentioning the time dependence:`2.1\[ \frac{\text{d}^2y}{\text{d}t^2} ~=~ -\frac{D}{m}\,y \]`

If the function \(y\) depends only on the time \(t\), then we can write down the time derivative even more compactly with the so-called 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**

`2.2\[ \ddot{y} ~=~ -\frac{D}{m}\,y \]`

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**

`2.3\[ y'' ~=~ -\frac{D}{m}\,y \]`

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:`2.4\[ y''(t) ~=~ -\frac{D}{m}\,y(t) \]`

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\):`2.5\[ \frac{\text{d}^2x}{\text{d}t^2} ~+~ \frac{D}{m}\,x ~=~ 0 \]`

## 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\):`3\[ y(t) ~=~ \text{some formula} \]`

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)\):`3.1\[ y(t) ~=~ \text{there is no formula} \]`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 1.4

of the oscillating mass, the function we are looking for is called \(y\) and it depends on the variable \(t\):`4\[ \frac{\text{d}^2 \class{red}{ y(t) } }{\text{d}t^2} ~=~ -\frac{D}{m}\,\class{red}{ y(t) } \]`

As another example, look at the wave equation that describes the electric field of an electromagnetic wave propagating at the speed of light \(c\):`4.1\[ \frac{\partial^2 \class{red}{E}}{\partial \class{gray}{x}^2} ~+~ \frac{\partial^2 \class{red}{E}}{\partial \class{gray}{y}^2} ~+~ \frac{\partial^2 \class{red}{E}}{\partial \class{gray}{z}^2} ~=~ \frac{1}{c^2} \, \frac{\partial^2 \class{red}{E}}{\partial \class{gray}{t}^2} \]`

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:`4.2\begin{align}
\frac{\text{d}^2\class{red}{x}}{\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{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 so-called **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`5\[ \frac{\text{d}^2y}{\text{d}\class{gray}{t}^2} ~+~ \frac{D}{m}\,y ~=~ 0 \]`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\).

**Ordinary differential equation**In this type of differential equation, the function you are looking for depends on a single variable.

`5.1\[ \frac{\partial^2 \class{red}{E}}{\partial \class{gray}{x}^2} ~+~ \frac{\partial^2 \class{red}{E}}{\partial \class{gray}{y}^2} ~+~ \frac{\partial^2 \class{red}{E}}{\partial \class{gray}{z}^2} ~=~ \frac{1}{c^2} \, \frac{\partial^2 \class{red}{E}}{\partial \class{gray}{t}^2} \]`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.

**Partial differential equation**In this type of differential equation the searched function depends on at least two variables and derivatives of the function with respect to at least two of these variables occur.

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

`5.2\[ \class{red}{\frac{\text{d}^2y}{\text{d}t^2}} ~+~ \frac{D}{m}\,y ~=~ 0 \]`

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

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\):`5.3\[ v ~=~ \frac{\text{d}y}{\text{d}t} \]`

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:`5.4\[ \frac{\text{d}v}{\text{d}t} ~+~ \frac{D}{m}\,y ~=~ 0 \]`

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,`5.5\[ - \lambda \, N ~=~ \class{red}{\frac{\text{d}N}{\text{d}t}} \]`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.

**Differential equation of nth order**A differential equation is called of n-th order, if the n-th derivative is the highest that occurs in the DEQ.

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

Moreover, our equation for the oscillating mass is **linear**:`5.6\[ \left(\frac{\text{d}^2y}{\text{d}t^2}\right)^{\class{red}{1}} ~+~ \frac{D}{m}\,y^{\class{red}{1}} ~=~ 0 \]`

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)\).

*to the power of two*' in the second derivative in the Leibniz notation \( \frac{ \text{d}^2 y }{ \text{d}t^2} \) is not a power of the derivative, but merely a notation that it is the second derivative.

The radioactive decay law is also linear:`5.7\[ - \lambda \, N^{\class{red}{1}} ~=~ \left(\frac{\text{d}N}{\text{d}t} \right)^{\class{red}{1}} \]`

What about the wave equation? It is also linear:`5.8\[ \left(\frac{\partial^2 E}{\partial x^2}\right)^{\class{red}{1}} ~+~ \left(\frac{\partial^2 E}{\partial y^2}\right)^{\class{red}{1}} ~+~ \left(\frac{\partial^2 E}{\partial z^2}\right)^{\class{red}{1}} ~=~ \frac{1}{c^2} \, \left(\frac{\partial^2 E}{\partial t^2}\right)^{\class{red}{1}} \]`

**Linear differential equation**A differential equation is linear if the searched function and its derivatives appear only with the power 1 and there are no products of the searched function with its derivatives and also no compositions with the searched function.

The coupled differential equation system for the motion of a mass in the gravitational field, on the other hand, is **non-linear**:`5.9\begin{align}
\frac{\text{d}^2x}{\text{d}t^2} &~=~ G \, \frac{m}{\sqrt{x^{\class{red}{2}} ~+~ y^{\class{red}{2}} ~+~ z^{\class{red}{2}}}} \\\\
\frac{\text{d}^2y}{\text{d}t^2} &~=~ G \, \frac{m}{\sqrt{x^{\class{red}{2}} ~+~ y^{\class{red}{2}} ~+~ z^{\class{red}{2}}}} \\\\
\frac{\text{d}^2z}{\text{d}t^2} &~=~ G \, \frac{m}{\sqrt{x^{\class{red}{2}} ~+~ y^{\class{red}{2}} ~+~ z^{\class{red}{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.

*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:`5.10\[ \class{red}{1} \, \frac{\text{d}^2y}{\text{d}t^2} ~+~ \class{red}{\frac{D}{m}}\,y ~=~ \class{red}{0} \]`

**Homogeneous linear differential equation**If the perturbation function is zero, then we call the linear differential equation homogeneous.

The wave equation is also homogeneous:`5.11\[ \class{red}{1} \, \frac{\partial^2 E}{\partial x^2} ~+~ \class{red}{1} \, \frac{\partial^2 E}{\partial y^2} ~+~ \class{red}{1} \, \frac{\partial^2 E}{\partial z^2} ~=~ \class{red}{\frac{1}{c^2}} \, \frac{\partial^2 E}{\partial t^2} \]`

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:`5.12\[ \class{red}{1} \, \frac{\text{d}^2y}{\text{d}t^2} ~+~ \class{red}{\mu}\,\frac{\text{d}y}{\text{d}t} ~+~ \class{red}{\frac{D}{m}}\,y ~=~ \class{red}{F(t)} \]`

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 the so-called 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\).

**Initial value problem**We call a differential equation together with initial conditions an

**initial value problem**. If we solve the initial value problem, we can use the solution to predict the future behavior of the system.

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**.

**Boundary conditions**We call a differential equation together with two or more boundary conditions a

**boundary conditions**. If we solve the boundary value problem, we can use the solution to predict how the system behaves within these boundaries.

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 far so good. Now let's look at four methods with which you can solve simple differential equations.

## Solving method #1: Separation of variables

With this method you can solve *ordinary homogeneous differential equations of 1st order*. This type of differential equations has the form:`7\[ y' ~+~ K(x)\,y ~=~ 0 \]`

Here the coefficient \(K\) must *not necessarily constant*, but can also depend on \(x\)! Also note that before the first derivative \(y'\) the coefficient must be equal to 1. If this is not the case for you, then you simply have to divide the whole equation by the coefficient which is in front of \(y'\). Then you have the right form.

In this solving method, \(y\) and \(x\) are considered as two variables and separated from each other by bringing \(y\) to one side and \(x\) to the other side of the equation. The Leibniz notation of the differential equation is best suited for this purpose:`7.1\[ \frac{\text{d}y}{\text{d}x} ~+~ K(x)\,y ~=~ 0 \]`

Bring \(K(x)\,y\) to the right hand side:`7.2\[ \frac{\text{d}y}{\text{d}x} ~=~ -K(x)\,y \]`

Multiply the equation by \( \text{d}x \) and then divide the equation by \(y\). This way you have only \(y\) dependence on the left side and only \(x\) dependence on the right side:`7.3\[ \frac{1}{y} \, \text{d}y ~=~ -K(x) \, \text{d}x \]`

Now you can integrate over \(y\) on the left hand side and over \(x\) on the right hand side:`7.4\[ \int \frac{1}{y} \, \text{d}y ~=~ -\int K(x) \, \text{d}x \]`

Integrating \( 1 / y \) gives the natural logarithm of \(y\). It's best to know this by heart, because you will often encounter such an integral. Also, don't forget the integration constant! Let's call it \(A\) for example:`7.5\[ \ln(y) ~+~ A ~=~ -\int K(x) \, \text{d}x \]`

Now you have to solve for the function \(y\). Use the exponential function \(\mathrm{e}^{...}\) on both sides:`7.6\[ \mathrm{e}^{\ln(y) ~+~ A} ~=~ \mathrm{e}^{-\int K(x) \, \text{d}x} \]`

You can split the sum in the exponential term on the left into a product, where \(\mathrm{e}^{\ln(y)}\) is simply \(y\):`7.7\[ y \, \mathrm{e}^{A} ~=~ \mathrm{e}^{-\int K(x) \, \text{d}x} \]`

Bring the constant \(\mathrm{e}^{A}\) to the right side:`7.8\[ y ~=~ \frac{1}{\mathrm{e}^{A}} \, \mathrm{e}^{-\int K(x) \, \text{d}x} \]`and rename the coefficient to a new constant \(C\).

As a result, you get a general solution formula that you can always use to solve homogeneous linear differential equations. You don't have to apply the separation of variables method again and again, but you can use the solution formula directly:

**Solution formula for ordinary homogeneous DEQ of 1st order**

`7.9\[ y ~=~ C\, \mathrm{e}^{-\int K(x) \, \text{d}x} \]`

**Example from atomic physics: Radioactive decay law**For example, let's look at the differential equation for the radioactive decay law:

`7.10\[ \frac{\text{d}N}{\text{d}t} ~+~ \lambda \, N ~=~ 0 \]`

In this case the searched function \(y\) is the number of not yet decayed atomic nuclei \(N\) and the variable \(x\) corresponds to the time \(t\). And the coefficient \(K\) in this case is a decay constant \(\lambda\). They are just different letters. The type of the differential equation is the same! According to the solution formula you have to integrate the coefficient, i.e. the decay constant over \(t\). Integrating a constant just gives \(t\). And you have the general solution for the decay law:`7.11\[ N ~=~ C\, \mathrm{e}^{-\lambda \, t} \]`

Now you know the qualitative behavior of the physical process, namely that atomic nuclei decay \textit{exponentially}. But you cannot say concretely yet, \textit{how many} nuclei have already decayed after a certain period of time. This is because you don't know the constant \(C\) yet. After all, in the decay law, \(C\) gives the number of atomic nuclei that were present at the beginning of your observation. So you need an initial condition as additional information to the differential equation. It could be for example like this: \( N(0) = 1000 \). That means, at the time \(t = 0 \) there were 1000 atomic nuclei. Inserting this initial condition results in this equation:`7.12\[ N(0) ~=~ 1000 ~=~ C\, \mathrm{e}^{-\lambda \cdot 0} \]`

So \( C \) must be 1000:`7.13\[ N ~=~ 1000\, \mathrm{e}^{-\lambda \, t} \]`

Now you can insert an arbitrary point of time and find out how many not decayed atomic nuclei are still there.

## Solving method #2: Variation of constants

This method is well suited for *ordinary inhomogeneous differential equation of 1st order*. You have this type of differential equation if you can put your differential equation into the following form:`8\[ y' ~+~ K(x)\,y ~=~ S(x) \]`

The inhomogeneous version differs from the homogeneous one only in the single coefficient, that is the perturbation function \(S(x)\) is not zero. Thus, this type of differential equation is somewhat more difficult to solve.

In this solving method, you make the ansatz that the general solution \(y(x)\) is given by a coefficient \(C(x)\) that depends on \(x\), multiplied by a homogeneous solution that we denote as \( y_{\text h}(x) \):`8.1\[ y ~=~ C(x) \, y_{\text h} \]`

You have already learned how to find the homogeneous solution \( y_{\text h} \) with the previous method. All you have to do is to set the perturbation function to zero: \( S(x) = 0 \). Then you have the homogeneous differential equation. You solve it with separation of variables or directly by using the corresponding solution formula 7.8

.

We put this ansatz 8.1

into the inhomogeneous equation 8

for \(y\):`8.2\[ y' ~+~ K(x)\,C(x) \, y_{\text h} ~=~ S(x) \]`

We also want to replace the derivative \(y'\) with our ansatz. To do this, we must first differentiate \(y\) with respect to \(x\). Since both \(C(x)\) and \( y_{\text h}(x) \) depend on \(x\), we need to apply the product rule. You do this by differentiating \(C(x)\) once, leaving \( y_{\text h} \), and then leaving \(C(x)\) and differentiate \( y_{\text h} \). The result is the derivative of our ansatz:`8.3\[ y' ~=~ C'(x) \, y_{\text h} ~+~ C(x) \, y'_{\text h} \]`

We insert the derivative \(y'\) into the general form of the differential equation 8

:`8.4\[ C'(x) \, y_{\text h} ~+~ C(x) \, y'_{\text h} ~+~ K(x)\,C(x) \, y_{\text h} ~=~ S(x) \]`

If you just factor out \(C(x)\), you might see why this approach is so awesome:`8.5\[ C'(x) \, y_{\text h} ~+~ C(x) \, \left( y'_{\text h} ~+~ K(x)\, y_{\text h} \right) ~=~ S(x) \]`

In parenthesis is the homogeneous differential equation 7

, which is zero. So we can omit this term completely:`8.6\[ C'(x) \, y_{\text h} ~=~ S(x) \]`

You can now rearrange the equation for the unknown coefficient \(C'(x)\):`8.7\[ C'(x) ~=~ \frac{S(x)}{y_{\text h}} \]`

Now, to eliminate the derivative \(C'(x)\), we have to integrate both sides over \(x\). You know, the integration is the inverse, so to speak, of a derivative:`8.8\[ \int C'(x) \, \text{d}x ~=~ \int \frac{S(x)}{y_{\text h}} \, \text{d}x \]`

We cannot integrate the right side concretely, because\(S(x)\) is different depending on the problem. Therefore we leave the right side unchanged. The left side, on the other hand, can be integrated and additionally yields an integration constant. We put this directly on the right side and define it for example as a constant \(A\):`8.9\[ C(x) ~=~ \int \frac{S(x)}{y_{\text h}} \, \text{d}x ~+~ A \]`

If you now just substitute the found coefficient \(C(x)\) into the original ansatz, then you get the general solution of an ordinary inhomogeneous linear differential equation of 1st order:

**Solution formula for ordinary inhomogeneous DEQ of 1st order**

`8.10\[ y ~=~ \left( \int \frac{S(x)}{y_{\text h}} \, \text{d}x ~+~ A \right) \, y_{\text h} \]`

**Example from electrical engineering: RL circuit**

Consider a circuit consisting of a coil characterized by the inductance \(L\) and a resistor \(R\) connected in series. Then we take a voltage source which provides a voltage \(U_0\) as soon as we close the circuit with a switch. Then a time dependent current \(I(t)\) flows through the coil and the resistor. The current does not have its maximum value immediately, but increases slowly due to Lenz law. Using Kirchoff's laws, we can set up the following differential equation for the current \(I\):`8.11\[ L \, \dot{I} ~+~ R\, I ~-~ U_0 ~=~ 0 \]`

Remember that the point above the \(I\) means the first time derivative. This is an inhomogeneous linear differential equation of 1st order. You can see this best if you put this equation into a more familiar form 8

. Divide both sides by \(L\). Thereby you eliminate the \(L\) in front of the derivative:`8.12\[ \dot{I} ~+~ \frac{R}{L}\, I ~-~ \frac{U_0}{L} ~=~ 0 \]`

Bring the single coefficient to the other side:`8.13\[ \dot{I} ~+~ \frac{R}{L}\, I ~=~ \frac{U_0}{L} \]`

And we already have the familiar form. The searched function \(y\) corresponds here to the current \(I\). The perturbation function \(S(t)\) corresponds to \(\frac{U_0}{L}\) and is time independent in this case: \( S = \frac{U_0}{L} \). The coefficient \(K(t)\) in front of the searched function \(I\) corresponds to \(\frac{R}{L}\) and is also time independent in this case: \(K = \frac{R}{L} \).

So far so good. Let's use the just derived solution formula for the inhomogeneous differential equation of 1st order. We denote the homogeneous solution by \(I_{\text h}\):`8.14\[ I ~=~ \left( \int \frac{U_0}{L \, I_{\text h}} \, \text{d}t ~+~ A \right) \, I_{\text h} \]`

First, we need to determine the homogeneous solution \(I_{\text h}\). We can quickly calculate this using the solution formula 7.9

for the homogeneous version of the differential equation that you learned before:`8.15\[ I_{\text h} ~=~ \mathrm{e}^{ - \int \frac{R}{L} \text{d}t } \]`

We may omit the constant \(C\) in the solution formula here, because we consider it later anyway in the constant \(A\), which we find in the other solution formula 8.10

.

The coefficient \(\frac{R}{L}\) is constant and integrating a constant only introduces a \(t\). Thus, the homogeneous solution is:`8.16\[ I_{\text h} ~=~ \mathrm{e}^{ - \frac{R}{L}\,t } \]`

Let's insert it into the inhomogeneous solution formula:`8.17\begin{align}
I &~=~ \left( \int \frac{U_0}{L \, I_{\text h}} \, \text{d}t ~+~ A \right) \, I_{\text h} \\\\
&~=~ \left( \int \frac{U_0}{L \, \mathrm{e}^{ - \frac{R}{L}\,t }} \, \text{d}t ~+~ A \right) \, \mathrm{e}^{ - \frac{R}{L}\,t } \\\\
&~=~ \left( \int \frac{U_0}{L} \, \mathrm{e}^{ \frac{R}{L}\,t } \, \text{d}t ~+~ A \right) \, \mathrm{e}^{ - \frac{R}{L}\,t }
\end{align}`Note that '1 over the exponential function' containing a minus in the exponent is simply equivalent to the exponential function without the minus sign.

Now we have to calculate the integral in 8.17

. Here \(\frac{U_0}{L}\) is a constant and can be placed in front of the integral. And when integrating the exponential function, the exponential function is preserved. Only \(\frac{L}{R}\) is added as a factor in front of the exponential function. Finally we hide the constant of integration in the constant \(A\):`8.18\begin{align}
I &~=~ \left( \int \frac{U_0}{L} \, \mathrm{e}^{ \frac{R}{L}\,t } \, \text{d}t ~+~ A \right) \, \mathrm{e}^{ - \frac{R}{L}\,t } \\\\
&~=~ \left(\frac{U_0}{L} \, \int \mathrm{e}^{\frac{R}{L}\,t } \, \text{d}t ~+~ A \right) \, \mathrm{e}^{ - \frac{R}{L}\,t } \\\\
&~=~ \left( \frac{U_0}{L} \, \frac{L}{R} \, \mathrm{e}^{\frac{R}{L}\,t} ~+~ A \right) \, \mathrm{e}^{ - \frac{R}{L}\,t } \\\\
&~=~ \left( \frac{U_0}{R} \, \mathrm{e}^{\frac{R}{L}\,t } ~+~ A \right) \, \mathrm{e}^{ - \frac{R}{L}\,t }
\end{align}`

And we already have the general solution. We can simplify it a bit more by multiplying out the parentheses. Two exponential functions simplify to one:`8.19\[ I(t) ~=~ \frac{U_0}{R} ~+~ A \, \mathrm{e}^{ - \frac{R}{L}\,t } \]`

To get a solution specific to the problem, we need to determine the unknown constant \(A\). For that we need an initial condition. If we say that the time \( t = 0 \) is the time when the current \(I\) was zero because we have not yet closed the switch, then our initial condition is: \( I(0) = 0 \). Insert it into the general solution:`8.20\begin{align}
I(0) &~=~ 0 \\\\
&~=~ \frac{U_0}{R} ~+~ A \, \mathrm{e}^{ - \frac{R}{L} \cdot 0} \\\\
&~=~ \frac{U_0}{R} ~+~ A
\end{align}`

and solving for \(A\) results in:`8.21\[ A ~=~ -\frac{U_0}{R} \]`

Thus, we have successfully determined the specific general solution:`8.22\begin{align}
I(t) &~=~ \frac{U_0}{R} ~-~ \frac{U_0}{R} \, \mathrm{e}^{ - \frac{R}{L}\,t } \\\\
&~=~ \left( 1 ~-~ \mathrm{e}^{ - \frac{R}{L}\,t } \right) \, \frac{U_0}{R}
\end{align}`

## Solving method #3: Exponential ansatz

Let's look at the third solving method, the exponential ansatz. The exponential ansatz is suitable for *linear differential equations of arbitrary order with constant coefficients*. 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:`9\[ y''(x) + K_1 \, y'(x) ~+~ K_0 \, y(x) ~=~ S \]`

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} \).

`9.1\[ y ~=~ y_{\text h} ~+~ y_{\text s} \]`

The homogeneous solution \(y_{\text h}\) solves the differential equation 9

if you set the perturbation function \(S\) equal to zero:`9.2\[ y_{\text h}'' + K_1 \,y_{\text h}' ~+~ K_0 \, y_{\text h} ~=~ 0 \]`

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:`9.3\[ y_{\text h} ~=~ C \, \mathrm{e}^{\lambda \, x} \]`

Since the first and second derivatives of \(y_{\text h}\) occur in the general form 9.2

of the differential equation, we must differentiate our exponential ansatz twice. The first derivative is:`9.4\[ y'_{\text h} ~=~ C \, \lambda \, \mathrm{e}^{\lambda \, x} \]`

And the second derivative is:`9.5\[ y''_{\text h} ~=~ C \, \lambda^2 \, \mathrm{e}^{\lambda \, x} \]`

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

:`9.6\[ C \, \lambda^2 \, \mathrm{e}^{\lambda \, x} + K_1 \,C \, \lambda \, \mathrm{e}^{\lambda \, x} ~+~ K_0 \, C \, \mathrm{e}^{\lambda \, x} ~=~ 0 \]`

Let us factor out \(C \, \mathrm{e}^{\lambda \, x} \):`9.7\[ C \, \mathrm{e}^{\lambda \, x} \, \left( \lambda^2 \, + K_1 \lambda ~+~ K_0 \right) ~=~ 0 \]`

If we divide by this factor \(C \, \mathrm{e}^{\lambda \, x} \), then we get the so-called **characteristic equation** for \(\lambda\):`9.8\[ \lambda^2 \, + K_1 \lambda ~+~ K_0 ~=~ 0 \]`

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:`9.9\[ \lambda_1, \lambda_2 ~=~ -\frac{K_1}{2} ~\pm~ \sqrt{\frac{{K_1}^2}{4} - K_0 } \]`

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 9.2

:

**Solution ansatz of the homogeneous DEQ of 2nd order**

`9.10\[ y_{\text h} ~=~ C_1 \, \mathrm{e}^{\lambda_1 \, x} ~+~ C_2 \, \mathrm{e}^{\lambda_2 \, x} ~~\text{mit}~~ \lambda_1, \lambda_2 ~=~ -\frac{K_1}{2} ~\pm~ \sqrt{\frac{{K_1}^2}{4} - K_0 } \]`

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:

**Solution ansatz of the inhomogeneous DEQ of 2nd order with constant perturbation function**

`9.11\[ y ~=~ C_1 \, \mathrm{e}^{\lambda_1 \, x} ~+~ C_2 \, \mathrm{e}^{\lambda_2 \, x} ~+~ \frac{S}{K_0} ~~\text{with}~~ \lambda_1, \lambda_2 ~=~ -\frac{K_1}{2} ~\pm~ \sqrt{\frac{{K_1}^2}{4} - K_0 } \]`

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 from mechanics: An oscillating mass**Do you remember the differential equation for the oscillating mass?

`9.12\[ \frac{\text{d}^2y}{\text{d}t^2} ~+~ \frac{D}{m}\,y ~=~ 0 \]`

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:`9.13\[ \ddot{y} ~+~ \frac{D}{m}\,y ~=~ 0 \]`

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:`9.14\[ \lambda^2 ~+~ \frac{D}{m} ~=~ 0 \]`

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:`9.15\[ \lambda^2 ~=~ - \frac{D}{m} \]`

and then take the square root:`9.16\[ \lambda ~=~ \pm \sqrt{- \frac{D}{m} } \]`

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 imaginary or 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:`9.17\[ \lambda ~=~ \pm \sqrt{- 1 } \, \sqrt{ \frac{D}{m} } \]`

Root of -1 is defined as the imaginary unit, a number which we denote by \(i\). That's all you need to know about imaginary numbers:`9.18\[ \lambda_1, \lambda_2 ~=~ \pm i \, \sqrt{ \frac{D}{m} } \]`

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\):`9.19\[ y(t) ~=~ C_1 \, \mathrm{e}^{i \, \omega \, t} ~+~ C_2 \, \mathrm{e}^{-i \, \omega \, t} \]`

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\):`9.20\begin{align}
1 &~=~ y(0) \\\\
&~=~ C_1 \, \mathrm{e}^{i \, \omega \cdot 0} ~+~ C_2 \, \mathrm{e}^{-i \, \omega \cdot 0} \\\\
&~=~ C_1 ~+~ C_2
\end{align}`

Rearranging for \(C_1\) we get:`9.21\[ C_1 ~=~ 1 ~-~ C_2 \]`

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:`9.22\[ y'(t) ~=~ i \, \omega \, C_1 \, \mathrm{e}^{i \, \omega \, t} ~-~ i \, \omega \, C_2 \, \mathrm{e}^{-i \, \omega \, t} \]`

And then we insert the second initial condition into the derivative. The exponential functions become 1 and the factor \(i \, \omega\) cancels out:`9.23\begin{align}
0 &~=~ y'(0) \\\\
&~=~ i \, \omega \, C_1 \, \mathrm{e}^{i \, \omega \cdot 0} ~-~ i \, \omega \, C_2 \, \mathrm{e}^{-i \, \omega \cdot 0} \\\\
&~=~ C_1 ~-~ C_2
\end{align}`

Rearranging for \(C_2\) we find out that:`9.24\[ C_2 ~=~ C_1 \]`

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:`9.25\[ C_1 ~=~ 1 - C_1 \]`

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:`9.26\[ y(t) ~=~ \frac{1}{2} \, \mathrm{e}^{i \, \omega \, t} ~+~ \frac{1}{2} \, \mathrm{e}^{-i \, \omega \, t} \]`

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:`9.27\[ \mathrm{e}^{i \, \omega \, t} ~=~ \cos(\omega \, t) ~+~ i\,\sin(\omega \, t) \]`

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\):`9.28\begin{align}
y(t) &~=~ \frac{1}{2}\, \cos(\omega \, t) ~+~ \frac{1}{2}\, i\,\sin(\omega \, t) \\\\
&~+~ \frac{1}{2}\, \cos(-\omega \, t) ~+~ \frac{1}{2}\, i\,\sin(-\omega \, t)
\end{align}`

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:`9.29\begin{align}
y(t) &~=~ \frac{1}{2}\, \cos(\omega \, t) ~+~ \frac{1}{2}\, i\,\sin(\omega \, t) \\\\
&~+~ \frac{1}{2}\, \cos(\omega \, t) ~-~ \frac{1}{2}\, i\,\sin(\omega \, t)
\end{align}`

Very nice, the complex sine function drops out. And the cosine can be summed up:`9.30\[ y(t) ~=~ \cos\left(\omega\,t\right) \]`

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.

## Solving method #4: Product ansatz (separation ansatz)

Let's look at the last solving method, the separation ansatz. This is sometimes called the product ansatz for reasons we will soon understand. So far we have considered ordinary differential equations. This method, however, is suitable *for partial differential equations with two variables*. The order of the differential equation does not matter.

Let us illustrate this method directly with an example. The one-dimensional wave equation for an electric field is best suited for this:`10\[ \frac{\partial^2 E}{\partial x^2} ~=~ \frac{1}{c^2} \, \frac{\partial^2 E}{\partial t^2} \]`

The function we are looking for is the electric field \(E(t,x)\). This depends on \(x\) and on \(t\). Since the function depends on two variables and their derivatives appear in the equation, it is a partial differential equation.

Here we make a product ansatz for the searched solution \(E\):`10.1\[ E(x,t) ~=~ R(x) \, U(t) \]`

We assume that the solution \(E\) can be split into a product of two functions that we call \(R(x)\) and \(U(t)\). One function, \(R\), depends only on \(x\). And the other function, \(U\), depends only on \(t\). In the wave equation, we have a second derivative of \(E\) with respect to location \(x\) and a second derivative with respect to time \(t\). So we must first differentiate our product ansatz before we insert it into the wave equation. Differentiating the product ansatz with respect to \(x\) yields \(U(t)\,\frac{\partial^2 R(x)}{\partial x^2}\), since \(U\) is independent of \(x\) and thus acts like a constant. In contrast, in the derivative of the product with respect to time \(t\), the function \(R\) acts like a constant because it does not depend on \(t\):`10.2\[ U(t)\,\frac{\partial^2 R(x)}{\partial x^2} ~=~ \frac{1}{c^2} \, R(x)\, \frac{\partial^2 U(t)}{\partial t^2} \]`

The goal now is to separate everything that depends on \(x\) from what depends on \(t\). For this we divide this equation by \(R(x) \, U(t)\):`10.3\[ \frac{1}{R(x)}\,\frac{\partial^2 R(x)}{\partial x^2} ~=~ \frac{1}{c^2} \, \frac{1}{U(t)}\, \frac{\partial^2 U(t)}{\partial t^2} \]`

Thus we have achieved that everything that depends on \(x\) is on the left side and everything that depends on \(t\) is on the right side. If you manage to separate a partial differential equation this way, then the separation ansatz was successful.

Now we can vary \(x\) on the left side without changing the right side, because there is no \(x\) on the right side. The same is true for the time \(t\). If we vary the time on the right side, the left side remains unchanged, because there is no time \(t\). Thus both sides must be constant. So let's set the left and the right side equal to a constant \(K\):`10.4\begin{align}
\frac{1}{R(x)}\,\frac{\partial^2 R(x)}{\partial x^2} &~=~ K\\\\
\frac{1}{c^2} \, \frac{1}{U(t)}\, \frac{\partial^2 U(t)}{\partial t^2} &~=~ K
\end{align}`

Thus we have transformed a *partial* differential equation into *two ordinary* differential equations. And the good thing is that the two differential equations are not coupled. That is, you can solve them independently and then multiply the solutions like in the product ansatz 10.1

to get the general solution for the partial differential equation.

You can solve the two ordinary differential equations with the exponantial ansatz you learned before.

So. Now you have learned everything necessary to classify and to solve simple differential equations.

- Separation of variables for ordinary homogeneous differential equations of 1st order
- Variation of constants for ordinary inhomogeneous differential equations of 1st order
- Exponential ansatz for ordinary differential equations of higher order
- And separation ansatz for partial differential equations

There are of course more classifications and solving methods. There are entire books devoted to solving differential equations. Some differential equations are so complex that it is better to not even try to solve them by hand, such as the Navier-Stokes differential equations. Numerical solving with the computer is the best approach here. But that's another big topic that you'll learn in another lesson.