First-Order Differential Equations (continued ...)
CS 130: Mathematical Methods in Computer Science Ordinary Differential Equations Nestine Hope S. Hernandez Algorithms and Complexity Laboratory Department of Computer Science University of the Philippines, Diliman nshernandez@dcs.upd.edu.ph Day 9
First-Order Differential Equations (continued ...)
Ordinary Differential Equations
First-Order Differential Equations (continued ...) Exact Equations Equations with Homogeneous Coefficients Coefficients Linear in Two Variables solved by substitution suggested by the equation integrating factors found by inspection
First-Order Differential Equations (continued ...)
Ordinary Differential Equations
First-Order Differential Equations (continued ...) Exact Equations Equations with Homogeneous Coefficients Coefficients Linear in Two Variables solved by substitution suggested by the equation integrating factors found by inspection
First-Order Differential Equations (continued ...)
Exact Equations M (x, y)dx + N (x, y)dy = 0 is exact if and only if
∂M ∂y
=
∂N ∂x .
First-Order Differential Equations (continued ...)
Exact Equations M (x, y)dx + N (x, y)dy = 0 is exact if and only if
Example 1. (y cos x + 2xey ) + (sin x + x2 ey − 1)y 0 = 0
∂M ∂y
=
∂N ∂x .
First-Order Differential Equations (continued ...)
Exact Equations M (x, y)dx + N (x, y)dy = 0 is exact if and only if
Example 1. (y cos x + 2xey ) + (sin x + x2 ey − 1)y 0 = 0 2.
x y
y 0 + ln(xy) + 1 = 0
∂M ∂y
=
∂N ∂x .
First-Order Differential Equations (continued ...)
Exact Equations M (x, y)dx + N (x, y)dy = 0 is exact if and only if
Example 1. (y cos x + 2xey ) + (sin x + x2 ey − 1)y 0 = 0 2.
x y
y 0 + ln(xy) + 1 = 0
3. (3xy + y 2 ) dx + (x2 + xy) dy = 0
∂M ∂y
=
∂N ∂x .
First-Order Differential Equations (continued ...)
Exact Equations M (x, y)dx + N (x, y)dy = 0 is exact if and only if
∂M ∂y
=
∂N ∂x .
Example 1. (y cos x + 2xey ) + (sin x + x2 ey − 1)y 0 = 0 2.
x y
y 0 + ln(xy) + 1 = 0
3. (3xy + y 2 ) dx + (x2 + xy) dy = 0 ... (introduce an integrating factor)
First-Order Differential Equations (continued ...)
Exact Equations M (x, y)dx + N (x, y)dy = 0 is exact if and only if
∂M ∂y
=
∂N ∂x .
Example 1. (y cos x + 2xey ) + (sin x + x2 ey − 1)y 0 = 0 2.
x y
y 0 + ln(xy) + 1 = 0
3. (3xy + y 2 ) dx + (x2 + xy) dy = 0 ... (introduce an integrating factor) • If • If
1 N
“
1 M
“
∂M ∂y ∂M ∂y
− −
∂N ∂x
”
∂N ∂x
”
R
f (x)dx
−
R
= f (x), then e
= g(y), then e
is an integrating factor
g(y)dy
is an integrating factor
First-Order Differential Equations (continued ...)
Exact Equations M (x, y)dx + N (x, y)dy = 0 is exact if and only if
∂M ∂y
=
∂N ∂x .
Example 1. (y cos x + 2xey ) + (sin x + x2 ey − 1)y 0 = 0 2.
x y
y 0 + ln(xy) + 1 = 0
3. (3xy + y 2 ) dx + (x2 + xy) dy = 0 ... (introduce an integrating factor) • If • If
1 N
“
1 M
“
∂M ∂y ∂M ∂y
− −
∂N ∂x
”
∂N ∂x
”
R
f (x)dx
−
R
= f (x), then e
= g(y), then e
is an integrating factor
g(y)dy
4. y(x + y + 1) dx + x(x + 3y + 2) dy = 0
is an integrating factor
First-Order Differential Equations (continued ...)
Equations with Homogeneous Coefficients Polynomials in which all terms are of the same degree, such as x2 − 3xy + 4y 2 , x3 + y 3 , x4 y − 5x2 y 3 + 7y 5 , are called homogeneous polynomials.
First-Order Differential Equations (continued ...)
Equations with Homogeneous Coefficients Polynomials in which all terms are of the same degree, such as x2 − 3xy + 4y 2 , x3 + y 3 , x4 y − 5x2 y 3 + 7y 5 , are called homogeneous polynomials. Suppose that the coefficients M and N in an equation of order one, M (x, y)dx + N (x, y)dy = 0, are both homogeneous and are of the same degree in x and y.
First-Order Differential Equations (continued ...)
Equations with Homogeneous Coefficients Polynomials in which all terms are of the same degree, such as x2 − 3xy + 4y 2 , x3 + y 3 , x4 y − 5x2 y 3 + 7y 5 , are called homogeneous polynomials. Suppose that the coefficients M and N in an equation of order one, M (x, y)dx + N (x, y)dy = 0, are both homogeneous and are of the same degree in x and y. Then the ratio M/N is a function of y/x alone.
First-Order Differential Equations (continued ...)
Equations with Homogeneous Coefficients Polynomials in which all terms are of the same degree, such as x2 − 3xy + 4y 2 , x3 + y 3 , x4 y − 5x2 y 3 + 7y 5 , are called homogeneous polynomials. Suppose that the coefficients M and N in an equation of order one, M (x, y)dx + N (x, y)dy = 0, are both homogeneous and are of the same degree in x and y. Then the ratio M/N is a function of y/x alone.
Example 1. (x2 − xy + y 2 ) dx − xy dy = 0
First-Order Differential Equations (continued ...)
Equations with Homogeneous Coefficients Polynomials in which all terms are of the same degree, such as x2 − 3xy + 4y 2 , x3 + y 3 , x4 y − 5x2 y 3 + 7y 5 , are called homogeneous polynomials. Suppose that the coefficients M and N in an equation of order one, M (x, y)dx + N (x, y)dy = 0, are both homogeneous and are of the same degree in x and y. Then the ratio M/N is a function of y/x alone.
Example 1. (x2 − xy + y 2 ) dx − xy dy = 0 {let y = vx}
First-Order Differential Equations (continued ...)
Equations with Homogeneous Coefficients Polynomials in which all terms are of the same degree, such as x2 − 3xy + 4y 2 , x3 + y 3 , x4 y − 5x2 y 3 + 7y 5 , are called homogeneous polynomials. Suppose that the coefficients M and N in an equation of order one, M (x, y)dx + N (x, y)dy = 0, are both homogeneous and are of the same degree in x and y. Then the ratio M/N is a function of y/x alone.
Example 1. (x2 − xy + y 2 ) dx − xy dy = 0 {let y = vx} 2. xy dx + (x2 + y 2 ) dy = 0
First-Order Differential Equations (continued ...)
Equations with Homogeneous Coefficients Polynomials in which all terms are of the same degree, such as x2 − 3xy + 4y 2 , x3 + y 3 , x4 y − 5x2 y 3 + 7y 5 , are called homogeneous polynomials. Suppose that the coefficients M and N in an equation of order one, M (x, y)dx + N (x, y)dy = 0, are both homogeneous and are of the same degree in x and y. Then the ratio M/N is a function of y/x alone.
Example 1. (x2 − xy + y 2 ) dx − xy dy = 0 {let y = vx} 2. xy dx + (x2 + y 2 ) dy = 0 {let x = vy}
First-Order Differential Equations (continued ...)
Coefficients Linear in Two Variables Consider the equation (a1 x + b1 y + c1 )dx + (a2 x + b2 y + c2 )dy = 0 where the a’s,b’s,c’s are constants.
First-Order Differential Equations (continued ...)
Coefficients Linear in Two Variables Consider the equation (a1 x + b1 y + c1 )dx + (a2 x + b2 y + c2 )dy = 0 where the a’s,b’s,c’s are constants. 1. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 are parallel. 2. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 coincide. 3. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 intersect at only one point, say (h, k).
First-Order Differential Equations (continued ...)
Coefficients Linear in Two Variables Consider the equation (a1 x + b1 y + c1 )dx + (a2 x + b2 y + c2 )dy = 0 where the a’s,b’s,c’s are constants. 1. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 are parallel. 2. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 coincide. 3. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 intersect at only one point, say (h, k). Consider Case (3): use the substitution x = u + h and y = v + k.
First-Order Differential Equations (continued ...)
Coefficients Linear in Two Variables Consider the equation (a1 x + b1 y + c1 )dx + (a2 x + b2 y + c2 )dy = 0 where the a’s,b’s,c’s are constants. 1. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 are parallel. 2. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 coincide. 3. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 intersect at only one point, say (h, k). Consider Case (3): use the substitution x = u + h and y = v + k.
Example (x + 2y − 4) dx − (2x + y − 5) dy = 0
First-Order Differential Equations (continued ...)
Coefficients Linear in Two Variables Consider the equation (a1 x + b1 y + c1 )dx + (a2 x + b2 y + c2 )dy = 0 where the a’s,b’s,c’s are constants. 1. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 are parallel. 2. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 coincide. 3. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 intersect at only one point, say (h, k). Consider Case (3): use the substitution x = u + h and y = v + k.
Example (x + 2y − 4) dx − (2x + y − 5) dy = 0 how about for case (2)?
First-Order Differential Equations (continued ...)
Coefficients Linear in Two Variables Consider the equation (a1 x + b1 y + c1 )dx + (a2 x + b2 y + c2 )dy = 0 where the a’s,b’s,c’s are constants. 1. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 are parallel. 2. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 coincide. 3. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 intersect at only one point, say (h, k). Consider Case (3): use the substitution x = u + h and y = v + k.
Example (x + 2y − 4) dx − (2x + y − 5) dy = 0 how about for case (2)? - can be reduced to a separable equation
First-Order Differential Equations (continued ...)
Coefficients Linear in Two Variables Consider the equation (a1 x + b1 y + c1 )dx + (a2 x + b2 y + c2 )dy = 0 where the a’s,b’s,c’s are constants. 1. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 are parallel. 2. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 coincide. 3. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 intersect at only one point, say (h, k). Consider Case (3): use the substitution x = u + h and y = v + k.
Example (x + 2y − 4) dx − (2x + y − 5) dy = 0 how about for case (2)? - can be reduced to a separable equation how about for case (1)?
First-Order Differential Equations (continued ...)
Coefficients Linear in Two Variables Consider the equation (a1 x + b1 y + c1 )dx + (a2 x + b2 y + c2 )dy = 0 where the a’s,b’s,c’s are constants. 1. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 are parallel. 2. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 coincide. 3. The lines a1 x + b1 y + c1 = 0 and a2 x + b2 y + c2 = 0 intersect at only one point, say (h, k). Consider Case (3): use the substitution x = u + h and y = v + k.
Example (x + 2y − 4) dx − (2x + y − 5) dy = 0 how about for case (2)? - can be reduced to a separable equation how about for case (1)? - see next slide
First-Order Differential Equations (continued ...)
by substitution suggested by the equation
Solve the equation (x + 2y − 1) dx + 3(x + 2y) dy = 0
First-Order Differential Equations (continued ...)
by substitution suggested by the equation
Solve the equation (x + 2y − 1) dx + 3(x + 2y) dy = 0
Let v = x + 2y.
First-Order Differential Equations (continued ...)
by substitution suggested by the equation
Solve the equation (1 + 3x sin y) dx − x2 cos y dy = 0
First-Order Differential Equations (continued ...)
by substitution suggested by the equation
Solve the equation (1 + 3x sin y) dx − x2 cos y dy = 0
Let v = sin y.
First-Order Differential Equations (continued ...)
by substitution suggested by the equation
Solve the equation (3 tan x − 2 cos y) sec2 x dx + tan x sin y dy = 0
First-Order Differential Equations (continued ...)
by substitution suggested by the equation
Solve the equation (3 tan x − 2 cos y) sec2 x dx + tan x sin y dy = 0
Let v = tan x.
First-Order Differential Equations (continued ...)
integrating factors found by inspection Recall exact differentials such as d(xy) = xdy + ydx ydx − xdy x = d y y2 y xdy − ydx d = x x2 y xdy − ydx d arctan = x x2 + y 2
First-Order Differential Equations (continued ...)
integrating factors found by inspection Recall exact differentials such as d(xy) = xdy + ydx ydx − xdy x = d y y2 y xdy − ydx d = x x2 y xdy − ydx d arctan = x x2 + y 2
Example 1. y dx + (x + x3 y 2 ) dy = 0
First-Order Differential Equations (continued ...)
integrating factors found by inspection Recall exact differentials such as d(xy) = xdy + ydx ydx − xdy x = d y y2 y xdy − ydx d = x x2 y xdy − ydx d arctan = x x2 + y 2
Example 1. y dx + (x + x3 y 2 ) dy = 0 2. y(x3 − y) dx − x(x3 + y) dy = 0
First-Order Differential Equations (continued ...)
integrating factors found by inspection Recall exact differentials such as d(xy) = xdy + ydx ydx − xdy x = d y y2 y xdy − ydx d = x x2 y xdy − ydx d arctan = x x2 + y 2
Example 1. y dx + (x + x3 y 2 ) dy = 0 2. y(x3 − y) dx − x(x3 + y) dy = 0 3. 3x2 y dx + (y 4 − x3 ) dy = 0
First-Order Differential Equations (continued ...)
Questions? See you next meeting!