MathAnalysisDifferential equations

Introduction to differential equations

5 minutes read

A lot of processes in the real world depend on the rate of their change. Let's take, for example, a group of rabbits on a desert island. If there is enough food, the rabbits will start to breed, and the more rabbits there are, the faster new ones will appear! Another example is a parachutist. After jumping out of the plane, they quickly gain speed and go down to the ground. However, the faster they move, the more air resistance slows them down, forming a complex feedback loop.

To describe such processes mathematically, ordinary differential equations (ODEs) were invented. An ODE is an equation that links a function we are interested in with its own derivatives. This definition may seem frightening, but, in fact, differential equations are not that much different from the conventional ones.

The concept of a differential equation

Let us remember what it means to solve a simple equation, for example, such as 5x=205x = 20. It means to find the set of all numbers that turn it into a true equality. Obviously, in our case, this set consists of a single element x=4x=4.

A differential equation is arranged in a similar way. The only difference is that what you need to find is not a set of numbers but a set of functions that satisfy the equation.

An ODE generally contains:
1) an independent variable x{x};
2) a dependent variable y(x)y(x) (this is the function we are looking for);
3) derivatives of the function sought: y(x),y(x)y'(x), y''(x), etc.

Order of a differential equation is the order of the highest derivative present in it. In this introductory topic, we will limit ourselves to the first order ODEs, which means that we will not encounter any derivatives of orders greater than one.

Solution of an ODE

Let's have a look at the solutions of an example equation:

y=yy' = y

What function is equal to its own derivative? Of course, it's the exponential one! So let's look for the solutions which have the form

y(x)=Cex,C=consty(x) = Ce^x, \\C = const

To make sure our guess is correct, let's take a derivative:

y(x)=(Cex)=C(ex)=Cex=y,C=consty'(x) = (Ce^x)' = C(e^x)' = Ce^x = y, \\ C = const

So, the function we guessed really satisfies our differential equation. Note that it is defined with precision up to an arbitrary multiplier C, which can take any value. In other words, there is no single solution to our ODE – all of the functions below are right answers:

y1=ex,y2=2ex,y3=3ex,...y_1 = e^x, y_2 = 2e^{x}, y_3 = 3e^{x}, ...

This is the hallmark of ODEs, which distinguishes them from conventional equations – the solution is defined with precision up to an arbitrary constant. The solution to an n-th order equation has n arbitrary constants – our equation is of the first order, so we have only one constant.

How to solve an ODE?

We have solved the above equation "intuitively", just by guessing the right function. Now let's learn how to solve an arbitrary ODE. We will consider the following equation:

y=xyy' = -xy

First, let's rewrite the derivative in the differential form and substitute it into our ODE:

y=dydx    dydx=xyy' = \frac{dy}{dx} \implies \frac{dy}{dx} = -xy

This form of derivative turns out extremely helpful when solving differential equations. We will actively use differentials in our further calculations. Now, let's use a technique called the method of separation of variables. We will reorganize our equation so that each half will contain a single variable (xx or yy):

dyy=xdx\frac{dy}{y} = -xdx

The next step is to take the indefinite integral of each part of our equation:

dyy=xdx\int \frac{dy}{y} = \int -xdx

Now, let's perform the integration (it's not too complicated here):

lny+C1=x2/2+C2;C1,C2=constln|y| +C_1= -x^2/2 + C_2; \\C_1, C_2 = const

Having two arbitrary constants C1C_1 and C2C_2 is not convenient. Instead, we will set a new constant C=C2C1C = C_2 - C_1:

lny=x2/2+C;C=constln|y| = -x^2/2 + C; \\C = const

Next, we convert this equation to get an explicit answer for yy:

elny=ex2/2+C;y=eCex2/2e^{ln|y|}= e^{-x^2/2 + C}; \\ |y| = e^Ce^{-x^2/2}

Having replaced a strictly positive eCe^C by a constant with an arbitrary sign CC', we can remove the absolute value symbol. In practice, we usually simply write the same CC instead of CC', keeping in mind that both are just names for some constant.

So, our solution is

\(y = Ce^{-x^2/2}; \\C = const \tag {1}\)

Great! Let's do a check (it's not a mandatory step, but it's very useful at the first stages of learning ODEs). Remember that our y(x)y(x) is a complex function of xx.

y(x)=(Cex2/2)=C(ex2/2)=Cex2/2(x2/2)==Cex2/2(x)=x(Cex2/2)=xy(x),q.e.d.y'(x) = (Ce^{-x^2/2})' = C(e^{-x^2/2})' =Ce^{-x^2/2}(-x^2/2)' =\\= Ce^{-x^2/2}(-x) = -x(Ce^{-x^2/2}) = -xy(x),\\ q.e.d.

Cool! We have found a family of functions that satisfy our equation.

Using initial conditions

Sometimes we need to know not just the family of solutions but a specific function. In this case, we need to select a single solution using initial conditions.
Initial conditions contain additional information that we use to single out one curve among many possible answers. For example, imagine we want to get a solution of the above equation such that y(0)=2y(0) = 2:

{y=xyy(0)=2\begin{cases} y' = -xy \\ y(0) = 2 \end{cases}

We may use this extra information to find the exact value of our constant CC by substituting x=0x=0 into our solution:

y(0)=Ce02/2=2(initialcondition)Ce0=2C=2y(0) = Ce^{-0^2/2} = 2 (initial \hspace{0.1cm} condition)\\ Ce^0 = 2\\ C = 2

So, our solution finally becomes

\(y(x) = 2e^{-x^2/2} \tag {2}\)

The following plot visualizes y(x)y(x) curves for different initial conditions:

Visualization of curves for various initial conditions

The solution (1) is called the general solution of an ODE, while (2) is called a particular solution. As you can see, the general solution may produce an infinite number of particular ones, depending on the set initial conditions.

Conclusion

In this topic, we have learned the concept of a differential equation. ODE is an equations that connects a function with its derivatives, and it is a powerful tool to describe complex real-world processes. Each ODE has a general solution, which contains some arbitrarily chosen constants, and an infinite number of particular solutions, which satisfy certain initial conditions.

3 learners liked this piece of theory. 1 didn't like it. What about you?
Report a typo