Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

University of Johannesburg

Faculty of Science
Department of Mathematics and Applied Mathematics
Lecturers: PG Dlamini, IK Letlhage & SM Simelane

First-order Ordinary Differential Equations

1. Introduction

Differential equations play an important role in modelling virtually every physical, technical, or biological process,
from celestial motion, to bridge design, to interactions between neurons. Further applications are found in fluid
dynamics with the design of containers and funnels, in heat conduction analysis with the design of heat spreaders
in microelectronics, in rigid-body dynamic analysis, with falling objects, and in exponential growth of current in an
RL circuit, to name but a few. This unit introduces first-order differential equations, a subject that is clearly of great
importance in many different areas of engineering.
Differential Equations (DE) is the branch of calculus that relate to such changes as mentioned above. In these
problems, we investigate changes that produce equations involving derivatives. Then, real world problems involving
changes can be presented mathematically through a process called modeling. We then solve these models to obtain
solutions and thus attempt to scientifically understand our world better.

2. Definitions, Terminology and Notation

Definition 1. A differential equation (DE) is an equation that contains one or more derivatives.

Differential equations are classified by type, order and linearity.

2.1. Type
An ordinary differential equation (ODE) contains one or more ordinary derivatives. An equation involving one
or more partial derivatives is called a partial differential equation (PDE).

Example 1:
1. The following are examples of ODEs

d2 y dy
− 2 + 4y = 0.
dx2 dx
dy 1
+ y = sin x.
dx 4
dy dx
+ = 3x + 2y.
dt dt
The third equation indicates that an ODE can contain more than one dependent variable.

Perhaps the most familiar examples of ODEs are


(a) Newton’s law
d2 u(t)
m = −mg
dt2
for the position u(t) of a particle acted on by the force due to gravity g.

1
(b) Kirchoff’s voltage law
d2 q dq 1
L + R + q = E(t)
dt2 dt C
for the charge q(t) on a condenser in a circuit with capacitance C, resistance R, inductance L and impressed
voltage E(t).
(c) Radio active decay
dR(t)
= −kR(t).
dt
This equation governs the decay with time of an amount R(t) of a radio active substance. k is a known
constant.
2. The following are examples of PDEs
∂2 u ∂2 u
+ = 0.
∂x2 ∂t2
∂u ∂v
− = 0.
∂y ∂x
Notice in the second equation that there are two dependent variables and two independent variables in the PDE,
which indicates that u and v must be functions of two or more independent variables.

Perhaps, the most familiar PDEs are


(a) Laplace’s or potential equation
∂2 u(x, y) ∂2 u(x, y)
+ =0
∂x2 ∂y2
(b) Heat or diffusion equation
∂2 u(x, t) ∂u(x, t)
α2 =
∂x2 ∂t
(c) Wave equation
∂2 u(x, t) ∂u(x, t)
a2 =
∂x2 ∂t2
The Laplace’s, heat and wave equations arise in a variety of problems in the fields of electricity and magnetism,
elasticity, fluid mechanics, control theory etc.

2.2. Order
The order of a differential equation refers to the highest derivative involved in that equation.

Example 2:
1.
d2 y dy
2
− 2 + 4y = 0
dx dx
is a second order ODE since the highest derivative is two.
2.
∂u ∂v
− =0
∂y ∂x
is a first order PDE since the highest derivative is one.
Exercise 1: Classify the following
1. !4
d2 y dy
+ − 4y = e x
dx2 dx
2.
∂3 u ∂2 u
+ u2 2 = 0
∂x 3 ∂t
2
2.3. Linearity
0
An nth -order ordinary differential equation is said to be linear in the variable y if the DE is a linear function of y ,
00
y , . . ., y . This means that an n -order ODE is linear if it is given as
(n) th

dn y dn−1 y dy
an (x) n
+ an−1 (x) n−1 + . . . + a1 (x) + a0 (x)y = g(x)
dx dx dx
From this equation, we observe two properties of linear ODE
• The coefficients a0 , a1 , . . ., an of y, y0 , . . . , y(n) depend at most on the independent variable x.
• The dependent variable y and all its derivatives y0 , y00 , . . . , y(n) are of the first degree; that is, the power of each
term involving y is 1.
A nonlinear ODE is one that is not linear. If the coefficients of y, y0 , . . . , y(n) contain the dependent variable y
or its derivatives or if powers of y, y0 , . . . , y(n) , such as (y0 )2 , appear in the equation, then the DE is nonlinear. Also,
0
nonlinear functions of the dependent variable or its derivatives, such as sin y or ey cannot appear in a linear equation.
00 0 3
d y dy
The differential equations y − 2y + y = 0 and x3 dx 3 + 3x dx − 5y = e are linear second- and third-order ODEs,
x
2
00 d y d3 y
respectively. The equations (1 − y)y + 2y = e x , dx 2 + sin y = 0 and dx3
+ y2 = 0 are nonlinear first-, second- and
third-order ordinary differential equations, respectively.

Exercise 2: Determine whether the differential equations in Exercise 1 above are linear or nonlinear.

