You are on page 1of 19

First Order

Differential Equations

19.2

Introduction
Separation of variables is a technique commonly used to solve rst order ordinary dierential
equations. It is so-called because we rearrange the equation to be solved such that all terms involving
the dependent variable appear on one side of the equation, and all terms involving the independent
variable appear on the other. Integration completes the solution. Not all rst order equations can be
rearranged in this way so this technique is not always appropriate. Further, it is not always possible
to perform the integration even if the variables are separable.
In this Section you will learn how to decide whether the method is appropriate, and how to apply it
in such cases.
An exact rst order dierential equation is one which can be solved by simply integrating both sides.
Only very few rst order dierential equations are exact. You will learn how to recognise these and
solve them. Some others may be converted simply to exact equations and that is also considered
Whilst exact dierential equations are few and far between an important class of dierential equations
can be converted into exact equations by multiplying through by a function known as the integrating
factor for the equation. In the last part of this Section you will learn how to decide whether an
equation is capable of being transformed into an exact equation, how to determine the integrating
factor, and how to obtain the solution of the original equation.

Prerequisites

understand what is meant by a dierential


equation; (Section 19.1)

Before starting this Section you should . . .


'


$

explain what is meant by separating the


variables of a rst order dierential equation

Learning Outcomes
On completion you should be able to . . .
&
HELM (2005):
Section 19.2: First Order Dierential Equations

determine whether a rst order dierential


equation is separable
solve a variety of equations using the
separation of variables technique

11

1. Separating the variables in first order ODEs


In this Section we consider dierential equations which can be written in the form
dy
= f (x)g(y)
dx
Note that the right-hand side is a product of a function of x, and a function of y. Examples of such
equations are
dy
dy
dy
= x2 y 3 ,
= y 2 sin x and
= y ln x
dx
dx
dx
Not all rst order equations can be written in this form. For example, it is not possible to rewrite
the equation
dy
= x2 + y 3
dx
in the form
dy
= f (x)g(y)
dx

Task

Determine which of the following dierential equations can be written in the form
dy
= f (x)g(y)
dx
If possible, rewrite each equation in this form.
(a)

x2
dy
= 2,
dx
y

(b)

dy
= 4x2 + 2y 2 ,
dx

(c) y

dy
+ 3x = 7
dx

Your solution

Answer
 
dy
1
2
(a)
,
=x
dx
y2

(b) cannot be written in the stated form,

(c) Reformulating gives

12

1
dy
= (7 3x) which is in the required form.
dx
y

HELM (2005):
Workbook 19: Dierential Equations

The variables involved in dierential equations need not be x and y. Any symbols for variables may
be used. Other rst order dierential equations are
 
d
dv
1
dz
z
= te
= and
=v
dt
dt
dr
r2
Given a dierential equation in the form
dy
= f (x)g(y)
dx
we can divide through by g(y) to obtain
1 dy
= f (x)
g(y) dx
If we now integrate both sides of this equation with respect to x we obtain


1 dy
dx = f (x) dx
g(y) dx
that is


1
dy =
g(y)


f (x) dx

We have separated the variables because the left-hand side contains only the variable y, and the
right-hand side contains only the variable x. We can now try to integrate each side separately. If
we can actually perform the required integrations we will obtain a relationship between y and x.
Examples of this process are given in the next subsection.

Key Point 1
Method of Separation of Variables
The solution of the equation
dy
= f (x)g(y)
dx
may be found from separating the variables and integrating:


1
dy = f (x) dx
g(y)

HELM (2005):
Section 19.2: First Order Dierential Equations

13

2. Applying the method of separation of variables to ODEs

Example 3
Use the method of separation of variables to solve the dierential equation
3x2
dy
=
dx
y

Solution
The equation already has the form
dy = f (x)g(y)
where
f (x) = 3x2

and

g(y) = 1/y.

Dividing both sides by g(y) we nd


dy
= 3x2
dx
Integrating both sides with respect to x gives


