You are on page 1of 12



Separation of Variables 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
Block you will learn how to decide whether the method is appropriate, and how to apply it in
such cases.


understand what is meant by a dierential
equation; (Block 19.1)

be familiar with the terminology associated


Prerequisites with dierential equations: order,
Before starting this Block you should . . . dependent variable and independent
variable; (Block 19.1)

be able to integrate; (Blocks 14.1-14.8)


Learning Outcomes Learning Style


After completing this Block you should be able To achieve what is expected of you . . .
to . . .
explain what is meant by separating the
variables of a rst-order dierential equa- allocate sucient study time
tion
determine whether a rst-order dieren-
briey revise the prerequisite material
tial equation is separable
solve a variety of equations using this attempt every guided exercise and most
technique of the other exercises
1. What does it mean to say that we separate the variables ?
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
Now do this exercise
Which of the following dierential equations do you think can be written in the form
dy
= f (x)g(y) ?
dx
If possible, rewrite each equation in this form.
dy x2 dy dy
a) = 2, b) = 4x2 + 2y 2 , c) y + 3x = 7
dx y dx dx
Answer
The variables involved need not be x and y. Other equations of this class are
 
dz d dv 1
= te z
= 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 = f (x)dx
g(y)
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 section.

Engineering Mathematics: Open Learning Unit Level 1 2


19.2: Dierential Equations
Key Point
The solution of the equation
dy
= f (x)g(y)
dx
is found from  
1
dy = f (x)dx
g(y)

2. Applying the method of separation of variables


The method is illustrated in the following example.

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

(Note that this is sometimes written in the form ydy 3x2 dx = 0.)

Solution
The equation already has the form
dy
= f (x)g(y)
dx
where
f (x) = 3x2 and g(y) = 1/y.
Dividing both sides by g(y) we nd
dy
y = 3x2
dx
Integrating both sides with respect to x gives
   
dy
y dx = 3x2 dx that is y dy = 3x2 dx
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 we nd
1 2
2
y = 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 + D where D = 2c

3 Engineering Mathematics: Open Learning Unit Level 1


19.2: Dierential Equations
Try each part of this exercise
Use the method of separation of variables to solve the dierential equation
dy cos x
= (alternatively : sin 2y dy cos x dx = 0)
dx sin 2y
dy
Part (a) Separate the variables so that terms involving y and dx
appear on the left, and terms
involving just x appear on the right:
Answer

Part (b) Then integrate both sides with respect to x:


Answer

Part (c) Now integrate both sides:


Answer

Part (d) Finally, rearrange to obtain an expression for y in terms of x:


Answer

More exercises for you to try


1. Solve the equation
dy ex
= .
dx y
2. Solve the equation
dy
= 3x2 ey
dx
subject to the condition y(0) = 1.
3. Find the general solution of the following equations:
dy dy 6 sin x
a) = 3, b) =
dx dx y
4. Find the general solution of the equation
dx
= t(x 2).
dt
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

dy y2 y
= 2 + +1
dx x x
6. The equation
di
iR + L =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.
Answer

Engineering Mathematics: Open Learning Unit Level 1 4


19.2: Dierential Equations
3. Computer Exercise or Activity
For this exercise it will be necessary for you to access the
computer package DERIVE.
To solve a dierential equation using DERIVE it is neces-
sary to load what is called a Utility File named ode1. To
do this is simple. Proceed as follows: In DERIVE, choose
File:Load:Math and select the le (double click) on the ode1
icon. This will load a number of commands which enable you
to solve rst-order dierential equations. You can use the Help
facility to learn more about these if you wish.

Of particular relevance here is the command

Separable(p,q,x,y,x0,y0)

dy
which solves a separable equation of the form = p(x)q(y) with condition y(x0) = y0,
dx
and the related command Separable Gen(p,q,x,y,c) which solves separable rst-order dierential
equations without initial conditions but gives a solution which includes an arbitrary constant c.
For example, to solve
dy
= x2 y 3 y(0) = 5
dx
proceed as follows:- Choose Author:Expression,

Separable(x 2, y 3, x, y, 0, 5)
and select Simplify. DERIVE responds with

1 1 x3
=
50 2 y 2 3
which is an implicit form of solution.
1. Use DERIVE to solve the initial value problem
dy
= 3t2 ey
dt
subject to y(0) = c.
Sketch several solution curves, y(t), for various initial values, c.
2. Use DERIVE to solve the initial value problem

dy y2
=
dt t
subject to y(1) = c.
Sketch several solution curves, y(t), for various initial values of c (say c = 1, 2, 3)
3. Use the Help command to nd out about the more general commands Dsolve1(p, q, x, y, x0, y0)
and Dsolve1 Gen(p, q, x, y, c) used for solving very general rst-order ordinary dierential equa-
tions.

5 Engineering Mathematics: Open Learning Unit Level 1


19.2: Dierential Equations
End of Block 19.2

Engineering Mathematics: Open Learning Unit Level 1 6


19.2: Dierential Equations
 
dy 1 dy
a) =x 2
, b) cannot be written in the stated form, c) Write y = 7 3x so that
dx y2 dx
dy 1
= (7 3x) which is in the required form.
dx y

Back to the theory

7 Engineering Mathematics: Open Learning Unit Level 1


19.2: Dierential Equations
You should have obtained
dy
sin 2y = cos x
dx

Back to the theory

Engineering Mathematics: Open Learning Unit Level 1 8


19.2: Dierential Equations
 
dy
sin 2y dx = cos x dx
dx
that is  
sin 2y dy = cos x dx

Back to the theory

9 Engineering Mathematics: Open Learning Unit Level 1


19.2: Dierential Equations
You should have obtained
12 cos 2y = sin x + c

Back to the theory

Engineering Mathematics: Open Learning Unit Level 1 10


19.2: Dierential Equations
y = 12 cos1 (D 2 sin x) where D = 2c

Back to the theory

11 Engineering Mathematics: Open Learning Unit Level 1


19.2: Dierential Equations

1. y = D 2ex . 2. y = ln(x3 + e). 3a) y = 3x + C, b) 12 y 2 = C 6 cos x. 4.
(1 et/ )
2 2
x = 2 + Aet /2 , x = 2 + 3et /2 . 5. z = tan(ln Dx) so that y = x tan(ln Dx). 6. i = E
R
where = L/R.

Back to the theory

Engineering Mathematics: Open Learning Unit Level 1 12


19.2: Dierential Equations

You might also like