You are on page 1of 8

MAT1264 Lecture 1 prepared by Dr.

Mpinganzima Lydie 1

1 Introduction to Ordinary Differential Equations


Definition. An equation containing the derivatives of one or more dependent variables, with
respect to one or more independent variables, is said to be a differential equation (DE). For the
equation
d2 x
+ 16x = 0,
dt2
the unknown function or dependent variable is x and the independent variable is t.
Definition. If an equation contains only ordinary derivatives of one or more dependent variables
with respect to a single independent variable it is said to be an ordinary differential equation
(ODE). For example,

dy d2 y dx dy
+ 5y = ex , + 6y = 0, and + = 2x + y.
dx dx2 dt dt
are ordinary differential equations.
The ordinary derivatives may be written by using either the Leibniz notation dy/dx, d2 y/dx2 ,
′′ ′′′
d3 y/dx3 , . . . or the prime notation y ′ , y , y , . . . By using the prime notation, the two first
equations above can be written as
′′
y ′ + 5y = ex , y − y ′ + 6y = 0.

Observe that the prime notation is used to denote only the first three derivatives. Other derivatives
are y (4) , y (5) , . . . , y (n) where y (n) = dn y/dxn .
In symbols we can express an nth-order ordinary differential equation in one dependent variable
by the general form,
′′
F (x, y, y ′ , y , . . . , y (n) ) = 0, (1)
′′
where F is a real-valued function of n + 2 variables: x, y, y ′ , y , . . . , y (n) .
Classification of ODE: Ordinary differential equations are classified by order and linearity.
The order of a differential equation is the order of the highest derivative in the equation. In the
first example above, the first and the third equations are of the first order and the second equation
is of the second order.
′′
An nth-order ordinary differential equation (1) is said to be linear if F is linear in y, y ′ , y , . . . , y (n) .
This means that an nth ODE is linear if (1) can be written as

dn y dn−1 y dy
an (x) n
+ a n−1 (x) n−1
+ . . . + a1 (x) + a0 (x)y = g(x).
dx dx dx
For a first and second order ODE, we have

dy d2 y dy
a1 (x) + a0 (x)y = g(x), a2 (x) 2
+ a1 (x) + a0 (x)y = g(x)
dx dx x
Observe that
′′
1. The dependent variable y and its derivatives y ′ , y , . . . , y (n) are of the first degree, that is, the
power of each term involving y is 1.
′′
2. The coefficients a0 , a1 , a2 , . . . , an of y, y ′ , y , . . . , y (n) depend at most on the dependent vari-
able x.
MAT1264 Lecture 1 prepared by Dr. Mpinganzima Lydie 2

(1 − y)y ′ + 2y = ex , nonlinear
d2 y
+ sin y = 0, nonlinear
dx2
′′
y − y ′ + 2y = x, linear

Definition. Any function y, defined on an interval I and possessing at least n derivatives that are
continuous on I, 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 on the interval.
Example. The functions y = c1 cos 4x and y = c2 sin 4x, where c1 and c2 are arbitrary constants
or parameter, are both solutions of the linear differential equation
′′
y + 16y = 0.
′′
Solution. For y = c1 cos 4x, the first two derivatives are y ′ = −4c1 sin 4x and y = −16c1 cos 4x.
′′
Substituting y and y then gives
′′
y + 16y = −16c1 cos 4x + 16c1 cos 4x = 0
′′
Similarly, y = c2 sin 4x, we have y = −16c2 sin 4x, so that
′′
y + 16y = −16c2 sin 4x + 16c2 sin 4x = 0

Finally, it is straightforward to verify that the linear combination of solutions, or the two-parameter
family y = c1 cos 4x + c2 sin 4x, is also a solution of the differential equation.

Exercises
1. State the order of the given ODE, and whether it is linear or nonlinear. If it is linear, is it
homogeneous or nonhomogeneous?

dy ′′
(f) y + 4y ′ − 3y = 2y 2
(a) = 5y
dx d3 y dy
d2 y (g) 3
+ t + t2 y = t3
(b) +x=y dt dt
dx2 dx
dy (h) cos x + x sin t = 0
(c) y =x dt
dx ′′
′′′ (i) y (4) + ex y = x3 y ′
(d) y + xy ′ = x sin x
′′ 1
′′
(e) y + x sin xy ′ = y (j) x2 y + ex y ′ =
y
′′
2. Verify that y = cos x and y = sin x are solutions of the ODE y + y = 0. Are any of the
following functions solutions?

(a) sin x − cos x (b) sin(x + 3) (c) sin 2x

Justify your answer.


′′
3. Verify that y = ex and y = e−x are solutions to the ODE y − y = 0. Are any of the following
functions solutions?
MAT1264 Lecture 1 prepared by Dr. Mpinganzima Lydie 3

1 (b) cos x (c) xe


(a) cosh x = (ex + e−x )
2

Justify your answer.