dy
y dx = 3x2 dx
dx
y

that is



y dy =

3x2 dx

Note that the left-hand side is an integral involving just y; the right-hand side is an integral involving
just x. After integrating both sides with respect to the stated variables we nd
1 2
y
2

= x3 + c

where c is a constant of integration. (You might think that there would be a constant on the
left-hand side too. You are quite right but the two constants can be combined into a single constant
and so we need only write one.)
We now have a relationship between y and x as required. Often it is sucient to leave your answer
in this form but you may also be required to obtain an explicit relation for y in terms of x. In this
particular case
y 2 = 2x3 + 2c
so that

y = 2x3 + 2c

14

HELM (2005):
Workbook 19: Dierential Equations

Task

Use the method of separation of variables to solve the dierential equation


cos x
dy
=
dx
sin 2y
dy
First separate the variables so that terms involving y and
appear on the left, and terms involving
dx
x appear on the right:
Your solution

Answer
You should have obtained
dy
sin 2y
= cos x
dx
Now reformulate both sides as integrals:
Your solution

Answer


dy
dx = cos x dx that is
sin 2y
dx


sin 2y dy =

cos x dx

Now integrate both sides:


Your solution

Answer
12 cos 2y = sin x + c
Finally, rearrange to obtain an expression for y in terms of x:
Your solution

Answer
y = 12 cos1 (D 2 sin x) where D = 2c

HELM (2005):
Section 19.2: First Order Dierential Equations

15

Exercises
1. Solve the equation
ex
dy
=
.
dx
y
2. Solve the following equation subject to the condition y(0) = 1:
dy
= 3x2 ey
dx
3. Find the general solution of the following equations:
dy
6 sin x
dy
= 3,
(b)
=
dx
dx
y
4. (a) Find the general solution of the equation
(a)

dx
= t(x 2).
dt
(b) Find the particular solution which satises the condition x(0) = 5.
5. Some equations which do not appear to be separable can be made so by means of a suitable
substitution. By means of the substitution z = y/x solve the equation
y2 y
dy
= 2 + +1
dx
x
x
6. The equation
di
=E
dt
where R, L and E are constants arises in electrical circuit theory. This equation can be
solved by separation of variables. Find the solution which satises the condition i(0) = 0.
iR + L

Answers

1. y = D 2ex .
2. y = ln(x3 + e).
(b) 12 y 2 = C 6 cos x.

3 (a) y = 3x + C,
2 /2

4. (a) x = 2 + Aet

2 /2

(b) x = 2 + 3et

5. z = tan(ln Dx) so that y = x tan(ln Dx).


6. i =

16

E
(1 et/ ) where = L/R.
R

HELM (2005):
Workbook 19: Dierential Equations

3. Exact equations
Consider the dierential equation
dy
= 3x2
dx
By direct integration we nd that the general solution of this equation is
y = x3 + C
where C is, as usual, an arbitrary constant of integration.
Next, consider the dierential equation
d
(yx) = 3x2 .
dx
Again, by direct integration we nd that the general solution is
yx = x3 + C.
We now divide this equation by x to obtain
y = x2 +

C
.
x

d
(yx) = 3x2 is called an exact equation. It can eectively be solved by
The dierential equation
dx
integrating both sides.

Task

Solve the equations (a)

dy
= 5x4
dx

Your solution
(a) y =

(b)

d 3
(x y) = 5x4
dx

(b) y =

Answer
(a) y = x5 + C

(b) x3 y = x5 + C so that y = x2 +

C
.
x3

If we consider examples of this kind in a more general setting we obtain the following Key Point:

HELM (2005):
Section 19.2: First Order Dierential Equations

17

Key Point 2
The solution of the equation
d
(f (x) y) = g(x)
dx


is
f (x) y =

g(x) dx

or

1
y=
f (x)


g(x) dx

4. Solving exact equations


