]> Simple Differential Equations

### Chapter 2: Integration; Section 1: Indefinite Integrals; page 4

Previous topic: page 3 Special Methods

Next topic: section 2 Definite Integrals, page 1 Fundamentals

# Simple Differential Equations

## Introduction

A differential equation is a mathematical representation of a relation between an independent variable, a function and some of its derivatives with respect to the independent variable. The most general implicit form of a differential equation is:

 $F\left(x,y,\frac{\text{d}y}{\text{d}x},\frac{{\text{d}}^{2}y}{\text{d}{x}^{2}},\frac{{\text{d}}^{3}y}{\text{d}{x}^{3}},....\right)=0$ (2.1.4.1)

The highest order of a derivative presented in (2.1.4.1) defines the order of the differential equation. By definition the lowest possible order of a differential equation is one (order zero would be just a functional relation). On the other hand the presence of the independent variable and/or the function, is not a necessity of a differential equation.

A solution of a differential equation consists of obtaining the functional relation without the participation of any derivative. For example the solution of a differential equation of the first order consists of two stages:

1. Express the equation in a way that instead of the derivative, an indefinite integral will appear.
2. Perform the integration
It is clear that a differential equation poses, in addition to the integration, a new challenge. The solution of a differential equation of higher order is even harder.

Let's return to the differential equation of the first order. The second stage (integration) brings an undefined constant, additive to the integral. As a rule the solution of a differential equation of order n yields n undefined constants.

What is the use of differential equations? Their importance in science and engineering is unlimited. The most general laws in nature can be expressed as differential equations and their solution explains the behaviour of the particular measurable quantities. As an example let's take the familiar second law of Newton in one dimension:

 $\frac{{\text{d}}^{2}s}{\text{d}{t}^{2}}=\frac{F}{m}$ (2.1.4.2)

where

• t (time) is the independent variable,
• s (position of a physical point at an axis) is the function,
• m (mass) is a constant related to this physical point and
• F  is the one dimensional force acting on the physical point. Depending on the circumstances, the force could depend on t , s , a derivative of  s  with respect to  t  of any order, or any combination of these.

In the case when  F  is a funtion of  s, t, and the first and second derivatives, (2.1.4.2) represents a differential equation of the second order. In such a case its solution should give the position  s  and the first derivative  v (velocity) as functions of the time. The reasoning is the following: in principle the first integration should yield a differential equation of the first order including one constant of integration. The second integration should represent a functional relation between  s  and  t  with two constants of integration, representing  s  as function of  t . As a consequence the first integration represents the first dervative  v  as a function of  t .

We have the choice to define the two constants resulting from the integrations. It is common to use the initial conditions, corresponding to  t = 0 , of the position and of the velocity:

 ${s}_{0}=s\left(t=0\right)\text{ }\text{and}\text{ }{v}_{0}=v\left(t=0\right)$ (2.1.4.3)

as given values in order to define the constants.

We will study here only a few elementary cases of differential equations and the way to solve them.

## Derivative as function of the independent variable:   $\frac{{\text{d}}^{n}y}{\text{d}{x}^{n}}={f}_{n}\left(x\right)$

The differential equation

 $\frac{{\text{d}}^{n}y}{\text{d}{x}^{n}}={f}_{n}\left(x\right)$ (2.1.4.4)

where  ${f}_{n}\left(x\right)$   is a known function can be directly integrated, in order to obtain a differential equation of the order  n−1  of the same form. That way one can reduce the order by steps and obtain the solution:

 $\begin{array}{l}\frac{{\text{d}}^{n}y}{\text{d}{x}^{n}}={f}_{n}\left(x\right)\\ \frac{{\text{d}}^{n-1}y}{\text{d}{x}^{n-1}}=\int {f}_{n}\left(x\right)\text{​}\text{d}x={f}_{n-1}\left(x\right)\\ ...........\\ \frac{\text{d}y}{\text{d}x}=\int {f}_{2}\left(x\right)\text{​}\text{d}x={f}_{1}\left(x\right)\\ y=\int {f}_{1}\left(x\right)\text{​}\text{d}x\end{array}\right\}$ (2.1.4.5)