′′
4. y1 = cos(kx) is a solution of y + k 2 y = 0. Guess and verify another solution y2 that is not a
multiple of y1 . Then find a solution that satisfies y(π/k) = 3 and y ′ (π/3) = 3.
′′
5. y1 = ekx is a solution of y − k 2 y = 0. Guess and verify another solution y2 that is not a
multiple of y1 . Then find a solution that satisfies y(1) = 3 and y ′ (1) = 2.
′′
6. Using exercise 2, find a solution of y + y = 0 that satisfies y(π/2) = 2y(0) and y(π/3) = 3.
′′
7. Find two values of r such that y = erx is a solution of y − y ′ − 2y = 0. Then find a solution
of the equation that satisfies y(0) = 1, y ′ (0) = 2.
′′
8. Verify that y = x is a solution of y + y = x, and find a solution y of this ODE that satisfies
y(π) = 1 and y ′ (π) = 0.
′′
9. Verify that y = −e is a solution of y − y = e, and find a solution y of this ODE that satisfies
y(1) = 0 and y ′ (1) = 1.

2 First order differential equation


2.1 Separable equation
Definition. A separable equation is one of the form
dy
= g(x)h(y), (2)
dx
where the derivative dy/dx is a product of a function of x alone times a function of y alone, rather
than a more general function of the two variables x and y.
dy
= y 2 xe3x+4y , separable
dx
dy
= y + sin x, non-separable
dx
An equation of the form (2) can be written as

dy
p(y) = g(x),
dx
where p(y) = 1/h(y) and whose solution is
Z Z
p(y) dy = g(x) dx, i.e. H(y) = G(x) + C,

where H(y) and G(x) are antiderivatives of p(y) and g(x), respectively and C is the constant of
integration.
Example. Solve (1 + x) dy = y dx = 0.
MAT1264 Lecture 1 prepared by Dr. Mpinganzima Lydie 4

dy dx
Solution. This equation can be written as = . Integrating on both sides, we get
dx 1+x
dy dx
Z Z
= , so ln|y| = ln|1 + x| + ln C, that is, y = C(1 + x)
dx 1+x
Example. Solve the initial-value problem
dy
= x2 y 3 , y(1) = 3
dx
dy
Solution. Separating this ODE gives = x2 dx. Thus,
y3

dy −1 x3
Z Z
2
= x dx, so = + C.
y3 2y 2 3
−1 1 −7
Since y = 3 when x + 1, we have = + C and C = . Substituting this value into the above
18 3 18
solution and solving for y, we obtain
3
y(x) = √ .
7 − 6x3
 1/3
7
This solution is valid for x < .
6

2.2 First-Order Linear Equations


A first-order linear equation is an equation of the form
dy
a1 (x) + a0 (x)y = g(x).
dx
When g(x) = 0, it is said to be homogeneous; otherwise it is nonhomogeneous. Dividing both
sides by the leading coefficients a1 (x), we obtain a standard form of a linear equation

dy
+ P (x)y = f (x) (3)
dx
The solution is a sum of two solutions y = yc + yp , where yc is a solution to the associated
homogeneous equation
dy
+ P (x)y = 0
x
and yp is a particular solution of the nonhomogeneous equation (3).
The homogeneous equation is separable and solving for y gives
R
P (x) dx
yc = Ce−

The particular solution yp can be found using the method of variation of parameters described
below.
MAT1264 Lecture 1 prepared by Dr. Mpinganzima Lydie 5

Variation of parameters
The variation of parameter method is a method
R
used to find a particular solution yp . The idea is
to find u so that yp = uy1 where y1 = e − P (x) dx solves the corresponding homogeneous equation.
Substituting yp in (3) gives
 
dy1 du du dy1
u + y1 + P (x)uy1 = f (x) or y1 +u + P (x)y1 = f (x)
dx dx dx dx

This gives
du
y1 = f (x)
dx
dy1
since + P (x)uy1 = 0 as y1 is the homogeneous solution. We therefore obtain
dx
Z R
f (x)
Z
u= dx = e P (x) dx f (x) dx
y1
Hence R Z R
P (x) dx P (x) dx
yp = uy1 = e− e f (x) dx

and R R Z R
P (x) dx P (x) dx P (x) dx
y = Ce− + e− e f (x) dx
R
The function e P (x) dx is called an integrating factor
R of the given differential equations because,
if we P (x) dx , the left side becomes the derivative
R multiply both sides of the equation (3) by e
of e P (x) dx y(x)
dy
Example. Solve + xy = x3
dx R R 2
Solution. Here P (x) = x and f (x) = x3 . We have e− P (x) dx = e− x dx = e−x /2 The homoge-
neous solution is
2
yc = Ce−x /2
and a particular solution is Z
−x2 /2 2 /2
yp = e ex x3 dx

Let us integrate by parts


Z
2 2 2 /2
x3 ex /2 dx = [Let U = x2 , dV = xex /2 Then dU = 2x dx, V = ex ]
Z
2 x2 /2 2 2 2
=x e − 2 xex /2 dx = x2 ex /2 − 2ex /2

So
2 /2 2 /2 2 /2
yp = e−x (x2 ex − 2ex ) = x2 − 2
and
2 /2
y = Ce−x + x2 − 2.
MAT1264 Lecture 1 prepared by Dr. Mpinganzima Lydie 6

