You are on page 1of 24

MA108 ODE: Solving First order ODE’s

Lecture 2 (D3 & D4)

Prachi Mahajan
IIT Bombay

Prachi Mahajan, IITB MA108: D3 & D4-02


Warm up!

1 The DE e x y 0 + 3y = x 2 y is linear & separable.


TRUE OR FALSE?
2 The DE yy 0 + 3x = 0 is linear & separable. TRUE OR
FALSE?
dx x+2xt+cos t
3 The DE dt = 1+t 2
is linear & separable. TRUE OR
FALSE?

Prachi Mahajan, IITB MA108: D3 & D4-02


Initial Value Problem for first order ODE

Definition
Initial value problem (IVP) : A DE along with an initial condition is
an IVP.
y 0 = f (x, y ), y (x0 ) = y0 .

Prachi Mahajan, IITB MA108: D3 & D4-02


Separable ODE’s

Example: Escape velocity.


A projectile of mass m moves in a direction perpendicular to the
surface of the earth. Suppose v0 is its initial velocity. We want to
calculate the height the projectile reaches.
Its weight at height x (from the surface of the earth) is given by,

mgR 2
w (x) = − ,
(R + x)2

where R is the radius of the earth.


Neglect force due to air resistance and other celestial bodies.
Therefore, the equation of motion is

d 2x mgR 2
m = − ; v (0) = v0 .
dt 2 (R + x)2

Prachi Mahajan, IITB MA108: D3 & D4-02


Separable ODE’s
By chain rule,
d 2x dv dv dx dv
2
= = · =v· .
dt dt dx dt dx
Thus,
dv gR 2
v· =− .
dx (R + x)2
This ODE is separable. Linear or non-linear? (NL)
Separating the variables and integrating, we get:
v2 gR 2
= + c.
2 R +x
v02 v2
For x = 0, we get 2 = gR + c, hence, c = 20 − gR, and,
s
2gR 2
v = ± v02 − 2gR + .
R +x

Prachi Mahajan, IITB MA108: D3 & D4-02


Separable ODE’s

Suppose the body reaches the maximum height H. Then v = 0 at


this height.
2gR 2
v02 − 2gR + = 0.
(R + H)
Thus,
2gR 2
 
H
v02 = 2gR − = 2gR .
R +H R +H
The escape velocity is found by taking limit as H → ∞. Thus,
p
ve = 2gR ∼ 11 km/sec.

Prachi Mahajan, IITB MA108: D3 & D4-02


Homogeneous ODE’s
Definition
A function f : Rn → Rn is called homogeneous if for some d ∈ Z

f (tx1 , . . . , txn ) = t d f (x1 , . . . , xn )

for all t 6= 0 and for all (x1 , . . . , xn ) ∈ Rn . The number d is called


the degree of f (x1 , . . . , xn ).
Examples:
f (x, y ) = x 2 + xy + y 2 is homogeneous of degree 2.
f (x, y ) = y + x cos2 yx is homogeneous of degree 1.
Definition
The first order ODE
dy
M(x, y ) + N(x, y ) =0
dx
is called homogeneous if M and N are homogeneous of the same
degree.
Prachi Mahajan, IITB MA108: D3 & D4-02
Solving first order homogeneous ODE’s
Consider
dy
=0
M(x, y ) + N(x, y )
dx
where M and N are homogeneous of degree d. Put

y = xv .

Then,
dy dv
=x + v.
dx dx
Substituting this in the given ODE, we get:
 
dv
M(x, xv ) + N(x, xv ) x + v = 0.
dx
Thus,  
d d dv
x M(1, v ) + x N(1, v ) x + v = 0.
dx

Prachi Mahajan, IITB MA108: D3 & D4-02


Solving first order homogeneous ODE’s Continued

 
d d dv
x M(1, v ) + x N(1, v ) x + v = 0.
dx
Let x 6= 0. Then,
dv
M(1, v ) + N(1, v ) · v + N(1, v ) · x = 0.
dx
Thus,
dx N(1, v )
+ dv = 0.
x M(1, v ) + N(1, v ) · v
This is a separable equation.
NOTE: The above method can be applied to any ODE which takes
the form
y
y 0 = f ( ).
x

Prachi Mahajan, IITB MA108: D3 & D4-02


Remark

We will later use the term “homogeneous” in a different context to


describe DE’s of the form Dy = 0 (as opposed to Dy = b(x)) for a
differential operator D. If you recall, for a linear system, you used
the term in this sense, in MA 106.

Prachi Mahajan, IITB MA108: D3 & D4-02


Example
Example: Solve the ODE:
dy
(y 2 − x 2 ) + 2xy = 0.
dx
Put y = vx. Thus, dy dv
dx = v + x dx .
Substituting this in the given ODE, we get:
 
2 2 2 dv
(v x − x ) v + x + 2x 2 v = 0.
dx
Thus, for x 6= 0,
dv
(v 2 − 1)v + x(v 2 − 1) + 2v = 0;
dx
i.e.,
dv
(v 3 + v ) + x(v 2 − 1) = 0.
dx
Thus, we have the separable ODE:
v2 − 1 dx
dv + = 0.
v (v 2 + 1) x
Prachi Mahajan, IITB MA108: D3 & D4-02
Homogeneous ODE’s

v2 − 1 dx
dv + = 0.
v (v 2 + 1) x
Integrating, we get:
Z  
2v 1
ln |x| + 2
− dv = 0.
v +1 v
Thus,
ln |x| + ln(v 2 + 1) − ln |v | = c.
Hence,
x(v 2 + 1)
= c,
v
or
y 2 + x 2 = cy ,
which is
 c 2 c 2
