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

University of Western Sydney

School of Computing & Mathematics

200238 Mathematics for Engineers 2

ORDINARY DIFFERENTIAL EQUATIONS

1. First Order Differential Equations

Things I MUST do before each teaching session:


• Listen to ‘Lectures on Line”
• Print off lecture/workshop questions and tutorial questions
• Switch off mobile phones during lectures and tutorials.

Things I CAN do:


• Read the relevant sections of the text(s)
• Do the extra questions from the text(s) as indicated.

Student learning outcomes:

At the end of this section I should be able to:

First order ODEs


• Recognize and describe a first order ordinary differential equation
• Identify a function as a solution of an ordinary differential equation
• Solve a separable first order ordinary differential equation
• Apply first order separable ordinary differential equations to solve a practical problem
• Solve a linear first order ordinary differential equation
• Apply first order linear ordinary differential equations to solve a practical problem

1
Introduction to differential equations

Many mathematical models of relationships among variables are constructed in terms of rates
of change. Such models give rise to equations involving derivatives or differentials. These are
called differential equations. There are many techniques for solving differential equations but
each method relies on being able to classify the given differential equation as a certain type.

Classification of differential equations


In this unit we will consider ordinary differential equations (ODEs). An ordinary differential
d2 y dy
equation contains only ordinary derivatives, for example 2
− 2x = sin x , as distinct from
dx dx
∂f ∂f
a differential equation containing partial derivatives, for example, + = 2 y 2 + 3 x. (We
∂x ∂y
will consider what a partial derivative is in the topic Multi-variable Calculus).

Examples of ordinary differential equations:


dy x
(i) = or xdx − 3dy = 0
dx 3

2 x + y dy
(ii) + =0 or (2 x + y )dx + (2 y + x)dy = 0
2 y + x dx

d 2 y dy
(iii) x = .
dx 2 dx
In each of the above examples we have used the letters x and y to represent the variables in the
equation however any letter could be used. The important factor is to be able to identify which
is the dependent variable and which is the independent variable. The variable that is being
differentiated is the dependent variable and the variable with respect to which the
differentiation occurs is the independent variable.

Example:
Given the ordinary differential equation
d2x dx
2
+t =e 2t
dt dt
the independent variable is t and the dependent variable is x.

Differential equations can involve any order derivative. If in the differential equation the first
derivative is the highest derivative used then it is called a first order ODE. If the equation
contains a second derivative it is called a second order ODE, and so on. The order of a
differential equation is determined by the highest derivative that it contains.
If the derivative determining the order is raised to a power then that power is called the degree
of the differential equation.

2
Examples:
d 2 y dy
(i) + + 6x =
4 is a second order, degree one ODE.
dx 2 dx

4
 d 3 y   dy 
5

(ii)  3  +   + 9 y = 0 is a third order, degree four ODE.


 dx   dx 

Solutions of ordinary differential equations

The solution of an ordinary differential equation will be a function (of a family of functions) of
the independent variable such that the function and its derivatives satisfy the given ODE.
The solution of the form y = h(x) is called an explicit while the solution H ( x, y ) = 0 is called
an implicit solution.

Example:
d2 y dy
1. Verify that the function y = e3x is a solution of the ODE 2
− 6 + 9y =
0.
dx dx
y ( x ) = e3 x
dy
= 3e3 x
dx
d2 y
= 9e3 x
dx 2
d2 y
− 6 + 9 y = 9e3 x − 6(3e3 x ) + 9 ( e3 x ) = 0
dy
2
dx dx
∴ y = e is a solution of the given ODE.
3x

In general there will be many related solutions of an ODE, for example, try y = 2e3 x in example
1 above. The solution will usually contain unknown constants. A solution with the same
number of independent constants as the order of the ODE is called the general solution. If we
are also given enough other conditions, called initial or boundary conditions, then the unknown
constants can be evaluated to obtain a particular solution.
We now have to consider their classification to construct a solution. The initial classification is
according to their order.