d
(yx) = 3x2 has solution y = x2 + C/x. In the solution,
dx
x2 is called the denite part and C/x is called the indenite part (containing the arbitrary constant
of integration). If we take the denite part of this solution, i.e. yd = x2 , then
As we have seen, the dierential equation

d 2
d 3
d
(yd x) =
(x x) =
(x ) = 3x2 .
dx
dx
dx
Hence yd = x2 is a solution of the dierential equation.
Now if we take the indenite part of the solution i.e. yi = C/x then


d C
d
d
(yi x) =
x =
(C) = 0.
dx
dx x
dx
It is always the case that the general solution of an exact equation is in two parts: a denite part
yd (x) which is a solution of the dierential equation and an indenite part yi (x) which satises a
simpler version of the dierential equation in which the right-hand side is zero.
Task

(a) Solve the equation


d
(y cos x) = cos x
dx
(b) Verify that the indenite part of the solution satises the equation
d
(y cos x) = 0.
dx
(a) Integrate both sides of the rst dierential equation:
Your solution

18

HELM (2005):
Workbook 19: Dierential Equations

Answer

y cos x =

cos x dx = sin x + C

leading to

y = tan x + C sec x

(b) Substitute for y in the indenite part (i.e. the part which contains the arbitrary constant) in the
second dierential equation:
Your solution

Answer
The indenite part of the solution is yi = C sec x and so yi cos x = C and
d
d
(yi cos x) =
(C) = 0
dx
dx

5. Recognising an exact equation


d
(yx) = 3x2 is exact, as we have seen. If we expand the left-hand side of this
dx
equation (i.e. dierentiate the product) we obtain
The equation

dy
+ y.
dx
Hence the equation
x

dy
+ y = 3x2
dx
must be exact, but it is not so obvious that it is exact as in the original form. This leads to the
following Key Point:
x

Key Point 3
The equation
f (x)

dy
+ y f  (x) = g(x)
dx

is exact. It can be re-written as


d
(y f (x)) = g(x)
dx

HELM (2005):
Section 19.2: First Order Dierential Equations


so that

y f (x) =

g(x) dx

19

Example 4
Solve the equation
x3

dy
+ 3x2 y = x
dx

Solution
Comparing this equation with the form in Key Point 3 we see that f (x) = x3 and g(x) = x. Hence
the equation can be written
d
(yx3 ) = x
dx
which has solution

3
yx = x dx = 12 x2 + C.
Therefore
y=

C
1
+ 3.
2x x

Task

Solve the equation sin x

dy
+ y cos x = cos x.
dx

Your solution

Answer
You should obtain y = 1 + Ccosec x since, here f (x) = sin x and g(x) = cos x. Then

d
(y sin x) = cos x
and
y sin x = cos x dx = sin x + C
dx
Finally y = 1 + C cosec x.

20

HELM (2005):
Workbook 19: Dierential Equations

Exercises
d
(yx2 ) = x3 .
dx
d
(yex ) = e2x given the condition y(0) = 2.
2. Solve the equation
dx
dy
3. Solve the equation e2x
+ 2e2x y = x2 .
dx
dy
+ 2xy = x3 is exact and obtain its solution.
4. Show that the equation x2
dx
dy
+ 3xy = x3 is not exact.
5. Show that the equation x2
dx
Multiply the equation by x and show that the resulting equation is exact and obtain its solution.
1. Solve the equation

Answers
C
x2
+ 2 . 2. y = 12 ex + 32 ex .
1. y =
4
x
1
C
5. y = x2 + 3 .
5
x

3. y =

1
3


x3 + C e2x .

1
C
4. y = x2 + 2 .
4
x

6. The integrating factor


The equation
dy
+ 3x y = x3
dx
is not exact. However, if we multiply it by x we obtain the equation
x2

dy
+ 3x2 y = x4 .
dx
This can be re-written as
d 3
(x y) = x4
dx
which is an exact equation with solution

3
x y = x4 dx
x3

so

1
x3 y = x5 + C
5

