Professional Documents
Culture Documents
2.1 – Introduction
Given a function F : D ⊆ R3 → R, a first-order ordinary differential equation in y
is an equation of the form
F (x, y(x), y 0 (x)) = 0, (1)
where y is any real-valued function of x that satisfies the equation.
Given a function f : D ⊆ R2 → R, an explicit first-order ordinary differential
equation in y is a first-order ordinary differential equation in y that can be written in the
form
y 0 = f (x, y). (2)
Throughout this chapter we will be developing techniques to solve many kinds of first-order
differential equations, both linear and nonlinear, that arise in applications.
Definition 2.1. An explicit 1st-order ODE y 0 = f (x, y) is separable if there exist functions
g(x) and p(y) such that f (x, y) = g(x)p(y) for all (x, y) ∈ Dom(f ).
If we define h(y) = 1/p(y), then a separable equation can just as well be written as
y 0 = g(x)/h(y),
Theorem 2.2. Let c be an arbitrary constant. If functions g(x) and h(y) have antiderivatives
G(x) and H(y), respectively, and H(y) = G(x) + c implicitly defines y as a function of x, then
H(y) = G(x) + c is an implicit solution to the separable equation y 0 = g(x)/h(y).
2
Proof. Suppose G and H are antiderivatives of g and h, respectively, and also assume that
H(y) = G(x) + c implicitly defines a function ϕ(x) = y on some open interval I, so that
dy g(x)
• Write the equation as = .
dx h(y)
• “Multiply” by dx to obtain h(y) dy = g(x) dx.
ˆ ˆ
• Integrate both sides: h(y) dy = g(x) dx.
´ ´
Letting H(y) = h(y) dy and G(x) = g(x) dx, and inserting an arbitrary constant c,
immediately yields H(y) = G(x) + c as desired. It should be stressed that the “equation” in
the middle step is not really a proper mathematical equation, since the symbols dx and dy by
themselves have no meaning in this context. Some examples are in order.
Solution. Here we have a first-order ordinary differential equation of the form y 0 = f (x, y),
and since f (x, y) = g(x)p(y) for
1
g(x) = 2x3 − x + 5 and p(y) = ,
4−y
3
it’s seen that the ODE is separable. Letting h(y) = 1/p(y) = 4 − y, we can write the ODE as
dy/dx = g(x)/h(y), from which we obtain h(y) dy = g(x) dx and finally
ˆ ˆ
(4 − y) dy = (2x3 − x + 5) dx.
Solution. The differential equation is of the form y 0 = g(x)p(y), with g(x) = 2x and p(y) =
cos2 y, and so the Method of Separation of Variables is applicable. From dy/dx = 2x cos2 y we
write
1
dy = 2x dx,
cos2 y
which leads to the equation ˆ ˆ
2
sec y dy = 2x dx.
Integrating gives tan y = x2 + c, which is an implicit solution to the ODE. Using the given√
initial condition, we substitute x = 0 and y = π/3 to obtain tan(π/3) = 02 + c, so that c = 3
and we find that √
tan y = x2 + 3 (7)
is an implicit solution to the IVP.
To obtain an explicit solution first recall from trigonometry that the domain of the tangent
function is [ π π
Dom(tan) = − + kπ, + kπ ,
k∈Z
2 2
and recall from calculus that√the tangent function is continuous on its domain. Consider
√ again
the initial condition y(0) = 3, which in particular is a point in R2 where y is 3. √ The only
interval (−π/2 + kπ, π/2 + kπ) in the domain of the tangent function that contains 3 is the
one for which k = 0, which is to say the interval (−π/2, π/2). Thus the implicit solution (7)
to the IVP must generate a curve that is entirely contained within a narrow band in R2 where
−π/2 < y < π/2. It’s known that tan y is one-to-one on (−π/2, π/2) and hence has an inverse
tan−1 . Thus the explicit solution to the IVP is
√
y(x) = tan−1 x2 + 3 ,
where it’s understood that the range of the function y is (−π/2, π/2), which is the customary
range of the function tan−1 .
5
where c is an arbitrary constant. Finally we can isolate y and obtain an explicit solution to (9),
ˆ
1
y(x) = µ(x)Q(x) dx + c , (12)
µ(x)
which in light of (11) may be written as
´
ˆ ´
− P (x) dx P (x) dx
y(x) = e Q(x)e dx + c .
6
The preceding manipulations suggests a general procedure that may be followed to solve
linear first-order differential equations.
where along the way we choose c = 0 and cast off the absolute value bars in the end. The
removal of absolute value bars is justified since it results in an expression for µ(x), namely x3 ,
that places no restriction on the independent variable x, and so it will not hinder the derivation
of the best general solution to the ODE.
At this juncture we may use (12) to obtain the general solution to the ODE, or we may
multiply (13) by x3 and use simple calculus to arrive at the solution. We’ll employ the latter
strategy since it is more instructive and does not require memorizing a rather cumbersome
formula. Multiplying (13) by x3 gives
which oftentimes are written as M (x, y)dx + N (x, y)dy = 0 in other texts, but this will not be
used here.1
Definition 2.7. An ODE of the form M (x, y) + N (x, y)y 0 = 0 is exact on an open set
U ⊆ Dom(M ) ∩ Dom(N ) if there exists a function F : U → R such that
Fx (x, y) = M (x, y) and Fy (x, y) = N (x, y)
for all (x, y) ∈ U .
In practice explicit mention of an open set U is typically omitted and one simply says that
an ODE is exact.
Fortunately there is an easy test that can be applied to determine whether an ODE of the
form (14) is exact. In order to prove the test, however, we will need the following proposition,
which is proven in §5.5 of the Calculus Notes as a direct consequence of the Fundamental
Theorem of Calculus.
Proposition 2.8. If f is continuous on (a, b) and x0 ∈ (a, b), then the function Φ : (a, b) → R
given by
ˆ x
Φ(x) = f (t) dt, a < x < b
x0
0
is differentiable on (a, b), with Φ (x) = f (x) for each x ∈ (a, b).
And now for the theorem that furnishes a test for determining whether (14) is exact, often
called the Test for Exactness.
Theorem 2.9 (Test for Exactness). Suppose that M (x, y) and N (x, y) have continuous first
partial derivatives on an open rectangle R. Then M (x, y) + N (x, y)y 0 = 0 is exact on R if and
only if My (x, y) = Nx (x, y) for all (x, y) ∈ R.
Proof. Suppose that M (x, y) + N (x, y)y 0 = 0 is exact on R = (a, b) × (c, d). Then there exists
some function F : R → R such that Fx = M and Fy = N on R. The continuity of the first
partial derivatives of M and N then implies the continuity of all second partial derivatives
of F . Thus by Clairaut’s Theorem (see Section 1.0) we find that Fxy = Fyx on R. Now,
Fxy = (Fx )y = My and Fyx = (Fy )x = Nx , so that My = Nx on R.
1This is because the expression M (x, y)dx + N (x, y)dy has no real meaning here, at least in light of devel-
opments thus far. It is what is called a differential form, the precise definition of which is quite technical and
beyond the scope of this course. Therefore use of the expression is a terrific waste of time and a fine opportunity
for confusion and misunderstanding to arise.
9
For the converse, suppose that My = Nx on R. The approach will be to construct a function
F : R → R for which Fx = M and Fy = N on R. Fix x0 ∈ (a, b) and let
ˆ x
F (x, y) = M (t, y) dt + g(y) (15)
x0
for (x, y) ∈ R, where g : (c, d) → R is an arbitrary function of y.2 Observe that, for any fixed
y0 ∈ (c, d), the function M ( · , y0 ) is continuous on (a, b), and if we define Φ : (a, b) → R by
Φ(x) = F (x, y0 ), then Proposition 2.8 implies Φ is differentiable on (a, b) with
ˆ x
0 d d
Φ (x) = M (t, y0 ) dt + [g(y0 )] = M (x, y0 )
dx x0 dx
for all a < x < b. Since Fx (x, y0 ) = Φ0 (x) and c < y0 < d is arbitrary, we conclude that
Fx (x, y) = M (x, y) for all (x, y) ∈ R.
What must be shown is that it is always possible to choose g(y) such that the condition
Fy = N holds on R. Differentiating F (x, y) with respect to y gives
ˆ x
Fy (x, y) = Dy M (t, y) dt + g 0 (y),
x0
This would seem to deliver the solution, but there is a question: is the right-hand side of (16)
actually independent of x, and so solely a function of y alone as required?
Fix some x1 ∈ (a, b) such that x1 ≥ x0 , and define
ˆ x1
Ψ(y) = M (t, y) dt.
x0
Now, given any y ∈ (c, d) there exists some > 0 such that y ∈ [c + , d − ], and since M and
My are continuous on the rectangle [x0 , x1 ] × [c + , d − ] ⊆ R, it follows by Leibniz’s Integral
Rule (see Section 1.0) that
ˆ x1
0
Ψ (y) = My (t, y) dy.
x0
The outcome is the same if x1 < x0 , and so for any constant x ∈ (a, b) we find that
ˆ x ˆ x
d
M (t, y) dt = My (t, y) dy.
dy x0 x0
2
´ x The continuity of M ( · , y) on the closed interval with endpoints x0 and x ensures the existence of
x0
M (t, y) dt.
10
since, whenever computing Dy , we do indeed consider x to be constant. Recalling (16) and our
hypothesis that My = Nx on R, we next obtain
ˆ x ˆ x
0
g (y) = N (x, y) − My (t, y) dt = N (x, y) − Nx (t, y) dt. (17)
x0 x0
0
If we define H(t) = N (t, y), then H (t) = Nx (t, y) so that
ˆ x ˆ x
Nx (t, y) dt = H 0 (t) dt = H(x) − H(x0 ) = N (x, y) − N (x0 , y)
x0 x0
It’s worth mentioning that another way to demonstrate that the right-hand side of (16) is
independent of x would be to differentiate the middle expression in (17) with respect to x and
show that the result is 0.
The choice for x0 and y0 in (15) and (18) is not important, only that an antiderivative for
F with respect to x and an antiderivative for g 0 with respect to y are found. We may therefore
write (15) as simply
ˆ
F (x, y) = M (x, y) dx + g(y),
which is scarcely worth memorizing since it is in practice easier to simply follow the procedure
given after the following theorem.
Theorem 2.10. If M (x, y) + N (x, y)y 0 = 0 is exact on R = (a, b) × (c, d), so that there is a
function F such that Fx = M and Fy = N on R, then F (x, y) = c is an implicit solution for
any constant c.
11
Proof. Let c ∈ R be arbitrary and set F (x, y) = c. We take the relation F (x, y) = c to
implicitly define y as a function ϕ of x on some open interval I, so that
F (x, ϕ(x)) = c (19)
for all x ∈ I. Differentiating both sides of (19) with respect to x and employing Chain Rule 1
(see Section 1.0) on the left-hand side, we obtain
Fx (x, ϕ(x)) + Fy (x, ϕ(x))ϕ0 (x) = 0
for all x ∈ I. Recalling that Fx = M and Fy = N , we now obtain
M (x, ϕ(x)) + N (x, ϕ(x))ϕ0 (x) = 0
for all x ∈ I.
Since ϕ : I → R satisfies M (x, y)+N (x, y)y 0 = 0 we conclude that F (x, y) = c is an implicit
solution to the ODE.
The proof of Theorem 2.9 outlines the way in which the function F may be determined.
The procedure is as follows.
where g(y) is an arbitrary function of y. (Notice that the partial derivative of the right-hand
side of (20) with respect to x is indeed M (x, y).)
Taking the partial derivative of F with respect to y gives
Fy (x, y) = Dy ex sin y − x3 + g(y) = ex cos y + g 0 (y),
so My = Nx on at least some rectangle R in R2 and it follows that the ODE is exact. Thus
there exists a function F such that Fx = M and Fy = N . From the former we obtain
ˆ ˆ
1
F (x, y) = M (x, y) dx + g(y) = + 2xy dx = ln |x| + x2 y 2 + g(y).
2
(21)
x
From this comes
Fy (x, y) = 2x2 y + g 0 (y),
13
and thus ˆ
My − Nx
ln |µ| = dx + c
N
for an arbitrary constant c. Hence an integrating factor of the form µ(x) is given by
ˆ
My − Nx
µ(x) = exp dx . (26)
N
A similar analysis based on the assumption that µ and (Nx − My )/M are functions of y
alone (i.e. independent of x) leads to another formula:
ˆ
Nx − My
µ(y) = exp dy . (27)
M
In the special case when we are given a first-order linear ODE in standard form,
y 0 + P (x)y = Q(x),
we can write
[P (x)y − Q(x)] + y 0 = 0
and since
´
P (x) dx
M̂y (x, y) = P (x)e = N̂x (x, y),
it follows from Theorem 2.9 that (28) is exact´and therefore µ(x) is an integrating factor as the
term is defined in this section. Of course exp( P (x) dx) was encountered before in Section 2.3,
where it was also defined to be an integrating factor, and so we see that the integrating factor
of that section is just a special instance of the more inclusive notion of an integrating factor
under consideration here.
the equation is not exact. We will attempt to make it exact by finding an integrating factor of
some kind. In order to obtain an integrating factor that depends only on x we need (My −Nx )/N
to be independent of y, but this is not the case due to a y 2 term that cannot be expunged:
My (x, y) − Nx (x, y) 2x − 6x 4x
= 2 = − .
N (x, y) y + 3x2 y 2 + 3x2
To obtain an integrating factor that depends only on y we need (Nx − My )/M to be
independent of x, and here we have more luck:
Nx (x, y) − My (x, y) 6x − 2x 2
= = ,
M (x, y) 2xy y
where no x is to be seen in the final expression. To determine µ(y) we use the formula (27):
ˆ ´
Nx (x, y) − My (x, y) 2
µ(y) = exp dy = e 2/y dy = e2 ln |y| = eln y = y 2
M (x, y)
Multiplying the ODE by y 2 gives
2xy 3 + (y 4 + 3x2 y 2 )y 0 = 0,
Since M̂y (x, y) = 6xy 2 = N̂x (x, y) the equation is exact (exact on R2 , in fact), and so there
exists some function F (x, y) such that Fx = M̂ and Fy = N̂ . From the latter equation3 we
obtain ˆ ˆ
1
F (x, y) = N̂ (x, y) dy = (y 4 + 3x2 y 2 ) dy = y 5 + x2 y 3 + h(x),
5
where h(x) is an arbitrary function of x. Differentiating with respect to x then yields
Fx (x, y) = 2xy 3 + h0 (x),
and since Fx = M̂ we have 2xy 3 + h0 (x) = 2xy 3 and thus h0 (x) = 0. We conclude that h(x) = c1
for any arbitrary constant c1 , so that
1
F (x, y) = y 5 + x2 y 3 + c1 .
5
The general implicit solution is therefore
1 5
y + x 2 y 3 + c1 = c2 ,
5
where c2 is arbitrary. Naturally we may combine c1 and c2 by letting c = c2 − c1 , and write
y 5 + 5x2 y 3 = c
as the general solution.
It is within our capability to determine an integrating factor that depends on both x and
y in certain instances, as the next example illustrates.
3It does not, of course, matter which equation we start with.
17
Example 2.14. Find an integrating factor of the form xm y n that will make the equation
(2y 2 − 6xy) + (3xy − 4x2 )y 0 = 0 exact, then solve the equation.
In order for this equation to be satisfied for all (x, y) in some open set U ⊆ R2 , the coefficients
of like terms will have to be equal; that is, the coefficients of the xm y n+1 terms will need to
match, giving 2n + 4 = 3m + 3, and the coefficients of the xm+1 y n terms will need to match,
giving −6n − 6 = −4m − 8. Thus we have a system of equations
3m − 2n = 1
4m − 6n = −2
We now set about finding the general solution to the ODE. There is a function F (x, y) such
that
Fx (x, y) = 2xy 3 − 6x2 y 2 (30)
and
Fy (x, y) = 3x2 y 2 − 4x3 y. (31)
From (30) we obtain
ˆ
F (x, y) = (2xy 3 − 6x2 y 2 ) dx = x2 y 3 − 2x3 y 2 + g(y).
It turns out that homogeneous equations lend themselves well to a substitution of variables.
Given y 0 = g(y/x) let v = y/x, so that y = xv and by the product rule of differentiation we
obtain y 0 = v + xv 0 . This turns the ODE into the form
v + xv 0 = g(v), (32)
where now v is the dependent variable (thought of as a function of x), but x retains its role as
the independent variable. But notice that (32) is a separable equation: we can write it as
g(v) − v
v0 = ,
x
which has the form v 0 = G(v)H(x) with G(v) = g(v) − v and H(x) = 1/x. By the Method of
Separation of Variables we obtain
ˆ ˆ
1 1
dv = dx, (33)
g(v) − v x
from which it should be possible to find v(x) up to an arbitrary constant. Then from
y(x) = xv(x) we determine a general explicit solution to the original ODE.
Solution. This equation is actually exact, but we will solve it a different way to illustrate the
substitution technique. First we isolate y 0 ,
x2 + y 2
y0 = − .
2xy
Next,
x2 + y 2 1/x2 1 + (y/x)2
y0 = − · = − ,
2xy 1/x2 2(y/x)
so the right-hand side of the ODE can be cast as a function of y/x and therefore it is homoge-
neous. Letting v = y/x, the equation becomes
1 + v2
v + xv 0 = − ,
2v
20
where c2 = exp(c1 ) > 0 is arbitrary. From this comes x(3y 2 + x2 ) = ±c2 , and so we may as well
replace ±c2 with the arbitrary constant c 6= 0 and write
x3 + 3xy 2 = c,
Solution. The equation is not separable, linear, or exact. However, dividing by x we obtain
0 y(ln y − ln x + 1) y y y
y = = ln + ,
x x x x
where the right-hand side can be seen to be a function of y/x. The equation is therefore
homogeneous, and so we let v = y/x and get
v + xv 0 = v ln v + v,
and thus
xv 0 = v ln v.
21
The substitution to make here is v = y 1−n , which can also be expressed as y n = y/v.
Differentiating with respect to x gives
v 0 = (1 − n)y −n y 0 ,
so that
yn 0 y/v 0 yv 0
y0 = v = v =
1−n 1−n (1 − n)v
22
Given an equation y 0 = f (x, y), suppose there can be found constants a and b, and a
function G, such that
f (x, y) = G(ax + by)
for all (x, y) in some open set U ⊆ R2 . Then the ODE may be written as y 0 = G(ax + by),
and it becomes possible to transform it into a separable equation by making the substitution
z = ax + by. Differentiating with respect to x, we have z 0 = a + by 0 and thus
z0 − a
y0 = ,
b
which enables us to write y 0 = G(ax + by) as
z0 − a
= G(z)
b
and finally z 0 = a + bG(z). By the Method of Separation of Variables this leads to the equation
ˆ ˆ
1
dz = dx,
a + bG(z)
and we’re on our way toward glorious victory.
Example 2.20. Solve the initial value problem y 0 = sin(x − y), y(0) = π/4.
Solution. Here f (x, y) = sin(x − y), and so if we define G(z) = sin(z) we can see that
f (x, y) = sin(x − y) = G(x − y)
for all (x, y) ∈ R2 . Thus, we may make the substitution z = x − y for y 0 = sin(x − y) and
expect a separable equation to result. From z = x − y we get z 0 = 1 − y 0 , so that y 0 = 1 − z 0
and the ODE becomes 1 − z 0 = sin(z). By the Method of Separation of Variables this leads to
ˆ ˆ
1
dz = dx. (37)
1 − sin(z)
Now, since
1 1 1 + sin(z) 1 + sin(z)
= · = 2
= sec2 (z) + tan(z) sec(z),
1 − sin(z) 1 − sin(z) 1 + sin(z) cos (z)
24