Chapter 2
First Order Ordinary D.E.
1
Introduction
In this chapter we will look at solving first order differential
equations. The most general first order differential equation
can be written as,
dy f (x, y) (1)
dx
As we will see in this chapter there is no general formula for
the solution to (1). What we will do instead is look at several
special cases and see how to solve those. We will also look at
some of the theory behind first order differential equations as
well as some applications of first order differential equations.
Below is a list of the topics discussed in this chapter.
Separable Equations: Identifying and solving separable first
order differential equations. We’ll also start looking at
finding the interval of validity from the solution to a
differential equation.
2
Substitutions: there are many types of differential equations
using substitution methods, such as homogenous, non
homogenous, same slope equations.
Exact Equations: Identifying and solving exact differential
equations. We’ll do a few more intervals of validity
problems here as well.
Linear Equations: Identifying and solving linear first order
differential equations.
Bernoulli Differential Equations : In this section we’ll see
how to solve the Bernoulli Differential Equation.
This section will also introduce the idea of using a
substitution to help us solve differential equations and now
we will discuss each method used in solving first order
ordinary differential equations.
3
Separable Equations
The differential equation of the form dy f (x, y) is called
dx
separable, if
f(x,y) = h(x) g(y) (2)
That is, dy h(x) g(y) . In order to solve it, perform the
dx
following steps:
dy h(x) dx
Rewrite the equation dy h(x) g(y) as
dx g(y)
dy
Integrate h(x) dx to obtain G(y)= H(x) + C
g(y)
If you are given an IVP, use the initial condition to find
the particular solution.
dy y2 1
Example 1 : Find the particular solution of ,
dx x
y(1) = 2
Solution: Rewrite the equation as dy dx , then using the
y 2 1 x
techniques of integration of rational functions with the aid of
4
dy 1 ln y 1 which implies
the partial fraction , we get y 2 1 2 y 1
the solutions to the given differential equation is
1 ln y 1 ln x C . We need to find the constant C, so that
2 y 1
if we plug in the condition y=2 when x=1, we get
C = 1 ln(1) , note that this solution is given in an implicit
2 3
form. You may be asked to rewrite it in an explicit one. For
example, in this case, we have y 3 x 2 .
2
3 x
Example 2 : Find solution to dy 1 12
dt y
2
Solution: Rewrite the equation as y2 dy dt , then integrate
y 1
such that:
y2dy (y2 11)dy (1 1 )dy dt C
y2 1 y2 1 y2 1
which implies the solutions to the given differential equation
is y – tan-1 (y) = t + C
5
Example 3 : Solve the initial value problem
dy 1 t 2 y2 t 2 y2 , y(0) = 1
dt
Solution: Rewrite the equation as dy (t 2 1)dt , then
y2 1
dy
y2 1 (t
integrate such that 2 1)dt C which implies the
3
solutions to the given D.E. is tan-1y = t +t + C, but for t
3
= 0, y = 1, C = tan-11 = , thus tan-1y = t + t + .
3
4 3 4
Homogeneous Equations
The differential equation dy f (x, y) is homogeneous if the
dx
function f(x,y) is homogeneous such that :
f (tx,ty) = f (x,y) for any number t. (3)
6
Example 4: Check that the functions are homogeneous.
f (x, y) ln( 33x y 2 ),
2
g(x, y) ( 2xy 2 )
x 4xy x y
Solution: f (tx,ty) ln( 3(tx) 2 ty
) f (x, y) ,
(tx)3 4tx(ty)2
tx(ty)
g(tx,ty) ( ) g(x, y)
(tx)2 (ty)2
In order to solve this type of equation we make use of a
substitution v = y . Let us summarize the steps to follow:
x
Recognize that your equation is an homogeneous equation;
that is, you need to check that f(tx,ty)= f(x,y), meaning that
f(tx,ty) is independent of the variable t; then write out the
substitution v =y/x; hence put y = vx and dy = vdx +xdv
in the equation.
Through easy differentiation, find the new equation
satisfied by the new function v.
Solve the new equation (which is always separable) to find
v.
Go to the old function y through the substitution y= vx.
7
If you have an I.V.P., use the initial condition to find the
particular solution.
Example 5: Find solution to dy 2x 5y
dx 2x y
Solution: Follow these steps:
Since dy 2x 5y is homogeneous;
dx 2x y
Put y = vx , hence dy= v dx + x dv, therefore
vdx +xdv 2x 5vx 2 5v ,
dx 2x vx 2 v
Hence
dx (2 v)dv 0
x v2 3v 2
This is a separable equation , we can solve it using
partial fraction, so that
dx ( 4 3 )dv C
x v 2 v 1
Integrate, we get its solution such that
lnx = 4ln(v-2) - 3 ln(v-1) + C, but v = y/x , therefore
2lnx = 4 ln(y-2x) - 3 ln(y-x) + C.
8
Example 6: Find solution to dy 2xy 2
dx x y
Solution: Since xy is homogeneous, put y = vx, and
x 2 y2
dy = vdx + xdv in the above equation, we get
vdx +xdv x(vx) v , it is a separable equation
dx x 2 (vx)2 1 v2
dx (1 v 2 )dv
such that: 0 , integrate this equation, such
x v3
2
that ln x- 1 2 +ln v= C, but y = vx , therefore ln y - x 2 = C.
2v 2y
Same Slope Equations
The differential equation of the form dy f (x, y) is called
dx
same slope equation if
f(x,y) = ax by c and a b L (4)
px qy s P q
L(px + qy) = ax + by , s, c are constants of the straight lines.
In order to solve this type of equation we make use of a
substitution u= px + qy, therefore du = pdx + qdy, and
9
ax + by = Lu, hence the differential equation will be in the
du pdx Lu c
form , it can be expressed in the
qdx u s
(u s)du dx which is separable equation.
form
p(u s) q(Lu c)
Example 7 : Find solution to dy 2x 3y 7
dx 4x 6y 28
Solution:
Since 2x 3y 7 , 4x 6y 28 are two first degree
expressions with the same slope , therefore dy 2x 3y 7
dx 4x 6y 28
is called same slope equation. To solve this differential
equation, we have to follow these steps:
Put u = 2x 3y du = 2dx+3dy , so dy 1 (du 2dx)
3
Substitute in the differential equation, we get
(du 2dx) u 7 ,
3dx 2u 28
10
Therefore
(2u 28)du 2 ( u 14 )du
dx = ,
(7u 77) 7 u 11
Thus
dx = 2 ( u 14 )du 2 ( u 11 3)du 2 (1 3 )du
7 u 11 7 u 11 7 u 11
Integrate the above equation such that
2 3
dx 7 (1 u 11)du C
Therefore
x 2 [u 3ln(u 11)] C , but u = 2x 3y
7
hence the solution of differential equation is
x 2 [2x 3y 3ln(2x 3y 11)] C
7
11
Non Homogeneous Equations
The differential equation of the form dy f (x, y) is called
dx
non homogeneous equation if f(x,y) = ax by c , where
px qy s
ax + by + c = 0, px + qy + s=0 are not parallel and not
homogeneous. To solve the differential equation , we have to
follow the following steps:
Solve the two lines ax + by + c = 0, px + qy + s = 0 to
bs qc , pc as )
get the point of intersection which is ( ,
aq bp aq bp
bs qc pc as
Put x = X + , y = Y+ , and dx=dX,
aq bp aq bp
dy=dY, so the differential equation is transformed into
dY aX bY which become a homogeneous equation so
dX pX qY
that we can solve it by substitution Y = vX, then dy
= vdX + Xdv, then the differential equation will be separable
equation such that:
vdX+Xdv aX bvX a bv ,
dX pX qvX p qv
12
Integrate the differential equation dX (p2 qv)dv
X qv bv a
bs qc pc as
Substitute X = x - , Y=y- , and
aq bp aq bp
y(aq bp)-(pc as)
v Y .
X x(aq bp) (bs qc)
Example 8 : Find solution to dy x y 3
dx x y 1
Solution: Since dy x y 3 is non homogeneous equation.
dx x y 1
To solve this differential equation, we have to follow these
steps
We have to get the point of intersection between
x + y + 3 = 0, x – y + 1= 0 which is (-2,-1),
Put x = X-2, y=Y-1, dx = dX, dy = dY in the above
differential equation, then dY X Y , so it is a
dX X Y
homogeneous equation,
13
Put Y = vX, and dY = vdX + Xdv, therefore
vdX+Xdv X vX 1 v
dX X vX 1 v
Integrate dX (1 v)dv , then put X=x+2, v Y y 1 ,
X 1 v2 X x2
hence the solution of the differential equation is
y 1
) - 1 ln( (y 1) (x2 2) ) +C
2 2
Ln(x+2) = tan-1(
x2 2 (x 2)
Exact and non exact Equations
All the techniques we have reviewed so far were not of a
general nature since in each case the equations themselves
were of a special form. So, we may ask, what to do for the
general equation dy f (x, y)
dx
Let us first rewrite the equation into M(x,y)dx + N(x,y)dy = 0
This equation will be called exact if
M N and non exact otherwise (5)
y x
The condition of exactness insures the existence of a function
f(x,y) such that :
14
f M(x , y), f N(x , y) (6)
x y
When the equation is exact, we solve it using the following
steps:
Check that the equation is indeed exact;
Write down the system f M(x , y), f N(x , y)
x y
Integrate either the first equation with respect of the
variable x or the second with respect of the variable y. The
choice of the equation to be integrated will depend on how
easy the calculations are. Let us assume that the first
equation was chosen, then we get
f(x ,y) M(x ,y)dx (y)
The function (y) should be there, since in our integration,
we assumed that the variable y is constant.
Use the second equation of the system to find the
derivative of (y) . Indeed, we have
15
f ( M(x , y)dx) (y) N(x ,y)
y y
which implies
(y) N(x , y) ( M(x , y)dx)
y
Note that is a function of y only. Therefore, in the
expression giving (y) , the variable x should disappear.
Otherwise something went wrong!
Integrate to find (y) ; then write down the function f(x,y)
All the solutions are given by the implicit equation
f(x,y)= C
If you are given an I.V.P., plg in the initial condition to
find the constant C.
You may ask, what do we do if the equation is not exact? In
this case, one can try to find an integrating factor which
makes the given differential equation exact.
16
Integrating Factor Technique
Assume that the equation M(x,y)dx + N(x,y)dy = 0 is not
exact, that is M N . In this case we look for a function
y x
u(x,y) which makes the new equation u(x,y) M(x,y)dx +
u(x,y) N(x,y)dy = 0, an exact one. The function u(x,y) (if it
exists) is called the integrating factor. Note that u(x,y)
satisfies the following equation:
M u u M N u u N
y y x x
This is not an ordinary differential equation since it involves
more than one variable. This is what's called a partial
differential equation. These types of equations are very
difficult to solve, which explains why the determination of
the integrating factor is extremely difficult except for the
following two special cases:
Case 1: There exists an integrating factor u(x) function of x
only. This happens if the expression
17
M N
y x (7)
N
is a function of x only, that is, the variable y disappears from
the expression. In this case, the function u is given by
u(x) exp( My N x dx)
N
Case 2: There exists an integrating factor u(y) function of y
only. This happens if the expression
N M
x y (8)
M
is a function of y only, that is, the variable x disappears from
the expression. In this case, the function u is given by
u(x) exp( N x My dy)
M
Once the integrating factor is found, multiply the old
equation by u to get a new one which is exact. Then you are
left to use the previous technique to solve the new equation.
18
Advice: if you are not pressured by time, check that the new
equation is in fact exact!
Let us summarize the above technique. Consider the equation
M(x,y)dx + N(x,y)dy = 0
If your equation is not given in this form you should rewrite
it first.
Step 1: Check for exactness, by computing M and N , then
y x
compares them.
Step 2: Assume that the equation is not exact, then evaluate
M N
y x
N
If this expression is a function of x only, then go to step 3.
Otherwise, evaluate
N M
x y
M
19
If this expression is a function of y only, then go to step 3.
Otherwise, you can not solve the equation using the
technique developed above!
Step 3: Find the integrating factor. We have two cases:
a) If the expression My N x is a function of x only. Then an
N
integrating factor is given by u(x) exp( My N x dx) ,
N
b)If the expression N x My is a function of y only, then an
M
integrating factor is given by u(x) exp( N x My dy)
M
Step 4: Multiply the old equation by u, and, if you can, check
that you have a new equation which is exact.
Step 5: Solve the new equation using the steps described in
the previous section.
dy 2x 6xy2
Example 9 : Find solution to
dx 3y2 6x 2 y
20
Solution:
Since the equation is( 2x 6xy2 )dx+( 3y2 6x 2 y )dy=0,
M(x,y)= 2x 6xy2 , N(x,y) = 3y2 6x 2 y & M 12xy N ,
y x
then the equation is exact, but f M(x , y) = 2x 6xy2 , thus
x
f(x,y) = x2 + 3 x2 y2 + (y) , f 6x 2 y (y) 3y2 6x 2 y ,
y
from which we conclude (y) 3y2 , so (y) = y3, thus the
solution of the D.E. is f(x,y) = x2 + 3 x2 y2 + y3.
The following example illustrates the use of the integrating
factor technique:
dy 3xy y2
Example 10 : Find the solution to
dx x 2 xy
Solution:
1) Rewrite the equation to get ( 3xy y2 )dx+( x 2 xy )dy= 0,
hence M(x,y) = 3xy y2 and N(x,y) = x 2 xy .
21
(2) We have M 3x 2y , N 2x y , which clearly
y x
implies that the equation is not exact.
(3) Let us find an integrating factor. We have My N x 1 .
N x
Therefore, an integrating factor u(x) exists and is given by
u(x) exp( My N x dx) exp( 1 dx) exp(ln x) x
N x
(4) The new equation is ( 3x 2 y xy2 )dx + ( x 3 x 2 y ) dy = 0,
which is exact. (Check it!)
First Order Linear Equation
A first order linear differential equation has the following
form:
dy p(x)y q(x) (9)
dx
The general solution is given by y(x)
u(x) q(x) dx C
,
u(x)
where u(x) exp ( p(x)dx) is called the integrating factor. If
22
an initial condition is given, use it to find the constant C.
Here are some practical steps to follow:
1) If the D.E. is given as a(x) dy b(x)y c(x) , rewrite it in
dx
b(x) , q(x) c(x)
the form dy p(x)y q(x) , i.e. p(x) ,
dx a(x) a(x)
2) Find the integrating factor u(x) exp ( p(x)dx) ,
3) Evaluate the integral u(x) q(x) dx ,
4) Write the general solution y(x) u(x) q(x) dx C
,
u(x)
5) If you are given an I.V.P., use the initial condition to find
the constant C.
Example 11 : Find the solution to y ( tanx )y = cos2 x
Solution: Let us use the steps:
Step 1: There is no need for rewriting the differential
equation. We have p(x) tanx, q(x) cos2 x
Step 2: The integrating factor is
23
u(x) exp ( tanx dx) exp(ln cosx) = 1
cos x
Step 3: Evaluate u(x) q(x) dx such that:
1 (cos2 x) dx cos x dx sin x
u(x) q(x) dx cos x
Step 4: The general solution is given by
y(x)
u(x) q(x) dx C sin x C
u(x) sec x
Step 5: In order to find the particular solution to the given
I.V.P., we use the initial condition to find C. Indeed, we have
y(0) = C = 2, therefore the solution is
y(x) = (sin x + 2) cos x.
Bernoulli Equation
A differential equation of Bernoulli type is written as
dy p(x)y q(x) yn (10)
dx
This type of equation is solved via a substitution. Indeed, let
z y1n , then easy calculations give z` = (1-n) y –n
y` which
implies
24
dz (1 n)p(x)z (1 n)q(x) (11)
dx
This is a linear equation satisfied by the new variable z. Once
it is solved, you will obtain the function y z1/1n . Note that
if n > 1, then we have to add the solution y = 0 to the
solutions found via the technique described above. Let us
summarize the steps to follow:
Recognize that the differential equation is a Bernoulli
equation. Then find the parameter n from the equation;
Write out the substitution z y1n ;
Through easy differentiation, find the new equation
satisfied by the new variable z. You may want to remember
the form of the new equation:
dz (1 n)p(x)z (1 n)q(x)
dx
Solve the new linear equation to find z;
Go back to the old function y through the substitution
y z1/1n ;
If n > 1, add the solution y = 0 to the ones you obtained
above;
25
If you have an I.V.P., use the initial condition to find the
particular solution.
Example 12 : Find the solution to dy y y3
dx
Solution: Perform the following steps:
We have a Bernoulli equation with n = 3;
Let z y13 y2 ; dz 2y3 y
dx
The new equation satisfied by z is dz 2z 2 ,
dx
P(x) = 2, q(x) = -2;
This is a linear equation with integrating factor
u(x) exp ( p(x)dx) exp ( 2dx) e2x ,
u(x) q(x) dx 2 e dx e2x , the general
also we have 2x
solution is given by
z(x)
u(x) q(x) dx C e2x C
2x
1 C e-2x ,
u(x) e
but y z1/2 which gives y (1 C e-2x )1/ 2
26
Problems
Find the solution to
1) dy 2t 2 y 2 2 , y(0) = 0.4
dt 1 t 1 t
2) (cos2 t sint) dy (cos3 t) y +1, y( ) 0
dt 4
3) 2t dy y t 1, y(2) = 4, t > 0
dt
4) x dy + y = - x
dx
5) dy = 6xy2 , y(1) = 1/25
dx
6) y 3x 4x 4 , y(1) = 3
2
2y 4
xy 3
7) y , y(0) = -1
1 x 2
8) dy e y-t (sec y) (1 t 2 ) , y(0) = 0
dt
27
9) (2y x 2 1) dy 9x 2 2xy 0 , y(0) = -3
dx
10) 2(3 yx 2 ) dy 4 2xy2 , y(-1) = 8
dx
11)
2ty 2t (2 ln(t 2 1))y 0 , y(5) = 0
t 2 1
12) 3y3e3xy 1 (2y 3xy2 )e3xy y 0 , y(0) = 1
13) y 4 y x3y2 , y(2) = -1
x
14) y 5y e-2x y2 , y(0) = 2
15) 6y 2y xy4 , y(0) = -2
16) y y y 0 , y(1) = 0
x
17) dv 9.8 0.196v
dt
18) cos(x) dy sin(x ) y 2cos3 (x) sin(x) - 1 , y( ) 3 2 ,
dx 4
0≤ x <
2
28
19) ty 2y t 2 t 1 , y(1) = ½
20) ty 2y t 5 sin(2t) t 3 4t 4 , y( ) = (3/2) 4
21) xyy 4x 2 y2 0 , y(2) = -7
##########################################################
29