and hence
1
C
y = x2 + 3 .
5
x
The function by which we multiplied the given dierential equation in order to make it exact is called
an integrating factor. In this example the integrating factor is simply x.
HELM (2005):
Section 19.2: First Order Dierential Equations

21

Task

Which of the following dierential equations can be made exact by multiplying by


x2 ?
dy 2
1 dy
dy
1
(a)
(c)
+ y=4
(b) x
+ 3y = x2
2y = x
dx x
dx
x dx x
1
1 dy
+ y = 3.
(d)
x dx x2
d
(f (x) y) = g(x).
Where possible, write the exact equation in the form
dx

Your solution

Answer
dy
d 2
+ 2xy = 4x2 becomes
(x y) = 4x2 .
dx
dx
dy
d 3
+ 3x2 y = x4 becomes
(x y) = x4 .
(b) Yes. x3
dx
dx
(a) Yes. x2

d
(c) No. This equation is already exact as it can be written in the form
dx
(d) Yes. x

1
y
x


= x.

d
dy
+ y = 3x2 becomes
(xy) = 3x2 .
dx
dx

7. Finding the integrating factor for linear ODEs


The dierential equation governing the current i in a circuit with inductance L and resistance R in
series subject to a constant applied electromotive force E cos t, where E and are constants, is
di
+ Ri = E cos t
(1)
dt
This is an example of a linear dierential equation in which i is the dependent variable and t is
the independent variable. The general standard form of a linear rst order dierential equation is
normally written with y as the dependent variable and with x as the independent variable and
dy
arranged so that the coecient of
is 1. That is, it takes the form:
dx
dy
+ f (x) y = g(x)
(2)
dx
in which f (x) and g(x) are functions of x.
L

22

HELM (2005):
Workbook 19: Dierential Equations

di
+ f (t) i = g(t). The function
dt
f (t) is the coecient of the dependent variable in the dierential equation. We shall describe the
method of nding the integrating factor for (1) and then generalise it to a linear dierential equation
written in standard form.
Comparing (1) and (2), x is replaced by t and y by i to produce

Step 1 Write the dierential equation in standard form i.e. with the coecient of the derivative
equal to 1. Here we need to divide through by L:
di R
E
+ i = cos t.
dt L
L
Step 2 Integrate the coecient of the dependent variable (that is, f (t) = R/L) with respect to
the independent variable (that is, t), and ignoring the constant of integration

R
R
dt =
t.
L
L
Step 3

Take the exponential of the function obtained in Step 2.

This is the integrating factor (I.F.)


I.F. = eRt/L .
This leads to the following Key Point on integrating factors:

Key Point 4
The linear dierential equation (written in standard form):
dy
+ f (x)y = g(x)
dx


has an integrating factor

I.F. = exp


f (x)dx

Task

Find the integrating factors for the equations


di
dy
+ 2x y = xe2x (b) t
+ 2t i = te2t
(a) x
dx
dt

(c)

dy
(tan x)y = 1.
dx

Your solution

HELM (2005):
Section 19.2: First Order Dierential Equations

23

Answer
(a) Step 1 Divide by x to obtain

dy
+ 2y = e2x
dx

Step 2 The coecient of the independent variable is 2 hence

2 dx = 2x

Step 3 I.F. = e2x


(b) The only dierence from (a) is that i replaces y and t replaces x. Hence I.F. = e2t .
(c) Step 1 This is already in the standard form.


sin x
Step 2
tan x dx =
dx = ln cos x.
cos x
Step 3 I.F. = eln cos x = cos x

8. Solving equations via the integrating factor


Having found the integrating factor for a linear equation we now proceed to solve the equation.
Returning to the dierential equation, written in standard form:
di R
E
+ i = cos t
dt L
L
for which the integrating factor is
eRt/L
we multiply the equation by the integrating factor to obtain
di R Rt/L
E Rt/L
i=
cos t
+
e
e
dt L
L
At this stage the left-hand side of this equation can always be simplied as follows:
eRt/L

