FIRST-ORDER ORDINARY DIFFERENTIAL EQUATIONS G(x, y, y ′ ) = 0 ♦ in normal form: y ′ = F (x, y) ♦ in differential form: M (x, y)dx + N (x, y)dy = 0 • Last time we discussed first-order linear ODE: y ′ + q(x)y = h(x). We next consider first-order nonlinear equations. NONLINEAR FIRST-ORDER ODEs • No general method of solution for 1st-order ODEs beyond linear case; rather, a variety of techniques that work on a case-by-case basis. Examples: i) Bring equation to separated-variables form, that is, y ′ = α(x)/β(y); then equation can be integrated. Cases covered by this include y ′ = ϕ(ax + by); y ′ = ϕ(y/x). ii) Reduce to linear equation by transformation of variables. Examples of this include Bernoulli’s equation. iii) Bring equation to exact-differential form, that is M (x, y)dx + N (x, y)dy = 0 such that M = ∂φ/∂x, N = ∂φ/∂y. Then solution determined from φ(x, y) = const. • Useful reference for the ODE part of this course (worked problems and examples) Schaum’s Outline Series Differential Equations R. Bronson and G. Costa McGraw-Hill (Third Edition, 2006) ♦ Chapters 1 to 7: First-order ODE. First order nonlinear equations Although no general method for solution is available, there are several cases of physically relevant nonlinear equations which can be solved analytically : Separable equations dy f ( x ) = dx g ( y ) Solution : ! g ( y)dy =! f ( x)dx dy = y 2e x dx Ex 1 i.e !1 x =e +c y or y= ! " dy = " e dx y x 2 !1 (e x + c) Almost separable equations dy = f (ax + by ) dx Change variables : dz = a + bf ( z ) ! dxx Ex 2 dy = (!4 x + y ) 2 dx 1 4 x = ln( dz dx z = ax + by z !2 z+2 )+C x=! = a + b ddyx 1 dz . (a + bf ( z )) z = y ! 4x " ! dz dy = "4 + = z2 " 4 dx dx 4x y = 4 x + 2 (1(1+! kkee4 x )) k a constant Homogeneous equations dy = f ( y /x). dx The equation is invariant under x ! sx, y = vx " Solution i.e. v ' = " dv f (v) ! v y ! sy .... homogeneous y! = v'x + v. 1 ( f (v) ! v) x = " dx = ln x + constant. x Ex 3 Change variables xy dy ! y 2 = ( x + y ) 2 e ! y /x dx y = vx " (1 + v) 2 ! v (v"x + v) ! v = e v Homogeneous y! = v!x + v. e v vdv # ln x = $ . (1 + v) 2 u ! 1+ v To evaluate integral change variables u 1 1 u !1 e e " ( ! 2 )e du = e [ ]. u u u !1 y x i.e. ln x = e 1+ y x Homogeneous but for constants dy x + 2 y + 1 = dx x + y + 2 x = x '+ a, y = y '+ b ! dy dy ' dy ' dx ' dy ' = = . = dx dx dx ' dx dx ' 1 + a + 2b = 0 dy ' x '+ 2 y '+ 1 + a + 2b = dx ' x '+ y '+ 2 + a + b dy ' x '+ 2 y ' = dx ' x '+ y ' a = !3, b = 1 2+a+b = 0 Homogeneous The Bernoulli equation dy + P( x) y = Q( x) y n , dx To solve, change variable to Gives the equation Ex 4 y '+ y = y 2/3 n !1 z=y 1! n " dz dy = (1 ! n) y ! n dx dx dz + (1 ! n) P( x) z = (1 ! n)Q( x) dx z=y 1! n =y 1/ 3 1st order Linear z 1 ! z '+ = 3 3 1st order linear Integrating factor e x/3 ! ze x / 3 = " e x / 3 dx / 3 z = y1/ 3 = 1 + ce ! x / 3 Exercise: Solve the equation 2 y ′ = y/x + x2 /y with initial condition y(1) = 2. • This equation is Bernoulli with n = −1. • Set z = y 2 . Then z ′ − z/x = x2 . • Integrating factor I(x) = 1/x Z ⇒ z(x) = x [ dx x2 /x + const.] = x3 /2 + const. x Thus y = z 1/2 p = ± x3 /2 + const. x • Initial condition y(1) = 2 r x3 + 7x ⇒ y(x) = 2 Homework 1. 2 Solve the differential equation dy y(x + y) = dx x2 “homogeneous” with y(1) = −1. √ [Answ.: y = x/(1 − 2 x)] 2. Solve the differential equation dy + xy = xy 2 dx “Bernoulli” with y(0) = 1/2. 2 [Answ.: y = 1/(1 + ex /2 )] Exact equations • A first-order ODE M (x, y)dx + N (x, y)dy = 0 is exact if there exists a function φ(x, y) such that ∂φ =M , ∂x ∂φ =N . ∂y • In this case the differential equation can be recast as dφ = M (x, y)dx + N (x, y)dy = 0 so that the solution to it is determined by φ(x, y) = constant . Example: Solve the equation xy ′ = −2 tan y. • This equation can be rewritten as 2x sin y dx + x2 cos y dy = 0 , i.e., M (x, y) = 2x sin y , N (x, y) = x2 cos y , which is exact because ∂φ = 2x sin y ⇒ φ(x, y) = x2 sin y + α(y) ∂x ∂φ = x2 cos y ⇒ x2 cos y + α′ (y) = x2 cos y ⇒ α = constant ∂y • Therefore φ(x, y) = x2 sin y + c, and the general solution is determined by x2 sin y = const.: 2 ⇒ y(x) = arcsin const./x DIFFERENTIAL EQUATIONS AND FAMILIES OF CURVES • General solution of a first-order ODE y ′ = f (x, y) contains an arbitrary constant: y = (x, c) ⊲ one curve in x, y plane for each value of c ⊲ general solution can be thought of as one-parameter family of curves Example: y ′ = −x/y. Z Z separable equation ⇒ y dy = − x dx ⇒ y 2 /2 = −x2 /2 + c i.e., x2 + y 2 = constant : family of circles centered at origin y x Fig.1 Orthogonal trajectories • Given the family of curves representing solutions of ODE y ′ = f (x, y), orthogonal trajectories are given by a second family of curves which are solutions of y ′ = −1/f (x, y). ♦ Then each curve in either family is perpendicular to every curve in the other family. Example: Find the orthogonal trajectories to the family of circles y ′ = −x/y. • Solve y ′ = y/x . dx dy = ⇒ ln y = ln x + constant ⇒ y x i.e., y = cx : family of straight lines through the origin Z Z Homework a) Find the family of curves corresponding to solutions of the ODE y ′ = (y 2 − x2 )/(2xy). b) Find the orthogonal trajectories to the above family of curves. • homogeneous equation y ′ = f (y/x) with f (y/x) = (y/x − x/y)/2 solvable by y→v = y/x and separation of variables ⇒ x2 + y 2 = cx : family of circles tangent to y − axis at 0 y x Fig.2 • orthogonal trajectories found by solving y ′ = −2xy/(y 2 − x2 ) ⇒ x2 + y 2 = ky : family of circles tangent to x − axis at 0 EXPLOITING FIRST-ORDER METHODS TO TREAT EQUATIONS OF HIGHER ORDER IN SPECIAL CASES ♣ y not present in 2nd-order equation F (x, y, y ′ , y ′′ ) = 0 ⇒ setting y ′ = q yields 1st-order equation for q(x). ♣ x not present in 2nd-order equation F (x, y, y ′ , y ′′ ) = 0 ⇒ setting y ′ = q, y ′′ = dq/dx = q(dq/dy) yields G(y, q, dq/dy) = 0. Example: homogeneous, flexible chain hanging under its own weight y θ s ρ = linear mass density T T x Using Newton’s law, the shape y(x) of the chain obeys the 2nd−order nonlinear differential equation y =a Setting y = q 1 + (y ) 2 q =a , a 1+q2 ρ g/T • Separation of variables ⇒ Z 1 p dq = a 2 1+q • Using q = dy/dx = 0 at x = 0 ⇒ ln(q + p Z dx 1 + q 2 ) = ax • Solving for q ⇒ q = dy/dx = (eax − e−ax )/2 1 1 eax + e−ax + constant = cosh ax + constant Thus y(x) = a 2 a This curve is called a catenary. Historical note. The problem of the catenary was the subject of a challenge posed by Jakob Bernoulli in 1690, in response to which the problem was solved the following year indipendently by Johann Bernoulli, Leibniz and Huygens. Homework 1. Find the function y(x) obeying the differential equation y ′2 = x2 y ′′ and the conditions y(0) = 2, y ′ (1) = 2. [Hint: set y ′ = q and apply separation of variables.] [Answ.: y(x) = 2(1 − x) − 4 ln(1 − x/2)] 2. Find the function y(x) obeying the differential equation y ′′ = y ′ ey and the conditions y(0) = 0, y ′ (0) = 1. [Hint: y ′ = q; y ′′ = dq/dx = q(dq/dy); solve equation for q(y).] [Answ.: y(x) = − ln(1 − x)] Summary ♦ No general method of solution for 1st-order ODEs beyond linear case; rather, a variety of techniques that work on a case-by-case basis. Main guiding criteria: • methods to bring equation to separated-variables form • methods to bring equation to exact differential form • transformations that linearize the equation ♦ 1st-order ODEs correspond to families of curves in x, y plane ⇒ geometric interpretation of solutions ♦ Equations of higher order may be reduceable to first-order problems in special cases — e.g. when y or x variables are missing from 2nd order equations