We'll use the simple example of throwing up vertically (positive direction) a mass-point  m  with an initial velocity of  vo  under the gravitational force  F = −mg from a starting height of  so =0 . According to (2.1.4.2) and (2.1.4.5) we obtain

 $\begin{array}{l}a=\frac{{\text{d}}^{2}s}{\text{d}{t}^{2}}=-g\\ v=\frac{\text{d}s}{\text{d}t}=-\int g\text{​}\text{d}t=-gt+{C}_{1}\\ s=\int \left(-gt+{C}_{1}\right)\text{​}\text{d}t=-\frac{g{t}^{2}}{2}+{C}_{1}t+{C}_{2}\end{array}\right\}$ (2.1.4.6)

where a denotes acceleration. After applying the initial conditions (2.1.4.3) one obtains:

 $\begin{array}{l}v=-gt+{v}_{o}\\ s=-\frac{g{t}^{2}}{2}+{v}_{o}t\end{array}\right\}$ (2.1.4.7)

We already know how to present graphically these relations. But since this case deals with the motion of a physical object, we can translate the solution obtained from the differential equation to an actual motion by using animation. For sake of simplicity we'll round-off the gravitational acceleration to  g = 10m/sec² , and in order to be able to observe the motion in real time, we'll use initial velocities of more than  10m/sec . This is presented in Fig. Vertical motion.

Another example of solving the second law of Newton was obtained on page 1 exercise 4:

 $\begin{array}{l}ma=m\frac{{\text{d}}^{2}x}{\text{d}{t}^{2}}=C\mathrm{sin}\left(\omega t\right)\\ v=\frac{\text{d}x}{\text{d}t}=-\frac{C\mathrm{cos}\left(\omega t\right)}{m\omega }+{C}_{1}\\ x=-\frac{C\mathrm{sin}\left(\omega t\right)}{m{\omega }^{2}}+{C}_{1}t+{C}_{2}\end{array}\right\}$ (2.1.4.8)

where  m, C, ω  are known constants and  C1C2  are two constants of the integration.

By using the initial values xo and vo, one obtains

 ${C}_{1}={v}_{0}+\frac{C}{m\omega }\text{ }\text{and}\text{ }{C}_{2}={x}_{0}$ (2.1.4.9)

which means that in order to obtain a simple harmonic motion in form of oscillations around a fixed point, which is a very common motion in nature, one has to choose in this case, one very particular initial velocity:

As a matter of fact, a harmonic motion in nature occurs when applying another force, which will be shown later on this page.

## Seperation of variables:   $\frac{\text{d}y}{\text{d}x}={f}_{y}\left(y\right){f}_{x}\left(x\right)$

The first order differential equation

 $\frac{\text{d}y}{\text{d}x}={f}_{y}\left(y\right){f}_{x}\left(x\right)$ (2.1.4.10)

is solvable by separation of the variables:

 $\begin{array}{l}\frac{\text{d}y}{{f}_{y}\left(y\right)}={f}_{x}\left(x\right)\text{d}x\\ \int \frac{\text{d}y}{{f}_{y}\left(y\right)}=\int {f}_{x}\left(x\right)\text{d}x\end{array}\right\}$ (2.1.4.11)

The following simple example deals with radioactive decay. It is a special case of (2.1.4.10) since the function of the independent variable  fx  is a constant. The independent variable is the time  t  and the dependent variable is the number of radioactive atoms  N  that have not decayed so far. The physical assumption is that each atom has the same probability to decay in a random way. That way the decay rate is proportional to  N . This is expressed by the differential equation

 $\frac{\text{d}N}{\text{d}t}=-\frac{N}{\tau }$ (2.1.4.12)

where the negative sign expresses the decrease of the number of atoms.  τ  has dimensions of time, and is a known positive constant factor related to the probability of the decay. For smaller  τ  the probability is greater and the decay rate is more intense.