E Rt/L
d Rt/L
(e
e
i) =
cos t.
dt
L
Now this is in the form of an exact dierential equation and so we can integrate both sides to obtain
the solution:

E
Rt/L
e
i=
eRt/L cos t dt.
L
All that remains is to complete the integral on the right-hand side. Using the method of integration
by parts we nd

L
[L sin t + R cos t] eRt/L
eRt/L cos t dt = 2 2
L + R2
Hence
eRt/L i =

E
[L sin t + R cos t] eRt/L + C.
+ R2

L2 2

Finally
i=
24

E
[L sin t + R cos t] + C eRt/L .
+ R2

L2 2

HELM (2005):
Workbook 19: Dierential Equations

is the solution to the original dierential equation (1). Note that, as we should expect for the solution
to a rst order dierential equation, it contains a single arbitrary constant C.

Task

Using the integrating factors found earlier in the Task on pages 22-23, nd the
general solutions to the dierential equations
dy
di
dy
+ 2x2 y = x2 e2x (b) t2
+ 2t2 i = t2 e2t (c)
(tan x)y = 1.
(a) x2
dx
dt
dx
Your solution

Answer
(a) The standard form is
e2x
i.e.
leading to

dy
+ 2y = e2x for which the integrating factor is e2x .
dx

dy
+ 2e2x y = 1
dx
d
so that
(e2x y) = 1
dx
y = (x + C)e2x

e2x y = x + C

(b) The general solution is i = (t+C)e2t as this problem is the same as (a) with dierent variables.
(c) The equation is in standard form and the integrating factor is cos x.

d
then
(cos x y) = cos x
so that
cos x y = cos x dx = sin x + C
dx
giving

y = tan x + C sec x

HELM (2005):
Section 19.2: First Order Dierential Equations

25

Engineering Example 1
An RC circuit with a single frequency input
Introduction
The components in RC circuits containing resistance, inductance and capacitance can be chosen
so that the circuit lters out certain frequencies from the input. A particular kind of lter circuit
consists of a resistor and capacitor in series and acts as a high cut (or low pass) lter. The high cut
frequency is dened to be
the frequency at which the magnitude of the voltage across the capacitor
(the output voltage) is 1/ 2 of the magnitude of the input voltage.
Problem in words
Calculate the high cut frequency for an RC circuit is subjected to a single frequency input of angular
frequency and magnitude vi .
(a) Find the steady state solution of the equation
q
dq
+ = vi ejt
dt C
and hence nd the magnitude of
R

(i) the voltage across the capacitor vc =

q
C

(ii) the voltage across the resistor vR = R


(b) Using the impedance method of

dq
dt

12.6 conrm your results to part (a) by calculating

(i) the voltage across the capacitor vc


(ii) the voltage across the resistor vR in response to a single frequency of angular frequency and
magnitude vi .
(c) For the case where R = 1 k and C = 1 F, nd the ratio

|vc |
|vi |

10

102

103

104

105

|vc |
and complete the table below
|vi |
106

(d) Explain why the table results show that a RC circuit acts as a high-cut lter and nd the value
|vc |
1
of the high-cut frequency, dened as fhc = hc /2, such that
= .
|vi |
2

26

HELM (2005):
Workbook 19: Dierential Equations

Mathematical statement of the problem


q
dq
+ = vi ejt .
dt C
q
This will give us the steady state solution for the charge q. Using this we can nd vc =
and
C
dq
vR = R . These should give the same result as the values calculated by considering the impedances
dt
|vc |
in the circuit. Finally we can calculate
and ll in the table of values as required and nd the
|vi |
1
|vc |
= and fhc = hc /2.
high-cut frequency from
|vi |
2
We need to nd a particular solution to the dierential equation R