2.4. Notation
Different notations are used to denote ODEs and PDEs. Ordinary derivatives can be written using
dy d2 y d3 y dn y
• Leibniz notation: , , , ...,
dx dx2 dx3 dxn
0 00 000
• Prime notation: y , y , y , y(4) , . . . , y(n)
...
• Newton’s dot notation: ẏ, ÿ, y , . . .
Partial derivatives are often denoted using
∂u ∂2 u ∂2 u ∂n u
• Leibniz notation: , , , ...,
∂t ∂x2 ∂x∂y ∂xn
• Subscript notation: u x , u xx , u xy , utt , . . .

2.5. Methods
Note: In this module, we only focus on ordinary differential equations.

For this chapter, we use the following methods (or solve equations involving the following types of ODEs)
• Direct integration
• Separation of variables
• Homogeneous DE
• Exact DE
• Linear DE
• Bernoulli DE
• Other transformations
3
2.6. Solution to a DE
To understand what a solution to a DE entails, consider the equation of a circle
x2 + y2 = c
Differentiate this equation implicitly
dy
2x + 2y =0
dx
dy
and make dx the subject of the formula
dy 2x
=−
dx 2y
x
=−
y
The result is a first order DE.
dy x
In other words, the solution to the DE = − must be x2 + y2 = c. A graphical representation of the solution to
√ dx y
this DE is a circle with radius c.

Definition 2. Any function f possessing at least n derivatives that are continuous, which when substituted into an
nth -order ordinary differential equation reduces the equation to an identity, is said to be a solution of the equation.
Below is are examples where we verify a solution.

Example 3: Verify if the given functions y are solutions to the DE


1 x4
1. y0 = xy 2 ; y=
16
2. y00 − 2y0 + y = 0 ; y = xe x
Solution: One way of verifying that the given function is a solution is to see, after substituting, whether each side
of the equation is the same for every x in the interval (−∞, ∞).
!1
x3 x3 1 x4 2 x2 x3
1. Left-hand side: y0 = 4. = ; Right-hand side: xy 2 = x. = x. =
16 4 16 4 4
Each side of the equation is the same for every x.
2. From y, we have the derivatives y0 = xe x + e x and y00 = xe x + 2e x
Left-hand side: y00 − 2y0 + y = (xe x + 2e x ) − 2(xe x + e x ) + xe x = 0 ; Right-hand side: 0

4
2.7. General and particular solution to a DE
If we start with the DE
dy x
=− ,
dx y
it can be solved using separation of the variables (covered in Section 4) and the solution is

x2 + y2 = c

where c is the constant of integration and an arbitrary constant. The solution represents all possible solutions and is
called the general solution to the DE.
Sometimes a specific point through which the solution curve passes through may be prescribed. Suppose we want
dy
the solution to dx = − yx to pass through the point (0,1). compactly, this is y(0) = 1. This extra condition that the
general solution must satisfy is referred to as an initial condition. Then
dy x
= − subject to y(0) = 1
dx y
is called an initial value problem (IVP).
Since the general solution was x2 + y2 = c, with c arbitrary, we now determine c by using the prescribed informa-
tion. Substitute x = 0 and y = 1 into the general solution

x2 + y2 = c
02 + 12 = c
c=1

Hence, the particular solution to the DE is


x2 + y2 = 1.
Note that for each initial condition, a different particular solution can be obtained. Hence, a family of
solutions exists.

Exercises

1. For each of the following differential equations, determine its order and whether or not the equation is linear

d2 y dy
(a) x2 2
+ x + 2y = sin x
dx dx
2
d y dy
(b) (1 + y2 ) 2 + x + y = e x
dx dx
dy
(c) + xy = 0
2
dx
d2 y
(d) + sin (x + y) = sin x
dx2
d3 y dy
(e) + x + (cos2 x)y = x3
dx3 dx
2. Verify for each of the following that the given function(s) are solutions of the DE

(a) y00 − y = 0; y1 (x) = e x , y2 (x) = cosh x

5
(b) y00 + 2y0 − 3y = 0; y1 (x) = e−3x , y2 (x) = e x

(c) y00 + 4y0 + 3y = x; y1 (x) = x/3, y2 (x) = e−x + x/3



(d) 2x2 y00 + 3xy0 − y = 0, x > 0; y1 (x) = x, y2 (x) = x−1

3. Determine for what values of r each of the following linear differential equations has solutions of the form
y = erx .

(a) y0 + 2y = 0

(b) y00 − y = 0

(c) y00 + y0 − 6y = 0

(d) y000 − 3y00 + 2y0 = 0

4. Determine for what values of r each of the following linear differential equations has solutions of the form
y = xr .
(a) x2 y00 + 4xy0 + 2y = 0, x > 0

(b) x2 y00 − 4xy0 + 4y = 0, x>0

5. Please see exercises in the prescribed textbook

3. Direct Integration

The simplest solution to a DE is when the derivative depends on one variable only i.e.
dy
= f (x)
dx
This equation can be solved by simple direct integration. Rearrange terms and integrate both side