First order ODEs

We will consider solving only two particular types of first order ODEs, separable and linear.
There are many more types of first order equations. Look in your text or other references to see
these other types and consider what their characteristics are compared to the two types you are
expected to know for this unit.

3
Separable ODEs
A differential equation that can be written in the form
dy
g ( y) = f ( x) or g ( y ) dy = f ( x) dx
dx
is called a separable ODE (since the independent variable x and the dependent variable y are
separated). The general format is to have the dependent variable on the left and the independent
variable on the right of the equal sign.
To solve a separable differential equation we integrate both sides with respect to x to give
dy
∫ g ( y) dx dx = ∫ f ( x)dx.
 dy 
Since  dx = dy (which is just the variable substitution formula) this leads to the equation
 dx 
∫ g ( y ) dy = ∫ f ( x) dx ( +C ) .

This gives the general solution of this first order ODE.

Sometimes the general solution does not account for all possible solutions. These extra cases
are called singular solutions and are not usually very useful in practice. To be a singular
solution, a function must: actually be a solution of the ODE, and not be able to be obtained
from the general solution for any values of the unknown constant(s).

Examples: (Check what is known and what has been assumed about each variable.)
Solve the following differential equations:
dy 1
1. = xy 2
dx
dy
1
= x dx ( )
y 2
−1
y 2
dy = x dx
−1
∫ y 2
dy = ∫ x dx

1 x2
2y 2
= + C1
2
1 x2
y 2
= +C
4
x2
y=(
+ C)2 .
4
(Can you also find a singular solution? Check what happens if y = 0 )

4
dy
2. Solve the initial value problem ( x 2 + 1) − 2 xy 2 = 2 x, y (0) = 1.
dx
dy
(x 2 + 1) =2 x + 2 xy 2
dx
dy
(x 2 + 1) =2 x(1 + y 2 )
dx
dy 2x
= 2 dx
1+ y 2
x +1
tan −1=
y ln x 2 + 1 + C.
= tan −1 1 ln(0 + 1) + C
Since y (0) 1,=
−1 p
= =
C tan 1
4
p
=
and the particular solution is y tan ( ln( x 2 + 1) + ).
4

Applications of first order separable ODEs

Exponential growth and decay

1. One model for the spread of a disease is to assume that the rate at which the number of
infected people changes is proportional to the number of infected people, i.e. the more people
infected the faster the spread of the disease. If in the course of any given year the number of
cases of a disease increases by 20%, given that there are 1000 cases today how many years will
it take to increase to 10000 cases?
Let P = number of infected cases at any time and let ‘today’ be time t = 0.
dP
= kP (a separable ODE)
dt
∴P = Ae kt
= t 0,= P 1000 ⇒
= Ae0
1000 ⇒
= A 1000
∴P = 1000e kt .
t = 1, P = 1000 + 20% = 1200 ⇒
1200 = 1000e k
= k ln1.2 ≈ 0.1823
∴P =1000e0.1823t
= =
P 10000, t ?
10000 = 1000e0.1823t
ln10
= t ≈ 12.6 years.
0.1823
It will take approximately 13 years for there to be 10000 cases.

5
Linear ODEs

Linear differential equations occur in many practical applications. A linear ODE can be of any
order. We will develop techniques later for solving higher order linear equations.

Linear ODEs are equations in which:


• all coefficients are functions of only x (or a constant)
• y and all its derivatives are only of the first power, i.e. linear
• the leading coefficient is 1 (i.e. the coefficient of highest derivative).

All other ODEs are non-linear.

A linear ODE will have the standard linear form


dn y d n −1 y dy
n
+ an −1 ( x) n −1 + ... + a1 ( x) + a0 ( x) y ( x) =r ( x)
dx dx dx
NOTE: Sometimes a linear ODE will be written with the leading coefficient not equal to 1. If
this is the case, just divide by this term (be careful if the term can sometimes be zero) to put it
in the standard linear form shown above.