Mathematical solution
(a) To nd a particular solution, we try a function of the form q = c0 ejt which means that
dq
= jc0 ejt .
dt
dq
q
Substituting into R
+ = vi ejt we get
dt C
c0 ejt
c0
jt
Rjc0 e +
= vi ejt Rjc0 +
= vi
C
C
vi
Cvi
Cvi
c0 =
q=
ejt
1 =
RCj + 1
RCj + 1
Rj + C
Thus
(i) vc =

vi
q
=
ejt
C
RCj + 1

and

(ii) vR =

RCvi j jt
dq
=
e
dt
RCj + 1

(b) We use the impedance to determine the voltage across each of the elements. The applied voltage
is a single frequency of angular frequency and magnitude vi such that V = vi ejt .
For an RC circuit, the impedance of the circuit is Z = ZR + Zc where ZR is the impedance of the
j
resistor R and Zc is the impedance of the capacitor Zc =
.
C
j
Therefore Z = R
.
C
The current
found using v = Zi giving
 can be 
vi ejt
j
vi ejt = R
i i=
j
C
R C
We can now use vc = zc i and vR = zR i giving
(i) vc =

q
vi
j
vi
jt
=
=

ejt
j e
C
C R C
RCj + 1

(ii) vR =

Rvi
RCvi j jt
jt
=
e
j e
RCj + 1
R C

which conrms the result in part (a) found by solving the dierential equation.
(c) When R = 1000 and C = 106 F
vi
vi
vc =
ejt = 3
ejt
RCj + 1
10 j + 1
HELM (2005):
Section 19.2: First Order Dierential Equations

27





 jt


1
1
|vc | 
1

=

=  3
|e | =  3
So


|vi |
10 j + 1
10 j + 1
106 2 + 1
 
 vc 
Table 1: Values of   for a range of values of
vi

|vc |
|vi |

10

102

103

104

105

106

0.99995 0.995 0.707 0.00995 0.0099995 0.001

(d) Table 1 shows that a RC circuit can be used as a high-cut lter because for low values of ,
is approximately 1 and for high values of ,
frequency values.
1
|vc |
1
1
=
= when
6
2
|vi |
10 + 1
2
2

|vc |
|vi |

|vc |
is approximately 0. So the circuit will lter out high
|vi |

106 2 + 1 = 2 106 2 = 1 2 = 106

As we are considering to be a positive frequency, = 1000.


So fhc =

hc
1000
=
159 Hz.
2
2

Interpretation
We have shown that for an RC circuit nding the steady state solution of the dierential equation
|vR |
|vc |
and
as found by working
with a single frequency input voltage yields the same result for
|vi |
|vi |
with the complex impedances for the circuit.
An RC circuit can be used as a high-cut lter and in the case where R = 1 k, C = 1 F we found
the high-cut frequency to be at approximately 159 Hz.
This means that the circuit will pass frequencies less than this value and remove frequencies greater
than this value.

28

HELM (2005):
Workbook 19: Dierential Equations

Exercises
dy
+ x y = 1.
dx
dy
Find the solution of the equation x y = x subject to the condition y(1) = 2.
dx
dy
+ (tan t) y = cos t.
Find the general solution of the equation
dt
dy
Solve the equation
+ (cot t) y = sin t.
dt
The temperature (measured in degrees) of a body immersed in an atmosphere of varying
d
temperature is given by
+ 0.1 = 5 2.5t. Find the temperature at time t if = 60
dt
when t = 0.

1. Solve the equation x2


2.
3.
4.
5.

6. In an LR circuit with applied voltage E = 10(1 e0.1t ) the current i is given by


di
+ Ri = 10(1 e0.1t ).
dt
If the initial current is i0 nd i subsequently.
L

Answers
1
C
1. y = ln x +
x
x
2. y = x ln x + 2x
3. y = (t + C) cos t


4. y = 12 t 14 sin 2t + C cosec t
5. = 300 25t 240e0.1t




10
10L
100
0.1t
6. i =
+ i0 +

e
eRt/L
R
10R L
R(10R L)

HELM (2005):
Section 19.2: First Order Dierential Equations

29

You might also like