dy = f (x) dx
Z Z
dy = f (x) dx
Z
y= f (x) dx

Once the right hand side of the equation is integrated, we need to indicate the constant of integration c.

Example 1: Solve the following DE


dy
= 3x3 − 5x2 + π
dx
Solution: Integrate both sides of the equation
Z Z
dy = (3x3 − 5x2 + π) dx

3x4 5x3
y= − +π x+c
4 3
6
Example 2: Solve the following DE
dy
x = 3 + 2x − 5x2
dx
Solution: First write the DE in standard form
dy 3
= + 2 − 5x
dx x
and integrate both sides
Z Z !
3
dy = + 2 − 5x dx
x
5x2
y = 3 ln|x| + 2x − +c
2
Example 3: Find a particular solution to the initial value problem
dy 1
ex = − e2x
dx 2
subject to y(0) = 3.

Solution: First write the DE in standard form


dy e−x
= − ex
dx 2
and integrate both sides

e−x
Z Z !
dy = x
− e dx
2
e−x
=− − ex + c
2
Now, substitute the condition x = 0 and y = 3
1
3=− −1+c
2
9
c=
2
The particular solution is
e−x 9
y=− − ex +
2 2

Exercises

1. Solve the following differential equations


dy
(a) = sin t − cos t
dt
dy
(b) = cos5 x sin x
dx
dy
(c) = (cos t − sin t)2
dt

7
dy
(d) (3x − 1) =1
dx
1 dy 1
(e) 2 = √
x dx 3x3 − 1
2. Solve the following IVPs
dx
(a) = 2t subject to x(0) = 0.
dt
dy
= tan 3t subject to y π3 = 1.
 
(b) cos2 3t
dt
dy
(c) (x2 + 4) = 1 subject to y(0) = π.
dx
dy
(d) e x = 1 + sin e−x subject to y(0) = −1.
dx
3. Please see exercises in the prescribed textbook

4. Separation of Variables
Direct integration is only applicable when the derivative is expressed in terms of a single variable say f (x). When
the derivative depends on two variables, for instance y0 = f (x, y), we have to break up the DE since one can only
integrate an expression with respect to one variable at a time.
Consider the DE
dy
= f (x, y)
dx
Here, the derivative is a function of both x and y. We can factorize f (x, y) into factors containing only x-terms and
y-terms, i.e. f (x, y) = p(x).q(y). Thus
dy
= p(x)q(y)
dx
This can be manipulated to get
1
dy = p(x) dx
q(y)
and the integrate both side Z Z
1
dy = p(x) dx
q(y)
Example 1: Solve the DE using separation of variables
dy x
=−
dx y
Solution: Group dy with the y-factors on the left hand side and dx together with x on the right hand side
y dy = −x dx
Then integrate both sides
Z Z
y dy = − x dx

y2 x2
=− +c
2 2
y2 + x2 = 2c
y2 + x2 = A which represents a circle as discussed earlier.

8
Example 2: Solve the DE using separation of variables
dy
= (1 + x)(1 + y)
dx
Solution: rearrange the factors to get
1
dy = (1 + x) dx
1+y
Integrate both sides
Z Z
1
dy = (1 + x) dx
1+y
x2
ln |1 + y| = x + +c
2
Example 3: Solve the DE using separation of variables
dy  
= 1 + y2 e x
dx
Solution: rearrange the factors to get
1
dy = e x dx
1 + y2
Integrate both sides
Z Z
1
dy = e x dx
1 + y2
tan−1 y = e x + c
y = tan (e x + c)

Example 4: Solve the initial value problem


y dy
= ex
x dx
subject to y(1) = 0.

Solution: rearrange the factors to get


y dy = xe x dx
Integrate both sides
Z Z
y dy = xe x dx

Integrate by parts: let u = x so that du = dx and dv = e x so that v = e x

y2
Z
= xe − e x dx
x
2
= xe x − e x + c General solution

Substitute the initial conditions to find the particular solution. We have that y(1) = 0 and so

0=e−e+c
c=0

9
Substitute into the general solution

y2
= xe x − e x
2
y2 = 2e x (x − 1) Particular solution

It is possible that there are no x-factors or y-factors when factorizing f (x, y), so we should allow for the possibility
that either p or q could be constants. The example below illustrates this.

Example 5: Solve the DE


dy
= 0.2y
dx
Solution: Rearrange and integrate
Z Z
dy
= 0.2 dx
y
ln|y| = 0.2 x + c

Exercises

Solve the following differential equations


dy 1 + y
1. =
dx 2 + x
dx sin t
2. =
dt sin x
dy y2 + xy2
3. =
dx x2 y − x2
4. cos2 y dx − cos2 x sin y dy = 0

dx π
5. (t2 + 1)− tan x = 0 subject to x(0) = .
dt 2
dv g − v 1
6. = subject to v(0) = 0. Also show that v = g the instant when t = k ln |2|.
dt k 2
7. Please see exercises in the prescribed textbook

c Compiled by SM Simelane

10

You might also like