According to (2.1.4.11) the solution is

 $\begin{array}{l}\int \frac{\text{d}N}{N}=-\int \frac{\text{d}t}{\tau }\\ \mathrm{ln}N=-\frac{t}{\tau }+C\\ \left\{\begin{array}{l}N=\mathrm{exp}\left(-\frac{t}{\tau }+C\right)=\\ =\mathrm{exp}C\text{ }\mathrm{exp}\left(-\frac{t}{\tau }\right)=\\ ={N}_{0}\text{ }\mathrm{exp}\left(-\frac{t}{\tau }\right)=N\end{array}\end{array}\right\}$ (2.1.4.13)

where the constant  expC  was replaced by  N0 , the initial number of atoms.

## Non-explicit independent variable (x):   ${F}_{1}\left(y,\frac{\text{d}y}{\text{d}x},....,\frac{{\text{d}}^{n}y}{\text{d}{x}^{n}}\right)=0$

Any differential equation of order  n  that does not include explicitly the independent variable  x

 ${F}_{1}\left(y,\frac{\text{d}y}{\text{d}x},....,\frac{{\text{d}}^{n}y}{\text{d}{x}^{n}}\right)=0$ (2.1.4.14)

can be reduced to a differential equation of order  n−1 .

This is achieved by using  y  as the independent variable, by converting the first derivative as a function of  y

 $\frac{\text{d}y}{\text{d}x}=p\left(y\right)$ (2.1.4.15)

and by doing the appropriate changes on the higher order derivatives:

 $\frac{{\text{d}}^{2}y}{\text{d}{x}^{2}}=\frac{\text{d}p}{\text{d}x}=\frac{\text{d}p}{\text{d}y}\frac{\text{d}y}{\text{d}x}=p\frac{\text{d}p}{\text{d}y}$ (2.1.4.16)

and so on. This way one obtains a new differential equation

 ${F}_{1}\left(y,p,\frac{\text{d}p}{\text{d}y},....,\frac{{\text{d}}^{n-1}p}{\text{d}{y}^{n-1}}\right)=0$ (2.1.4.17)

of lower order. This does not solve the original differential equation, unless the new equation is solvable.

For example we'll solve the motion in one dimension of a mass point  m  attached to a linear spring with  t (time) as an independent variable, and  s (position along a straight axis) as the function. The force applied by the spring is  −ks , where  k  is a given positive constant and the negative sign means that the force tends to restore the position toward the origin. According to the second law of Newton, the differential equation of the motion is

 $\begin{array}{l}\frac{{\text{d}}^{2}s}{\text{d}{t}^{2}}=-{\omega }^{2}s\\ {\omega }^{2}=\frac{k}{m}\end{array}\right\}$ (2.1.4.18)

and it does not include  t  explicitly. After applying the procedure of (2.1.4.15-17) we get

 $\begin{array}{l}v=\frac{\text{d}s}{\text{d}t}=v\left(s\right)\\ \frac{{\text{d}}^{2}s}{\text{d}{t}^{2}}=v\frac{\text{d}v}{\text{d}s}\\ v\frac{\text{d}v}{\text{d}s}=-{\omega }^{2}s\end{array}\right\}$ (2.1.4.19)

which is solvable by the separation of the variables

 $\begin{array}{l}\int v\text{d}v=-{\omega }^{2}\int s\text{d}s\\ {v}^{2}+{\omega }^{2}{s}^{2}={C}_{1}^{2}\end{array}\right\}$ (2.1.4.20)