x2 + y − = .
2 4
Prachi Mahajan, IITB MA108: D3 & D4-02
Homogeneous ODE’s
The direction field is H(x, y ) = (1, x 22xy
−y 2
).

Check that the isoclines are pair of lines.


Prachi Mahajan, IITB MA108: D3 & D4-02
Recall

So far, we saw how to solve separable ODE’s and ODE’s which can
be put into the form
y
y 1 = f ( ).
x
If the ODE is separable, just integration is enough to solve it. The
homogeneous ODE’s can be converted to separable ODE’s by the
substitution y = vx. Now, we will look at another class of first
order ODE’s - exact ODE’s.

Prachi Mahajan, IITB MA108: D3 & D4-02


Exact ODE’s
Definition
A first order ODE M(x, y ) + N(x, y )y 1 = 0 is called exact on an
open rectangle R if there is a function u = u(x, y ) such that

∂u ∂u
(x, y ) = M(x, y ) & (x, y ) = N(x, y )
∂x ∂y

for all (x, y ) ∈ R.

Recall from calculus that given a function u(x, y ) with continuous


first partial derivatives, its differential is
∂u ∂u
du = dx + dy .
∂x ∂y
If the ODE given above is exact, then the differential form
∂u ∂u
M(x, y )dx + N(x, y )dy = dx + dy = du = 0.
∂x ∂y
Integrating du = 0, we get u(x, y ) = c as an implicit solution to
the given ODE. Prachi Mahajan, IITB MA108: D3 & D4-02
Solving Exact ODE’s
Given an exact ODE as above, the function u(x, y ) can be found
either by inspection or by the following method:
Step I: Integrate ∂u
∂x = M(x, y ) with respect to x to get
Z
u(x, y ) = M(x, y )dx + k(y ),

where k(y ) is a constant of integration.


Step II: To determine k(y ) differentiate the above equation in Step
I with respect to y , to get:
Z 
∂u 0 ∂
= k (y ) + M(x, y )dx .
∂y ∂y
As the given ODE is exact, we get
Z 

N(x, y ) = k 0 (y ) + M(x, y )dx .
∂y
We use this to determine k(y ) and hence u.
Prachi Mahajan, IITB MA108: D3 & D4-02
Example

Example: Solve the ODE:


dy
(2x + y 2 ) + 2xy = 0.
dx
Consider the function u(x, y ) = x 2 + xy 2 . Note that

∂u ∂u
= 2x + y 2 , = 2xy .
∂x ∂y

Hence x 2 + xy 2 = c is an implicit general solution of the given


ODE.

Prachi Mahajan, IITB MA108: D3 & D4-02


Closed Forms

Definition
The differential form

M(x, y )dx + N(x, y )dy

is called closed if
∂M ∂N
= ,
∂y ∂x
i.e.,
My = Nx .

Prachi Mahajan, IITB MA108: D3 & D4-02


Closed Forms

Proposition
Let M, N and their first order partial derivatives exist and be
continuous in a region D ⊆ R2 .
(i) If M(x, y )dx + N(x, y )dy is an exact differential form, then it
is closed.
(ii) If D is convex, then any closed form is exact.

Proof:
∂u ∂u
(i) Let M = ∂x and N = ∂y . Then,

∂2u ∂2u
My = & Nx = .
∂y ∂x ∂x∂y

By the theorem on mixed partials, (what’s this?), My = Nx


and hence M(x, y )dx + N(x, y )dy is closed. Recall from MA
111 that this proof is same as that of “curl of grad is zero”.
Prachi Mahajan, IITB MA108: D3 & D4-02
Closed Forms
(ii) Now, let D be convex, and Mdx + Ndy be a closed form.
Consider the vector field
H(x, y ) = (M(x, y ), N(x, y )).
By our assumptions, H is continuously differentiable
throughout D. What’s its curl? The curl of H is given by

i j k
∂ ∂ ∂
∇ × H = ∂x ∂y ∂z = (Nx − My )k = 0.
M N 0

As D is convex, “curl free is grad”; i.e., there is a function


φ(x, y ) such that
H = ∇φ = (φx , φy ).
Hence φx = M, φy = N and thus Mdx + Ndy is exact.
Question: “curl free is grad” is true on more general regions? What
are they called? Examples? How did you prove this in MA 111?
Prachi Mahajan, IITB MA108: D3 & D4-02
Example

Example: Solve the ODE:

(y cos x + 2xe y ) + (sin x + x 2 e y − 1)y 1 = 0.

Let M = y cos x + 2xe y and N = sin x + x 2 e y − 1. Check:


My = Nx . Thus,
Mdx + Ndy
is closed. Can we conclude that it is exact? Yes (why?). Thus, we
have an exact ODE. Need to find u(x, y ) such that ux = M and
uy = N.

Prachi Mahajan, IITB MA108: D3 & D4-02


Example continued

Step I:
Z
u(x, y ) = (y cos x + 2xe y )dx + k(y ) = y sin x + x 2 e y + k(y ).

Step II:

uy = sin x + x 2 e y + k 0 (y ) = sin x + x 2 e y − 1.

Thus, k 0 (y ) = −1. Choosing k(y ) = −y , we get:

u(x, y ) = y sin x + x 2 e y − y = c

as an implicit solution to the given DE.

Prachi Mahajan, IITB MA108: D3 & D4-02

You might also like