If r ( x) ≡ 0 then the ODE is homogeneous, otherwise it is non-homogeneous.

A general first order linear ODE has the standard linear form
dy
+ p ( x) y =
r ( x)
dx
Solving a Linear First Order Ordinary Differential Equation

Differential equations that can be solved by integrating both sides are called exact.
For example:
d 2
( x y ) = x3
dx
d 2 
∫  dx ( x y)  dx = ∫ x dx
3

x4
x 2=
y +C
4
x2 C
or y = + ( x ≠ 0)
4 x2
d 2 dy
Using the product rule (=
x y) x2 + 2 xy
dx dx
d 2
so the equation ( x y ) = x 3 can also be written as
dx
dy
x2 + 2 xy = x3.
dx

6
Example:
dy
The ODE from the example above x 2 + 2 xy =
x 3 can be put into standard linear form by
dx
dividing throughout by x (provided x ≠ 0).
2

x 2 dy 2 x x3
+ y =
x 2 dx x 2 x2
dy 2
+ y= x.
dx x

Any linear ODE that is not exact can be made so by multiplication throughout by a function
called an integrating factor. The integrating factor will be a function of the independent
variable and is usually given by µ = f ( x) .
dy
Consider the standard first order linear differential equation + p( x) y =r ( x) , multiply
dx
throughout by the integrating factor µ ( x) such that the ODE can be written in exact form as
d
(µ y) = µ r
dx
and a solution then would be
µ y = ∫ µ r ( x) dx
To find µ , multiply the ODE by µ ( x) , then
dy
µ +µ py= µr
dx
and for the ODE to be exact
d dy
(=µ y ) µ + µ py
dx dx
dµ dy dy
i.e. y +µ =µ + µ py (using the product rule on the l.h.s.)
dx dx dx

y = µ py
dx

= µp (a separable equation)
dx

= pdx
µ
e∫ .
∴µ=
pdx

7
Summary:

Given a standard linear first order ordinary differential equation:

dy
+ p( x) y =
r ( x)
dx

the integrating factor is µ = e ∫


pdx
and the solution of the equation is given by

µ y = ∫ µ r ( x) dx .

Examples:

Solve the following differential equations (take the independent variable to be positive).
dy
1. +y= e3 x
dx
= p ( x) 1,= r ( x ) e3 x

= µ e= ∫ 1dx e x
So the solution will be:
e= ∫ e x × e3 x dx
x
y

=∫ e 4 x dx
e4 x
e=
x
y +C
4
OR
e4 x e3 x
y = e− x ( + C) = + Ce − x .
4 4

2. xdy = ( x sin x − y )dx

Putting the equation in standard linear form:


dy 1
+ y = sin x (since x ≠ 0) so
dx x
1
= p( x) = , r ( x) sin x
x
1
x) e ∫ =
dx
µ (= x
e=
ln x
x (since x > 0) and
µ y = ∫ µ sin x dx

xy = ∫ x sin x dx so
1
y = [ − x cos x + sin x + C ] .
x

8
Applications of first order linear ODEs

Electric circuits

E (t )

Simple circuits involve a source of electric energy E with resistors R (ohms Ω), inductors L
(henries H) and capacitors C (farads F) in series, resulting in a current I (amps A). The voltage
drop (volts V) across each element is given by
dI Q 1
C C∫
ER = RI , EL = L , E=C = I dt
dt
and the total voltage drop is
E = ER + EL + EC .

The RL-circuit involves a source of electric energy E, a resistor R and an inductor L. It gives
rise (under Kirchhoff's Voltage Law) to the differential equation for the current I

dI
L + RI =
E (t ) .
dt

This is a first order linear ODE where I and E are functions of time. Solving this equation
gives I as a function of time.

R

R
dI R E dt t
+ I= so µ= e L
= eL and
dt L L
R R
t t E
e =
L
I (t ) ∫ e L
×
L
dt
R R
− t t E
=I (t ) e L
.∫ e L × dt
L

As E is a function of time this integral could be difficult to calculate. However we will


consider only the simple case where E is constant. Let E = E 0 (a constant) then


R
t  R
t E0 
= ∫ e × dt 
L L
I (t ) e
 L 

R
t  E0 L RL t 
= e L
 × e + C
L R 
R
E0 − t
= + Ce L .
R
9
E0
NOTE: As t → ∞ , I = which is Ohm's Law. (Can you see this directly from the ODE?)
R

Example:

A 12V (volt) battery is connected to an RL-circuit in which the inductance is ½H (henry) and
the resistance is 10 Ω (ohm). Determine the current I A (amp) in the circuit if the initial
current is zero.

1 dI
E (t ) = 12, L = , R = 10, ⇒ + 20 I = 24 so
2 dt

µ (t ) e=
=
20 dt
e 20t and

e 20t I (t ) =  ∫ e 20t 24 dt 
 
 24 
= I (t ) e −20t  e 20t + C  .
 20 
6 6
At t = 0, I (t ) = 0, 0 = + C, ⇒ C =− so
5 5
I=(t )
6
5
(1 − e−20t ) .

The RC-circuit involves a source of electric energy E, a resistor R and a capacitor C (farads F).
This leads to the differential equation for the current I

dI 1 dE
R + I =. (Why?)
dt C dt

Examples are similar to the RL-circuit case shown above.

10
Mixture problems

Initially 50kg of salt is dissolved in a large tank holding 1200 litres of water. A brine solution
is pumped into the tank at a rate of 12 litres per minute, and the well-stirred solution is then
pumped out at the rate of 8 litres per minute. If the concentration of the solution entering the
tank is 0.2kg/litre, determine the amount of salt in the tank at any time. Also, how much salt
will be present after 50 minutes?

Let S = the amount of salt in the tank after t minutes.

=
Rate of change of salt inflow − outflow
(( rate
(((((( 
(( 
( kg / l )×(l /min)
 
( kg / l )×(l /min)
dS  
   
dt

dS  kg    kg   l   S  kg   l  
  =0.2   × 12   −   ×8  
dt  min    l   min   1200 + 4t  l   min  

dS 2S
= 2.4 − or
dt 300 + t
dS 2
+ S=
2.4 (a linear ODE) so
dt 300 + t
2
∫ dt 2 ln 300 + t
m (=
t) e 300 + t
= e = (300 + t ) 2 (300 + t ≥ 0).

Thus, (300 + t ) 2 =
S (t ) ∫ (300 + t ) 2 × 2.4 dt
1
=S (t ) 0.8(300 + t )3 + C  .
2 
(300 + t )

=
At t 0,=S 50 so
1
50 = 2 0.8 × (300)3 + C  , ⇒ C = −1.71 × 107.
300
1
=
At t 50, =S (50) 0.8(300 + 50)3 − 1.71 ×=
2 
107  140.4kg (1d.p.).
(300 + 50)

11
Questions for Lecture/ Workshop
1. Solve the following first order separable differential equations:
dy
a) ln y x = 3x 2 y
dx
b) x cos xdx + (1 − 6 y=
5
)dy 0, = y (π ) 0
x2 y − y
c) y′ =
y +1

2. In radioactive materials the rate of decay is proportional to the mass present. If it takes
2 years for a piece of Uranium to decrease in mass from 10 grams to 8 grams, find the mass
after 6 years.

3. Newton’s Law of cooling states that the rate of change of the temperature of an object
is proportional to the difference in the temperature of the surroundings into which it is placed
and that of the object itself. A body is discovered in a room with constant temperature of 300C.
From the time of death the body will radiate heat into the room according to Newton’s law. On
arriving at 9.40pm the forensic scientist measured the body temperature as 36.10 and after
further investigation at 11.00pm again measured the body temperature which was found to be
34.20. Assuming that the body had a normal body temperature of 37.50 at the time of death, at
what time did the person die?

4. Consider the spread of a technological innovation (eg a communication device, farming


practice etc) through a community of size N. Let x(t ) denote the number who have adopted
the innovation at time t. (Clearly x(t ) has integer values but we can approximate by use of a
continuous function.) If the spread of technology is by word of mouth then it is reasonable to
assume that the rate of change of x(t ) will be proportional to both the number who have
already adopted it and to the number remaining who have not adopted it. This can be modelled
dx
by the ODE =ax( N − x), x(0) =1 . Show that the solution is x = Ne aNt /( N − 1 + e aNt ) (hint:
dt
1 1 1 1 
=  +  by partial fractions). NOTE: This ODE could also be used for the
x( N − x) N  x N − x 
spread of an infectious disease.

5. Solve the following linear differential equations (suitable restrictions may be made on
the independent variable):

a) xy ′ + 4 y = x5
dz
b) − xz = −x
dx
dQ 1
c) + =Q 4, = 100
Q(2)
dt 5 + t

12
Answers:

1. a) (ln y=
) 2 3 x 2 + C. b) y 6 −=
y x sin x + cos x + 1.
x3
c) ( y + ln y ) = − x + C.
3
2. 5.12 g 3. approx. 8.57pm
x2
1 5 C 20t + 2t 2 + 652
5. =
a) y x + 4. z = 1 + Ce
b) = 2
c) Q(t ) (t > −5).
9 x 5+t