The solution (2.1.4.20) is only the first integration, and the constant of integration is written as a square since obviously it is a positive number. We need a second integration in order to solve  s  as a function of  t , which is obtained by substituting back  $v=\frac{\text{d}s}{\text{d}t}$  in this solution:

 $\begin{array}{l}\frac{\text{d}s}{\text{d}t}=±\sqrt{{C}_{1}^{2}-{\omega }^{2}{s}^{2}}\\ \int \frac{\text{d}s}{\sqrt{{C}_{1}^{2}-{\omega }^{2}{s}^{2}}}=±\int \text{d}t\\ \text{substitution}\text{ }u=\frac{\omega s}{{C}_{1}}\\ \int \frac{\text{d}u}{\sqrt{1-{u}^{2}}}=±\omega \int \text{d}t\\ \text{asin}\left(\frac{\omega s}{{C}_{1}}\right)=±\omega t+{C}_{2}\\ s=\frac{{C}_{1}}{\omega }\mathrm{sin}\left(±\omega t+{C}_{2}\right)\end{array}\right\}$ (2.1.4.21)

At this stage it looks like we have obtained two possible solutions. Actually after applying the initial conditions we'll obtain the same expression independently of the sign of the product  ωt . The reason for this is that by adjusting  C2 , we can switch from one sign to another e.g.

By the same token (adjusting  C2), the choice of asin or acos is irrelevant. In the integration we did not take in account the ambiguity of the sign when we obtained  asin  at (2.1.4.21). This is also irrelevant because the value of  C1  was not assigned yet (ω  is customarily defined as positive).

We can now write the solution in its most general form

 $\begin{array}{l}s=\frac{{C}_{1}}{\omega }\mathrm{sin}\left(\omega t+{C}_{2}\right)\\ v={C}_{1}\mathrm{cos}\left(\omega t+{C}_{2}\right)\end{array}\right\}$ (2.1.4.22)

which is called the simple harnonic motion. From (2.1.4.22) one can express the constants of integration by the initial conditions  s0  and  v0 :

 $\begin{array}{l}{C}_{1}^{2}={s}_{0}^{2}{\omega }^{2}+{v}_{0}^{2}\\ \mathrm{sin}{C}_{2}=\frac{{s}_{0}\omega }{{C}_{1}}\\ \mathrm{cos}{C}_{2}=\frac{{v}_{0}}{{C}_{1}}\end{array}\right\}$ (2.1.4.23)

Assume that the sign of  C1  is chosen as positive, then as we already know, both signs of sin and cos define uniquely the quadrant where the angle C2  is located, and therefore  C2  can be uniquely evaluated. If the sign of  C1  was chosen as negative, the angle  C2  would be shifted by  π  in order to compensate for the sign of  C1 , and the solution (2.1.4.22) would remain unaffected.

The special case of  v0 = 0 (initiating the motion from rest) yields:

 $\begin{array}{l}s={s}_{0}\mathrm{cos}\left(\omega t\right)\\ v=-\omega {s}_{0}\mathrm{sin}\left(\omega t\right)\end{array}\right\}$ (2.1.4.24)

and is animated in Fig. Simple harmonic motion.

## Non-explicit dependent variable (y):   ${F}_{2}\left(x,\frac{\text{d}y}{\text{d}x},....,\frac{{\text{d}}^{n}y}{\text{d}{x}^{n}}\right)=0$

Any differential equation of order  n  that does not explicitly include the dependent variable  y

 ${F}_{2}\left(x,\frac{\text{d}y}{\text{d}x},....,\frac{{\text{d}}^{n}y}{\text{d}{x}^{n}}\right)=0$ (2.1.4.25)

can be reduced to a differential equation of order  n−1.

This is achieved by using the first derivative as the dependent variable

 $\frac{\text{d}y}{\text{d}x}=p\left(x\right)$ (2.1.4.26)

yielding the differential equation

 ${F}_{2}\left(x,p,\frac{\text{d}p}{\text{d}x},....,\frac{{\text{d}}^{n-1}p}{\text{d}{x}^{n-1}}\right)=0$ (2.1.4.27)

For example we'll solve the straight line motion of a mass point  m  under the influence of a resisting (frictional) force proportional to the velocity:  F = −μv , where  μ  is a positive constant and the negative sign shows that the force is in the opposite direction of the velocity. It is obvious that the motion cannot be started without an initial velocity  v0 . We'll use  s  as the coordinate along the axis of the motion and  t  as the time.