2.3 Examples of applications


2.3.1 Growth and Decay
The initial-value problem
dx
= kx, x(t0 ) = x0 ,
dt
where k is a constant of proportionality, serves as a model for diverse phenomena involving either
growth or decay.
Example: Bacteria growth. A culture initially has P0 number of bacteria. At t = 1h the
3
number of bacteria is measured to be P0 . If the rate of growth is proportional to the number of
2
bacteria P (t) present at time t, determine the time necessary for the number of bacteria to triple.
Solution. The differential equation to solve is
dP 3
= kP, P (0) = P0 , P (1) = P0 ,
dt 2
Solving this equation, we obtain
P (t) = Ce−kt .
At t = 0, P0 = C so that P (t) = P0 ekt .
3 3 3
At t = 1, P0 = P0 ek , or ek = . From this equation, we get k = ln = 0.4055. So,
2 2 2
P (t) = P0 e0.4055t

To find the time at which the number of bacterias has tripled, we solve

3P0 = P0 e0.4055t

for t. It follows that


ln 3
0.4055t = ln 3 → t = ≈ 2.71h
0.4055

2.3.2 Newton’s second law of motion


According to Newton’s empirical law of cooling/warming, the rate at which the temperature of
a body changes is proportional to the difference between the temperature of the body and the
temperature of the surrounding medium, the so-called ambient temperature. If T (t) represents
the temperature of a body at time t, Tm the temperature of the surrounding medium, and dT /dt
the rate at which the temperature of the body changes, then Newton’s law of cooling/warming
translates into the mathematical statement
dT
= k(T − Tm ),
dt
where k is a constant of proportionality. In either case, cooling or warming, if Tm is a constant, it
tends to reason that k < 0.
Example. When a cake is removed from an oven, its temperature is measured at 300◦ F . Three
minutes later its temperature is 200◦ F . How long will it take for the cake to cool off to a room
temperature of 70◦ F ?
Solution. Observe that Tm = 70. We must solve
dT
= k(T − 70), T (0) = 300,
dt
MAT1264 Lecture 1 prepared by Dr. Mpinganzima Lydie 7

and determine the value of k so that T (3) = 200.


The equation can be written as a separable equation
dT
= k dt,
T − 70
whose solution is
ln|T − 70| = kt + C1 , or T (t) = 70 + C2 ekt .
When T (0) = 0, we observe that C2 = 230. Therefore
T (t) = 70 + 230ekt .
Finally T (3) = 200 leads to
13 1 13
200 = 70 + 230e3k → e3k = or k= ln = −0.19018.
23 3 23
Thus,
T (t) = 70 + 230e−0.19018t .

2.3.3 Series of circuit


For a series circuit containing only a resistor and an inductor, Kirchhoff’s second law states that
the sum of the voltage across the inductor L(di/dt) and the voltage drop across the resistor iR is
the same as the impressed voltage E(t) on the circuit. See Figure below

LR series circuit
L

E
R

Thus, we obtain the linear differential equation of the current i(t),


di
L + Ri = E(t)
dt
where L and R are constants known as the inductance and resistance, respectively. The current
i(t) is also called the response of the system.
The voltage drop across a capacitor with capacitance C is given by q(t)/C, where q is the charge
on the capacitor. Hence, for the series of circuit shown in the Figure below,

RC series circuit

R
E

C
MAT1264 Lecture 1 prepared by Dr. Mpinganzima Lydie 8

Kirchhoff’s second law gives


1
Ri + q = E(t).
C
But the current i and the charge q are related by i = dq/dt, so that the equation becomes,
dq 1
R + q = E(t).
dt C
1
Example. A 12-volt battery is connected to a series circuit in which the inductance is henry
2
and the resistance is 10 ohms. Determine the current i if the initial current is zero.
1
Solution. Since L = , R = 10 and E = 12, we must solve
2
1 di
+ 10i = 12, i(0) = 0.
2 dt
6
Solving this equation, we find i(t) = + Ce−20t . Using the initial condition i(0) = 0, we find
5
6
C = − . Therefore,
5
6 6
i(t) = − e−20t
5 5

Exercises
1. Solve the following separable equations
dy y dy x2 dy
(a) = (c) = 2 (d) = x2 y 2
dx 2x dx y dx
dy 3y − 1 dx
(b) = (e) = ex sin t
dx x dt

2. Solve the following linear equations


dy 2y dy
(a) − = x2 (c) +y =x
dx x dx
dy 2y 1 dy x
(b) + = 2 (d) 2e y = ex = x2
dx x x dx

3. Solve the following initial-value problems



 dy + 10y = 1
(a) dt
y(1/10) = 2/10

 dy + 3x2 y = x2
(b) dt
y(0) = 1

4. An RL circuit has an electromagnetic force (E(t)) given (in volts) by 3 sin 2t, a resistance (R)
of 10 ohms, an inductance (L) of 0.5 henry, and an initial current (i) of 6 amperes. Find the
current in the circuit at any time t?

You might also like