University of Johannesburg Faculty of Science Department of Mathematics and Applied Mathematics Lecturers: PG Dlamini, IK Letlhage & SM Simelane First-order Ordinary Differential Equations 1. Homogeneous differential equations We usually solve a differential equation by recognizing it as a certain kind of equation (say, separable) and then carry out a procedure, consisting of equation specific mathematical steps, that yields a function that satisfies the equation. In some instances, it is impossible to separate the variables in a given differential equation of the form dy = f (x, y), dx for instance in the DE x + 4y dy = . dx 3x For the DE above, we observe that the total degree of x and y is the same. In this case, the degree of x is one and the degree of y is also one. Such differential equations are said to be homogeneous. 1.1. Definition Definition 1. A first-order differential equation in the form M(x, y) dx + N(x, y) dy = 0 (1) (Standard Form) is said to be homogeneous if both coefficients M(x, y) and N(x, y) are homogeneous functions of the same degree. In other words, equation 1 is homogeneous if M(tx, ty) = ta M(x, y) and N(tx, ty) = ta N(x, y) (2) Example 1: Determine if the differential equations are homogeneous. 1. (y2 − x2 ) dx − 2xy dy = 0 Solution: Let M(x, y) = y2 − x2 and N(x, y) = −2xy. Then M(tx, ty) = (tx)2 − (ty)2 and N(tx, ty) = −2(tx)(ty) =t y −t x = − 2t2 xy = t2 (y2 − x2 ) =t2 (−2xy) = t2 M(x, y) =t2 N(x, y) 2 2 2 2 Thus, the DE is homogeneous because both M and N are homogeneous functions of degree a = 2. dy 2. (2y − x) = 2x + y dx Solution: Write the DE in standard form as (2y − x) dy − (2x + y) dx = 0. Let M(x, y) = −(2x + y) and N(x, y) = 2y − x. Then M(tx, ty) = −(2(tx) + (ty)) and N(tx, ty) = 2(ty) − tx = −t(2x + y) =t(2y − x) = tM(x, y) =tN(x, y) The DE is homogeneous because both M and N are homogeneous functions of degree a = 1. 1 1.2. Method of solution For homogeneous differential equations, we make use of a substitution y = vx, (3) where v is a function of x. Making this substitution will reduce the original (inseparable) equation to a separable equation. In general, if y = vx, then the derivative of y is dy d = (vx). dx dx Since v is a function of x, we need to use the product rule of differentiation to obtain dy dv = x + v. dx dx (4) Note: The word homogeneous as used here does not mean the same as it does in the classical sense when applied to linear differential equations. Example 2: Solve x + 4y dy = dx 3x Solution: Observe that the equation is not separable. The degree in x and y are the same, both of degree one. Hence, the DE is homogeneous and we may use the substitution y = vx. Let y = vx, then dy dv x + 4vx = x +v= dx dx 3x Make dv the subject of the formula dx x dv x + 4vx = −v dx 3x x + 4vx − 3xv = 3x x + vx = 3x x(1 + v) = 3x 1+v = 3 Separate the x factors from the v factors 1 3 dv = dx 1+v x Integrate 3 ln |1 + v| = ln |x| + c If we convert c to a logarithmic, say ln A = c, then ln (1 + v)3 = ln |x| + ln |A| ←− (a ln b = ln ba ) = ln (Ax) (1 + v) = Ax 3 2 Since y = vx, we substitute back v = y x y 3 1+ = Ax x Example 3: Solve xy Solution: Write DE in standard form dy = 2y2 + 4x2 dx dy 2y 4x = + dx x y Observe that the equation is not separable. The degree in x and y are the same, both of degree one. Hence, the DE is homogeneous and we may use the substitution y = vx. dv dy = x + v so that Let y = vx, then dx dx x Make dv 2y 4x 4 +v= + = 2v + dx x y v dv the subject of the formula dx x dv 4 =v+ dx v 2 v +4 = v Separate the x factors from the v factors v 1 dv = dx x v2 + 4 Integrate 1 ln |v2 + 4| = ln x + c 2 √ ln v2 + 4 = ln (Ax) √ v2 + 4 = Ax Since y = vx, =⇒ v = y 1 x and = x v y s y2 + 4 = Ax x2 Or q y2 + 4x2 = Ax2 y2 + 4x2 = Ax4 3 Exercises Solve the following differential equations 1. (y2 − x2 ) dx − 2xy dy = 0 dy 2. (x3 + 3xy2 ) = y3 + 3x2 y if the solution curve passes the point (2,1) dx x 2 + y2 dy = 3. dx xy dy 2xy + 3y2 = 2 4. dx x + 2xy dy = x+y 5. (x − y) dx q dy 6. First prove that x = x2 + y2 + y is homogeneous and solve. dx y y y 7. x sin − y cos dx + x cos dy = 0 x x x dy 2 dy 2 8. x = y − xy given that y(1) = 1 dx√ dx 9. (x + xy) dy − y dx = 0 given that y(1) = 1 10. Please see exercises in the prescribed textbook y2 + x2 = Ax 2 2 2 xy = x − y2 9 y2 = 2x2 (ln |x| + c) xy + y2 = Ax3 p y = ln A x2 + y2 x y sinh−1 = ln |x| + c x y c sin = x x tan−1 y=e x−y x 4x = y (ln |y| + 2)2 2. Exact differential equations The differential equation 2y dx+2x dy = 0 is variable separable. However, we can solve it in an alternative manner by first establishing that the DE is exact. In this section, we discus exact differential equations and their method of solution. 2.1. Definition Definition 2. A differential equation of the form M(x, y) dx + N(x, y) dy = 0 (Standard Form) (5) is said to be an exact equation if the expression on the left side is an exact differential. The necessary and sufficient condition that M(x, y) dx + N(x, y) dy = 0 be an exact differential equation is ∂M ∂N = ∂y ∂x (6) 2.2. Method of solution If given a DE of the form M(x, y) dx + N(x, y) dy = 0, first determine whether the DE is exact. If so, then there exists a function f for which ∂f = M(x, y). (7) ∂x We can find f by integrating M(x, y) with respect to x while holding y constant Z f (x, y) = M(x, y) dx + g(y), (8) 4 where g(y) is an arbitrary function and is the “constant” of integration. Now differentiate equation 8 above with respect to y and assume that ∂∂yf = N(x, y): ∂f ∂ = ∂y ∂y Z M(x, y) dx + g0 (y) = N(x, y). This results in g0 (y) = N(x, y) − ∂ ∂y (9) Z M(x, y) dx. (10) Lastly, integrate equation 10 with respect to y and substitute the result in equation 8. The implicit solution of the DE is f (x, y) = c. Note: If you find integrating M(x, y) with respect to x difficult, then start the process by first integrating N(x, y) with respect to y so that the analogues to equations 8 and 10, respectively, are Z Z ∂ f (x, y) = N(x, y) dy + h(x) and h0 (x) = M(x, y) − N(x, y) dy. (11) ∂x Example 1: Solve the DE (2xy + 4) dx + (x2 − 1) dy = 0 Solution: Step 1: First check if the DE is written in the standard form M(x, y) dx + N(x, y) dy = 0. Note that it is already written in standard form with M = 2xy + 4 and N = x2 − 1. ∂M ∂N = : ∂y ∂x Step 2: Test whether the equation is exact. That is check whether ∂M = 2x ∂y Since ∂N = 2x ∂x and ∂M ∂N = = 2x, we conclude that the differential equation is exact. ∂y ∂x Step 3: Find the solution Since the DE is exact, then there exists a function f (x, y) such that ∂f = 2xy + 4 ∂x and ∂f = x2 − 1 ∂y Integrating 2xy + 4 with respect to x, we obtain f (x, y) = x2 y + 4x + g(y) Taking the partial derivative of the equation above with respect to y and setting the result to N(x, y) gives ∂f = x2 + g0 (y) = x2 − 1 ∂y ←− N(x, y) It then follows that g0 (y) = −1 and 5 g(y) = −y Hence, f (x, y) = x2 y + 4x − y, and so the solution of the equation in implicit form is x2 y + 4x − y = c The explicit form of the solution is y= c − 4x x2 − 1 and valid for x , 1 and x , −1. Example 2: Solve the DE e x sin y dx + (2y + e x cos y) dy = 0 Solution: Step 1: First check if the DE is written in the standard form M(x, y) dx + N(x, y) dy = 0. Note that it is already written in standard form with M = e x sin y and N = 2y + e x cos y. Step 2: Test whether the equation is exact. That is check whether ∂M = e x cos y ∂y Since ∂M ∂N = : ∂y ∂x ∂N = e x cos y ∂x and ∂M ∂N = = e x cos y, we conclude that the differential equation is exact. ∂y ∂x Step 3: Find the solution Since the DE is exact, then there exists a function f (x, y) such that ∂f = e x sin y ∂x ∂f = 2y + e x cos y ∂y and Integrating e x sin y with respect to x, we obtain f (x, y) = e x sin y + g(y) Taking the partial derivative of the equation above with respect to y and setting the result to N(x, y) gives ∂f = e x cos y + g0 (y) = 2y + e x cos y ∂y ←− N(x, y) It then follows that g0 (y) = 2y and g(y) = y2 Hence, f (x, y) = e x sin y + y2 , and so the solution of the equation in implicit form is e x sin y + y2 = c Example 3: Solve the initial value problem dy xy2 − cos x sin x = , dx y(1 − x2 ) 6 subject to y(0) = 2. Solution: Step 1: Write the DE in standard form (xy2 − cos x sin x) dx − y(1 − x2 ) dy = 0. Hence, M = xy2 − cos x sin x and N = −y(1 − x2 ). Step 2: Test whether the equation is exact: ∂M = 2xy ∂y Since ∂N = 2xy ∂x and ∂M ∂N = = 2xy, we conclude that the differential equation is exact. ∂y ∂x Step 3: Find the solution Since the DE is exact, then there exists a function f (x, y) such that ∂f = −y(1 − x2 ) ∂y ∂f = xy2 − cos x sin x ∂x and Integrating −y(1 − x2 ) with respect to y, we obtain f (x, y) = − y2 (1 − x2 ) + h(x) 2 Taking the partial derivative of the equation above with respect to x and setting the result to M(x, y) gives ∂f = xy2 + h0 (x) = xy2 − cos x sin x ∂x ←− M(x, y) It then follows that h0 (x) = −cos x sin x and Integrating yield h(x) = − = 2 Hence, the f (x, y) = − y2 (1 − x2 ) + 1 2 Z cos x sin x dx 1 cos2 x 2 cos2 x, and so the solution of the equation in implicit form is 1 y2 cos2 x − (1 − x2 ) = c 2 2 or cos2 x − y2 (1 − x2 ) = c1 Since y(0) = 2, c1 = −3. The implicit solution of the problem is cos2 x − y2 (1 − x2 ) = −3 7 Exercises Solve the following differential equations 1. (e2y − y cos xy) dx + (2xe2y − x cos xy + 2y) dy = 0 y x dx + 2 dy = 0 2. 2 2 x +y x + y2 ! 1 3. + cos x − 2xy dy = y(y + sin x) dx subject to y(0) = 1. 1 + y2 4. y dx + x dy = 0 5. (y + e x ) dx + x dy = 0 6. sinh x !sinh y dx + cosh x cosh x dy = 0 1 7. + y dx + (3y2 + x) dy = 0 x 8. Please see exercises in the prescribed textbook c Compiled by SM Simelane 8 x e2y − sin xy + y2 = c x2 + y2 = c xy2 − y cos x − tan−1 y + 1 + tan−1 = 0 xy = c xy + e x = c cosh x sinh y = c ln |x| + xy + y3 = c