The differential equation of the motion is

 $\frac{{\text{d}}^{2}s}{\text{d}{t}^{2}}=-\frac{\mu }{m}\frac{\text{d}s}{\text{d}t}$ (2.1.4.28)

This equation does not include explicitly either the independent nor the dependent variables. We'll use the method that does not include the dependent variable x, since it is simpler. According to (2.2.4.26-27)

 $\begin{array}{l}v\left(x\right)=\frac{\text{d}s}{\text{d}t}\\ \frac{\text{d}v}{\text{d}t}=-\frac{\mu }{m}v\\ \int \frac{\text{d}v}{v}=-\frac{\mu }{m}\int \text{d}t\\ \mathrm{ln}|v|=-\frac{\mu }{m}t+{C}_{1}\end{array}\right\}$ (2.1.4.29)

After calculating  C1 , one obtains

 $\begin{array}{l}\mathrm{ln}|v|=-\frac{\mu }{m}t+\mathrm{ln}|{v}_{0}|\\ |v|=|{v}_{0}|\mathrm{exp}\left(-\frac{\mu }{m}t\right)\end{array}\right\}$ (2.1.4.30)

but  v  cannot change its sign (it should pass through zero and therefore violates the equation), thus we have

 $\begin{array}{l}v={v}_{0}\mathrm{exp}\left(-\frac{\mu }{m}t\right)\\ \int \text{d}s={v}_{0}\int \mathrm{exp}\left(-\frac{\mu }{m}t\right)\text{d}t\\ s=-\frac{m{v}_{0}}{\mu }\mathrm{exp}\left(-\frac{\mu }{m}t\right)+{C}_{2}\end{array}\right\}$ (2.1.4.31)

By using the initial position  s(t=0) = s0 , one finally obtains the solution

 $s={s}_{0}+\frac{m{v}_{0}}{\mu }\left[1-\mathrm{exp}\left(-\frac{\mu }{m}t\right)\right]$ (2.1.4.32)

which means that the point converges asymptotically to the position  $s={s}_{0}+\frac{m{v}_{0}}{\mu }$ .

## Exercises

Exercise 1. For the following differential equation $\frac{{\text{d}}^{4}y}{\text{d}{x}^{4}}=\mathrm{cos}x$

1. Obtain the general solution  y = y(x) !
2. Find the solution that for x=0 the following relations are satisfied: $\frac{{\text{d}}^{3}y}{\text{d}{x}^{3}}=\frac{{\text{d}}^{2}y}{\text{d}{x}^{2}}=\frac{\text{d}y}{\text{d}x}=y=0$

3. Is x=0 a point of minimum, maximum or inflection in this case?

Exercise 2. Solve the differential equation $\frac{{\text{d}}^{2}y}{\text{d}{x}^{2}}=ky\frac{\text{d}y}{\text{d}x}$ satisfying the following conditions for x=0 : $\left\{\begin{array}{l}\frac{\text{d}y}{\text{d}x}=a\\ y=0\end{array}$ where a and k are positive constants.

Exercise 3. The one dimensional (x axis) equation of motion of a point mass m under the influence of a resisting force is $F=-\beta {v}^{2}$ with β>0. Take the velocity in the positive direction $v=\frac{\text{d}x}{\text{d}t}>0$ and the initial conditions: $\left\{\begin{array}{l}{x}_{0}=0\\ {v}_{0}>0\end{array}$ Solve the motion in two ways:

1. By the method where the independent variable (t) is not contained explicitly.
2. By the method where the dependent variable (x) is not contained explicitly.

Exercise 4. Prove that Newton's differential equation of motion in one dimension (x) $m\frac{{\text{d}}^{2}x}{\text{d}{t}^{2}}=F\left(x\right)$ where m is mass, t is time and the force F is a function of the x coordinate only, is solvable by the methods studied on this page, assuming that all the functions are integrable and their inverses exist.

Previous topic: page 3 Special Methods

Next topic: section 2 Definite Integrals, page 1 Fundamentals