First Order ODEs
First Order ODEs
1 Basic Concepts
y ′ = cos x
y ′′ + 9y = 0
( )
x2 y ′′′ y ′ + 2ex y ′′ = x2 + 2 y 2
• Order: is the order of the highest derivative of the unknown function in the ODE. For
example, the above ODEs are of the first, second, and third orders, respectively.
• Solution: is a function y = h(x) making the ODE an identity on some open interval
a < x < b. For example, y = c/x is a solution of xy ′ = −y, y = sin x + c is a solution of
y ′ = cos x, and y = ce3t is a solution of y ′ = 3y, for every particular value of the arbitrary
constant c. In fact, for all possible values of c each expression above represents a family
of solutions of the corresponding ODE.
• Solution Curve: is the graph of y = h(x), the solution of the ODE.
1
• General Solution: a solution containing an arbitrary constant, c, specifying a family of
infinitely many solutions.
• Particular Solution: The solution obtained for a specific value of the arbitrary constant
c.
2 Separable ODEs
g(y)y ′ = f (x)
and integrating both sides with respect to x, whence, noting that y ′ dx = dy to obtain
ˆ ˆ
g(y) dy = f (x) dx + c (1)
giving the solution of the ODE implicitly or explicitly. An ODE with such a property is called
separable and the method of solution is called the method of separating variables.
dy
= dx.
1 + y2
By integration,
Certain nonseparable ODEs can be made separable by transformations that introduce for y
a new unknown function. For example, an ODE of the form
(y)
y′ = f (2)
x
2
can be made separable by adopting the transformation u = y/x, noting that y ′ = u′ x + u
(How?), substituting back in (2), and simplifying to yield:
du dx
= . (3)
f (u) − u x
Solution
To obtain the given ODE into the form of (2), divide it by 2xy, hence
y 2 − x2 y x (y)
y′ = = − =f .
2xy 2x 2y x
2u du dx
2
=−
1+u x
( ) 1
ln 1 + u2 = −ln|x| + k = ln +k
x
( c )2 c2
x− + y2 =
2 4
representing a family of circles passing through the origin with centers on the x-axis.
3
3 Exact ODEs
is called exact if its left-hand side is an exact differential ; that is, if there is some function
u(x, y) such that its total differential
∂u ∂u
du = dx + dy = M (x, y) dx + N (x, y) dy
∂x ∂y
with
∂u ∂u
= M, = N. (5)
∂x ∂y
du = 0
giving, by integration,
u(x, y) = c (6)
If M and N are continuous with continuous first partial derivatives then by partial differentia-
tion of (5),
∂M ∂ 2u
=
∂y ∂y∂x
∂N ∂2u
=
∂x ∂x∂y
∂M ∂N
= (7)
∂y ∂x
4
If (4) is exact, u(x, y) can be obtained by integrating either one of equations (5), giving
ˆ
u= M dx + k(y) (8)
ˆ
u= N dy + l(x) (9)
where l(x) is unknown. k(y) (or l(x)) can be determined by obtaining ∂u/∂y (∂u/∂x) from (8)
(or (9)) and equating it to N (or M ) to get dk/dy (or dl/dx), and integrating back to get k (or
l).
Solution
M = cos(x + y)
N = 3y 2 + 2y + cos(x + y)
Thus
∂M
= −sin(x + y)
∂y
∂N
= −sin(x + y)
∂x
ˆ ˆ
u= M dx + k(y) = u = cos(x + y) dx + k(y) = sin(x + y) + k(y)
Then,
∂u dk
= cos(x + y) + = N = 3y 2 + 2y + cos(x + y)
∂y dy
5
u(x, y) = sin(x + y) + y 3 + y 2 = c
is the general solution of the given ODE in implicit form. (Try solving the other way around
starting with (9) above.)
M = cos y sinh x + 1
N = −sin y cosh x
Hence,
∂M
= −sin y sinh x
∂y
∂N
= −sin y sinh x
∂x
ˆ
u=− sin y cosh x dy + l(x) = cos y cosh x + l(x)
from which
∂u dl
= cos y sinh x + = M = cos y sinh x + 1
∂x dx
From the initial condition, cos 2 cosh 1 + 1 = 0.358 = c, leading to the particular solution
6
4 Integrating Factors
Some first-order ODEs which are not exact can be made exact by introducing integrating
factors. If (4) is nonexact, it might be possible to reduce it to an exact form by multiplying it
by a function F (x), such that
∂F M ∂F N
= ⇒ F My = F ′ N + F Nx
∂y ∂x
( )
1 dF 1 ∂M ∂N
= R, where R= −
F dx N ∂y ∂x
Hence,
ˆ
F (x) = exp R(x) dx (10)
∂GM ∂GN
= ⇒ GNx = GM + GMy
∂y ∂x
( )
1 dG 1 ∂N ∂M
= S, where S= −
G dy M ∂x ∂y
Hence,
ˆ
G(y) = exp S(y) dy (11)
F and G above, if any, are referred to as integrating factors. Once the given ODE is reduced
to an exact form it can be solved by the former method.
( )
ex+y + yey dx + (xey − 1) dy = 0, y(0) = −1.
Solution.
7
Integrating Factors. Trying
( )
1 ∂M ∂N 1 ( x+y ) (ex + y)ey
R= − = e + e y
+ ye y
− ey
=
N ∂y ∂x xey − 1 xey − 1
then it follows that F may not be found as a function of x only and it may not serve as an
integrating factor. Trying
( )
1 ∂N ∂M 1 ( y ) ex+y + yey
S= − = e − ex+y
− ey
− ye y
= − = −1
M ∂x ∂y ex+y + yey ex+y + yey
Hence,
ˆ ´
G(y) = exp S(y) dy = e− dy
= e−y
General Solution. Now, with M = e−y (ex+y + yey ) = ex +y and N = e−y (xey − 1) = x−e−y ,
it follows that ∂M
∂y
= 1 and ∂N
∂x
= 1. Hence, the given ODE becomes
( )
(ex + y) dx + x − e−y dy = 0
ˆ
u= (ex + y) dx + k(y) = ex + xy + k(y)
With
∂u dk dk
=x+ = N = x − e−y ⇒ = −e−y ⇒ k(y) = e−y + c∗
∂y dy dy
it follows that
u(x, y) = ex + xy + e−y = c
Particular Solution. The initial condition gives u(0, −1) = 1 + 0 + e = 3.72 = c, and the
final solution (in implicit form) is
ex + xy + e−y = 3.72
8
5 Linear ODEs
´
y(x) = ce− p(x) dx
(13)
When r(x) ̸= 0 the ODE (in its general form) is said to be nonhomogeneous, which if
rewritten into the form
dy + (py − r) dx = 0
´
p(x) dx
F (x) = e (14)
´ ( ´ )′ ´
e p(x) dx
(y ′ + py) = e p(x) dx y = e p(x) dx r
´
ˆ ´
ˆ
e p(x) dx
y= e p(x) dx
r dx + c ⇐⇒ F y = F r dx + c (15)
´
Defining the function h(x) = p(x) dx, the final solution above can be recast into the form
ˆ
−h
y=e eh r dx + ce−h (16)
9
Example 5.1. Solve the linear ODE y ′ − y = e2x .
Solution. Here,
ˆ ˆ
p = −1, r=e , 2x
h= p dx = − dx = −x
ˆ ˆ
x −x 2x x x
y(x) = e e e dx + ce = e ex dx + cex = e2x + cex .
ˆ ˆ
h(x) = p dx = tan x dx = ln|sec x|
Therefore,
eh = exp ln|sec x| = sec x, e−h = cos x, eh r = (sec x)(2 sin x cos x) = 2 sin x,
( ˆ )
y(x) = cos x 2 sin x dx + c = c cos x − 2 cos2 x.
From this and the initial condition, 1 = c × 1 − 2 × 12 ; thus c = 3 and the solution of our initial
value problem is
6 Bernoulli Equation
10
where a is a constant. If a = 0, 1, the equation is linear and can be solved as outlined in section
5 above. Otherwise, the equation is reducible to linear form by making the transformation
du ( )
= u′ = (1 − a)y −a y ′ = (1 − a)y −a (gy a − py) = (1 − a) g − py 1−a = (1 − a)(g − pu)
dx
or,
Solution. Rewriting the equation as y ′ −Ay = −By 2 , it can be recognized as Bernoulli equation
with a = 2. Hence, making the transformation u = y 1−a = y −1 it follows that u′ = −y ′ /y 2 , and
the corresponding ODE becomes
u′ + Au = B
ˆ
−h
u=e eh r dx + ce−h
´ ´
where h = p(x) dx = A dx = Ax. Hence,
ˆ
−Ax B
u=e BeAx dx + ce−Ax = + ce−Ax
A
and, finally:
1 1
y= =
u B
A
+ ce−Ax
11