Differential Equations
Differential Equations
Sukumar
Lecture 3
I Linear Ay = b
I Homogeneous Ay = 0 – Find all solutions
I Non-homogenous Ay = b – Find one solution
Recall: Linear first order non-homogeneous differential equations
Consider the most general form of linear first order differential equation. By
definition, this looks like
y 0 + a(x)y = f (x).
Assume that a(x) and f (x) are defined on the interval I = (x0 − , x0 + ).
The homogeneous equation / complementary equation of it is
y 0 + a(x)y = 0.
Solving first order linear ODE
y 0 + a(x)y = f (x).
y = CF + PI
Recall you have done the same in linear algebra in solving Ay = b. For
example solving u + v = 3 for (u, v )
Complementary function
Solving homogeneous equation
y 0 + a(x)y = 0
dy
= −a(x)y
dx
dy
= −a(x)dx, by separating variables
y
Z
ln y = − a(x)dx + c, on integration
R
y = Ce − a(x)dx
, on integration and renaming e c as C
R
Hence the CF is yh (x) = Ce − a(x)dx
If yh is a solution then cyh a constant multiple as well
If the co-efficient function is a constant (say α) then yh (x) = Ce −αx .
Particular Integral
Solving non-homogeneous equation
u 0 yh = f (x).
Z x
f (s)
u(x) = ds + c
x0 h (s)
y
Hence a particular integral is
Z x
f (s)
yp (x) = yh (s) ds + c .
x0 yh (s)
Example
(2) Solve the ODE y 0 − 2xy = 1, where y (0) = y0 . Write the solution of
ODE as Z x
x2 s2
y (x) = e e ds + C .
0
(a) In view of the above definition, we can ask what is the largest open interval
around x0 on which the given ODE has a solution
(b) If y (x) is a solution to the ODE around x0 , then the largest interval around
x0 in which y (x) is defined is called the interval of validity for the solution y .
Example
dy
Gx (x, y ) + Gy (x, y ) = 0.
dx
Similarly, regarding x as a function of y and differentiating (1) w.r.t y yields
dx
Gx (x, y ) + Gy (x, y ) = 0.
dy
Question 1. Given an equation (3), how can we determine whether it’s exact?
∂G ∂G
In other words, there exists a function G = G (x, y ) such that and are
∂x ∂y
continuous and
∂G ∂G
= M(x, y ) and = N(x, y ).
∂x ∂y
Exact Equations
dy
Solve (2x + 3) + (2y − 2) = 0.
dx
The ODE is exact, so we need to find G (x, y ) such that
∂G ∂G
= 2x + 3 and = 2y − 2.
∂x ∂y
Integrating first equation w.r.t. x gives
G (x, y ) = x 2 + 3x + h(y ).
This gives
∂G dh
= = 2y − 2 =⇒ h(y ) = y 2 − 2y + c1 .
∂y dy
Therefore, an implicit solution to ODE is
G (x, y ) = x 2 + 3x + y 2 − 2y + c.
Exact Equations
Solve
dy
(3x 2 + 6xy 2 ) + (6x 2 y + 4y 3 ) = 0.
dx
∂G ∂G
= 3x 2 + 6xy 2 and = 6x 2 y + 4y 3 .
∂x ∂y
The solution to ODE is
G (x, y ) = x 3 + 3x 2 y 2 + y 4 + c.
Exact Equations
y dy
Solve + 6x + (ln x − 2) = 0, where x, y > 0.
x dx
Check that given ODE is exact. We need to find G (x, y ) such that
∂G y ∂G
= + 6x and = ln x − 2.
∂x x ∂y
Integrating first equation w.r.t. x gives
G (x, y ) = y ln |x| + 3x 2 − 2y + c.
Method of integrating factor
Example. Solve
dy
(3x 2 y + 2xy + y 3 ) + (x 2 + y 2 ) = 0.
dx
Here M = 3x 2 y + 2xy + y 3 , and N = x 2 + y 2 . We have
∂M ∂N
= 3x 2 + 2x + 3y 2 , and = 2x.
∂y ∂x
Therefore note that ODE is not exact.
dy
M(x, y ) + N(x, y ) =0 (6)
dx
if
dy
µ(x, y )M(x, y ) + µ(x, y )N(x, y ) = 0. (7)
dx
is exact.
The Exactness Theorem says that (7) is exact on an open rectangle R if µM,
∂ ∂
µN, ∂y (µM), and ∂x (µN) are continuous and
∂ ∂
(µM) = (µN)
∂y ∂x
on R.
Integrating factors
Thus
∂ ∂
(µM) = (µN)
∂y ∂x
gives
µy M + µMy = µx N + µNx .
µ(My − Nx ) = µx N − µy M, (8)
∂µ ∂µ
µ(My − Nx ) = N− M
∂x ∂y
1 ∂µ My − Nx
=⇒ = := p(x)
µ ∂x N
My − Nx
If is a function of x only, say p(x), then
N
R
p(x) dx
µ(x) = e
dy
is an integrating factor of ODE M(x, y ) + N(x, y ) = 0 on R.
dx
Finding the integrating factors
∂µ ∂µ
µ(My − Nx ) = N− M
∂x ∂y
∂µ
=⇒ µ(My − Nx ) = N
∂x
1 ∂µ My − Nx
=⇒ = := p(x)
µ ∂x N
My − Nx
If is a function of x only, say p(x), then
N
R
p(x) dx
µ(x) = e
dy
is an integrating factor of ODE M(x, y ) + N(x, y ) = 0 on R.
dx
Finding the integrating factors
∂µ ∂µ
µ(My − Nx ) = N− M
∂x ∂y
1 ∂µ Nx − My
=⇒ = := q(y )
µ ∂y M
Nx − My
If is a function of y only, say q(y ), then
M
R
q(y ) dy
µ=e
dy
is an integrating factor ODE M(x, y ) + N(x, y ) = 0 on R.
dx
Finding the integrating factors
∂µ ∂µ
µ(My − Nx ) = N− M
∂x ∂y
∂µ
=⇒ µ(My − Nx ) = − M
∂y
1 ∂µ Nx − My
=⇒ = := q(y )
µ ∂y M
Nx − My
If is a function of y only, say q(y ), then
M
R
q(y ) dy
µ=e
dy
is an integrating factor ODE M(x, y ) + N(x, y ) = 0 on R.
dx
Finding the integrating factors
∂µ ∂µ
µ(My − Nx ) = N− M
∂x ∂y
=⇒ P(x)Q(y )(My − Nx ) = P 0 (x)Q(y )N − P(x)Q 0 (y )M
My − Nx
(a) If is a function of x only, say p(x), then
N
R
p(x) dx
µ(x) = e
is an integrating factor of ODE (9).
Nx − My
(b) If is a function of y only, say q(y ), then
M
R
q(y ) dy
µ(y ) = e
is an integrating factor of ODE (9).
P0 Q0
(c) If My − Nx = p(x)N − q(y )M, where = p(x), = q(y ), then
P Q
R R
p(x)dx q(y )dy
µ(x, y ) = P(x)Q(y ) = e e
is an integrating factor of ODE (9).
Integrating factors
Example Solve
∂G ∂G
= e y cos x cos y , and = e y (sin x cos y − sin x sin y + y )
∂x ∂y
Example (continued ...)
∂G
Since = e y cos x cos y , integrating w.r.t.x, we get
∂x
G (x, y ) = e y sin x cos y + h(y ).
∂G dh
=⇒ = e y sin x cos y − e y sin x sin y +
∂y dy
But
∂G
= e y (sin x cos y − sin x sin y + y )
∂y
dh
Therefore = ye y , and hence h(y ) = ye y − e y + c.
dy
Thus
G (x, y ) = e y (sin x cos y + y − 1) + c
is an implicit solution of ODE.
Example
Example Solve
My − Nx = 9x 2 y 2 − 2y + 1 − 2 = 9x 2 y 2 − y − 1.
Observe that
−My + Nx M y − Nx
6= q(y ), and 6= p(x).
M N
Can we write
My − Nx = p(x)N − q(y )M
for some p(x) and q(y )?
Example (continued ...)
−2 −3
Choose p(x) = and q(y ) = . Then
x y
My − Nx = p(x)N − q(y ).
R −2 R −3 dy
dx 1
µ(x, y ) = e x e y = .
x 2y 3