Sma Ode 2
Sma Ode 2
Sma Ode 2
Example
2 dy dy 2
The function y = ex is a solution of dx − 2xy = 0 since dx = 2xex we see that
dy 2 2
x
dx − 2xy = 2xe − 2x(ex ) = 0.
Solution
R dy
kdt. By assuming y > 0, lny = kt + c1 therefore y = ekt+c = ec1 ekt ,
R
y =
let c1 = c, hence y = cekt .
Example Solve the given differential equation by separation of variables.
0
1. xy − y = 1,
2. (1 + x2 + y 2 + x2 y 2 )dy = ydx.
Solution
1
1.
0
xy = 1 + y
R dy R 1
= dx
1+y x
ln |1 + y| = ln |x| + ln|A|
1+y = Ax
y = Ax − 1.
2.
(1 + x2 + y 2 + x2 y 2 )dy = ydx
((1 + x2 ) + y 2 (1 + x2 ))dy = ydx
R 1 + y2 R 1
dy = dx
y 1 + x2
1
ln |y| + y 2 = tan−1 x + c.
2
Homogeneous first order differential equations
0
Suppose a first order differential equation F (x, y, y ) = 0 has the differen-
tial form
P (x, y)dx + Q(x, y)dy = 0
and the property that
Example
x tx x
f (x, y) = 2y + 4 and f (tx, ty) = 2ty +4= 2y + 4 = t0 f (x, y).
The function is homogeneous of degree zero.
Example
Solve 2x3 ydx + (x4 + y 4 )dy = 0.
Solution
P (x, y) = 2x3 y
P (tx, ty) = 2t3 x3 · ty
P (tx, ty) = t4 P (x, y).
2
The function is homogeneous of degree four.
Q(x, y) = x4 + y 4
Q(tx, ty) = t4 x4 + t4 y 4
Q(tx, ty) = t4 Q(x, y).
Exact differential
A differential expression,
Example
Verify that x2 y 3 dx + x3 y 2 dy is an exact differential since it is the total
differential of f (x, y) = 31 x3 y 3 .
Solution
∂f ∂f
dx + dy = x2 y 3 dx + x3 y 2 dy.
∂x ∂y
Theorem
Let P and Q be continuous and have continuous first partial derivatives
in a rectangular region of the xy-plane. Then, (1) is an exact differential
if and only if
∂P ∂Q
= (3)
∂y ∂x
for all (x, y) in the region.
3
is said to be exact when P (x, y)dx + Q(x, y)dy is an exact differential.
When (4) is exact, it is equivalent to df (x, y) = 0. Hence, a family of
solutions of the equation is given implicitly by f (x, y) = C.
Example
Solve (5x + 4y)dx + (4x − 8y 3 )dy = 0.
Solution
∂P ∂Q
∂y = 4 = ∂x . Therefore the equation is exact.
∂f
= 4x − 8y 3
∂y
f (x, y) = 4xy − 2y 4 + h(x)
∂f 0
= 4y + h (x).
∂x
0
But ∂f
∂x = 5x + 4y therefore h (x) = 5x, hence h(x) =
5 2
2x + c1 . Since
df = 0,
5x2
d 4xy − 2y 4 + + c1 = 0
2
5x2
4xy − 2y 4 + = C.
2
Linear first order differential equations
A linear first order differential equation is an equation of the form
dy
a1 (x) + a0 (x)y = g(x) (5)
dx
(5) can be written in the form
dy
+ p(x)y = f (x), (6)
dx
provided a1 (x) 6= 0.
We seek solutions of (6) on an interval I for which P and f are continuous.
4
and finally, integrate both sides to obtain the solution.
Example
dy
Solve dx − 3y = 0.
Solution
R
(−3)dx
e = e−3x
d −3x
(e y) = 0
dx
y = Ce−3x .
Variation of parameters
Consider the linear non-homogeneous first order equation
0
y + p(x)y = f (x) (9)
and 0
y + p(x)y = 0 (10)
the complementary equation.
In order to solve (9); find the solutions of (9) in the form y = uy1 , where
y1 is a nontrivial solution of (10) and u is a parameter (not a constant)
0 0 0
which is to be determined. If y = uy1 , then y = u y1 + uy1 substituting
0
y and y into (9) yields
0 0
u y1 + uy1 + p(x)uy1 = f (x)
0 0
u(y1 + p(x)y1 ) + u y1 = f (x)
0
u y1 = f (x). (11)
5
Example
0
Find the general solution of y + 2y = x3 e−2x .
Solution
0
y + 2y = 0
Z Z
dy
= −2dx
y
ln |y| = −2x
y = e−2x .
0 0
Therefore, y1 = e−2x . Let y = ue−2x , thus y = u e−2x − 2ue−2x .
0 0
y + 2y = u e−2x − 2ue−2x + 2ue−2x
0
= u e−2x
= x3 e−2x .
Therefore,
0
u x3 =
x4
u = + c,
4
4
x4
and y = c + 4 e−2x or y = e−2x x4 + c .
That is, initial conditions are values of the solution and/or its derivative(s)
at specific points.
6
The interval of validity for an IVP with initial conditions y(t0 ) = y0 and/or
y k (t0 ) = yk is the largest possible interval on which the solution is valid
and contains t0 .
Examples
Solve the following initial value problems and state the interval of validity
for each IVP;
(a) sin(x)dx + ydy = 0, y(0) = 1.
(b) (3x2 + 2xy 2 )dx + 2x2 ydy = 0, y(2) = −3.
(c) ydx + 2x + y1 dy = 0, y(−2) = 1.
y
0 y+xe− x
(d) y = x , y(e10 ) = 1.
Solutions
(a)
ydy = − sin(x)dx
Z Z
y 2 dy = − sin(x)dx
y2
= cos(x) + c1
2 p
y = 2 cos(x) + c2 ,
√
1 = 2 + c2
1 = 2 + c2
c2 = −1.
p
Therefore y = 2 cos(x) − 1 on the interval − π3 , π3 since we need
1
cos(x) ≥ 2 and cos ± π3 = 12 .
∂p ∂Q
(b) P (x, y) = 3x2 + 2xy 2 ), Q(x, y) = 2x2 y, and ∂y = 4xy = ∂x ,
therefore the equation is exact.
∂f
= 3x2 + 2xy 2
∂x
f = x3 + x2 y 2 + h(y)
∂f 0
= 2x2 y + h (y)
∂y
= x2 y 2 + g(x).
7
Therefore f = x3 + x2 y 2 + c1 and thus, x3 + x2 y 2 = c. Considering
y(2) = −3, c = 44. Hence
x3 + x2 y 2 = 44
44 − x3
y2 =
√x2
44 − x3
y = ± .
x
√
44−x3
But with the restriction y(2) = −3, the only solution is y = −
√ √ x
on the interval (− 3 44, 0) ∪ (0, 3 44).
(c)
y 2 dx + (2xy + 1)dy = 0
dx
y2 + 2xy + 1 = 0
dy
dx 2x 1
+ = − 2.
dy y y
R 2
Integrating factor, µ(y) = e y dy = y 2 .
d 2
(y x) = −1
dy
Z
y2 x = − dy
y2 x = −y + c
xy 2 = −y − 1
2
xy + y + 1 = 0.
√
−1± 1−4x
From which we obtain, y = 2x , where x 6= 0 and x ≤ 14 . Con-
√
sidering the initial condition y(−2) = 1 suggests that y = −1−2x1−4x .
Therefore, √
−1 ± 1 − 4x 1
y= , (−∞, 0) ∪ (0, ).
2x 4
Linear second order differential equations
Consider the linear second order equation with real constant
coefficients: 00 0
ay + by + cy = g(x) (12)
and the homogeneous equation
00 0
ay + by + cy = 0 (13)
8
Theorem- Superposition Principle
Let y1 and y2 be solutions of the homogeneous second order differ-
ential equation (13). Then the linear combination
y = c1 y1 (x) + c2 y2 (x)
3m2 + 10m + 8 = 0
(3m + 4)(m + 2) = 0
9
Example
00 0
Solve y − 6y + 9y = 0.
Solution
m2 − 6m + 9 = 0
(m − 3)2 = 0
m = 3 twice
Let C1 = c1 + c2 and C2 = c1 i − c2 i,
since eαx cos βx and eαx sin βx are linearly independent solutions of
(13).
Example √
00 0
Solve y + 3y + 3y = 0
Solution
√
m2 + 3m + 3 = 0
√ q√
− 3 ± ( 3)2 − 4(1)(3)
m =
2(1)
√
− 3 ± 3i
m =
2
Therefore, √
3x 3x 3x
y = e− 2 [c1 cos( ) + c2 sin( )]
2 2
.
10
Non-homogeneous Linear second order differential equations
00 0
ay + by + cy = g(x) (21)
where a, b and c are constants and g is continuous.
Theorem
Let yp be a given solution of the non-homogeneous equation (21) and let
yc = c1 y1 (x) + c2 y2 (x)
y = yc (x) + yp (x)
Variation of parameters
00 0
ay + by + cy = g(x), (22)
00 0
y + P y + Qy = f (x). (23)
Consider 00 0
y + P y + Qy = 0. (24)
Let y1 and y2 be linearly independent solutions of (24) the associated
homogeneous form of (23).
Let,
yp = u1 y1 + u2 y2 , (25)
where u1 = u1 (x) and u2 = u2 (x).
0 0 0 0 0
yp = u1 y1 + y1 u1 + u2 y2 + y2 u2 . (26)
11
Let 0 0
y1 u1 + y2 u2 = 0, (27)
then (26) becomes
0 0 0
yp = u1 y1 + u2 y2 .
Hence, 00 00 0 0 00 0 0
yp = u1 y1 + y1 u1 + u2 y2 + y2 u2 ,
and therefore,
00 0 00 0 0 00 0 0 0
yp + P yp + Qyp = u1 y1 + y1 u1 + u2 y2 + y2 u2 + P u1 y1
0
+P u2 y2 + Qu1 y1 + Qu2 y2
00 0 00 0
= u1 [y1 + P y1 1 + Qy1 ] + u2 [y2 + P y2 1 + Qy2 ]
0 0 0 0
+y1 u1 + y2 u2
0 0 0 0
= y1 u1 + y2 u2
= f (x) (28)
(28) and (27) constitute a linear system of equations for the derivatives
0 0
u1 and u2 ;
0 0 0 0
y1 u1 + y2 u2 = 0,
0 0 0 0
y1 u1 + y2 u2 = f (x).
Solution
00
y + 9y = 41 csc and m2 + 9 = 0 therefore m1 = 3i and m = −3i;
yc = c1 cos
3x + c2 sin 3x
cos 3x sin 3x
W (x) = = 3.
−3 sin 3x 3 cos 3x
12
Therefore yp = u1 cos 3x + u2 sin 3x and
0 0
u1 cos 3x + u2 sin 3x = 0
0 0 1
−3u1 sin 3x + 3u2 cos 3x = csc 3x
4
0 sin 3x
cos 3x 0
1 −3 sin 3x 1
0
4 csc 3x 3 cos 3x 1 0
4 csc 3x
1 cos 3x
u1 = =− and u2 = =− .
3 12 3 12 sin 3x
x 1
Therefore, u1 = − 12 and u2 = 36 ln | sin 3x|. Hence
x 1
yp = −
cos 3x + ln | sin 3x| sin 3x.
12 36
The general solution is thus,
y = yc + yp ,
x 1
= c1 cos 3x + c2 sin 3x − cos 3x + ln | sin 3x| sin 3x.
12 36
13