13
Tutorial Questions
1. Determine which of the following are separable.
dy 8 x + y 2 − 1
(i) =
dx xy
dy
(ii) = xy + x − 2 y − 2
dx
dy
(iii) = 2( x + y 2 x).
dx
2. Solve the following separable differential equations:
dy y 2 + xy 2
(i ) =
dx x 2 y − x 2
dy
(ii ) x = y + xy
dx
sin x π 
= (iii ) dy cos= x dx y  1
1+ y 2
dy
3. Solve the initial value problem: (4 x 2 + x − 1) + (8 x + 1)( y + 2) = 0 , y (1) = 1.
dx
4. A certain radioactive material is known to decay at a rate proportional to the amount
present. If after one hour it is observed that 10% of the material has decayed, find the
half-life of the material.

5. Solve the following differential equations:


dy
(i) x − 4 y = x6 e x
dx
dy
(ii) + y cot x = cos x
dx
(iii)=xdy ( x sin x − y )dx.

1
C∫
6. Given the voltage drops for a resistor and capacitor are E R = iR and EC = i dt
respectively, show that an RC-circuit with resistance R, capacitance C, voltage E and current i
di 1 dE
has equation R + i = . Solve this equation if R = 1 / 2, C = 1 / 10, E = 12t and
dt C dt
i (0) = 0.

7. A tank contains 40l of solution containing 2g of substance per litre. A liquid solution
containing 3g of this substance per litre runs in at the rate of 4l /min and the well-stirred
mixture runs out of the tank at the same rate. Find the amount of substance in the tank after
15minutes.

14
Answers

1. (i) not separable, (ii) separable, (iii) separable

2. (i) ye1/ y = Axe −1/ x (ii) y = Axe x (iii)=y 2sin x − 1

12
=
3. y −2 4. 6.6hr.
4x + x − 1
2

1  sin 2 x 
[
5. (i) y = x 4 xe x − e x + C ] (ii) y = 
sin x  2
+ c (iii)

y=
1
[− x cos x + sin x + c] 6. i=
(t )
6
(1 − e −20t ) 7. 111.1g
x 5

Extra Questions
1. from James text (J):
page 775 Exercise 10.3.6 , page 788 Exercise 10.5.4, questions 11-14,
page 801 Exercise 10.5.11, questions 31-34.

2. from Kreyszig (K):


Page 28 Set 1.3: Q 2-15, 19-27.

3. from Stewart (S)


Page 586 Exercises 1-9, 11-14, 39-44.
Page 606 Exercises 1-20, 27-32.

15

You might also like