EXPLICIT SOLUTIONS TO FIRST ORDER DIFFERENTIAL EQUATIONS OF SPECIAL TYPES Abstract. This is a summary of the methods that we have covered so far for solving first order differential equations of the form y 0 = f (x, y) for certain special classes of functions f (x, y). We shall always assume that f (x, y) is continuous on some rectangle a < x < b, c < y < d which may be infinite in either the x direction or the y direction. Contents 1. Simplest case: f (x, y) independent of y, y 0 = f (x) (x) 2. Separation of variables: y 0 = f (x, y) = −M N (y) 3. Linear equations: y 0 = f (x, y) = −P (x)y + Q(x), or y 0 + P (x)y = Q(x) (x,y) 4. Exact equations: y 0 = −M or M (x, y) + N (x, y)y 0 = 0 N (x,y) when ∂M (x,y) ∂y = ∂N (x,y) ∂x 1 2 3 4 1. Simplest case: f (x, y) independent of y, y 0 = f (x) A differential equation of the form y 0 = f (x) for f (x) a continous function on a < x < b is solved in one step by integration. The general solution with free parameter c is Z x y(x) = f (t)dt + c. (1) x0 If we add the initial condition y(x0 ) = y0 the solution is Z x y(x) = f (t)dt + y0 . x0 This follows from the fundamental theorem of calculus, which tells us that the Riemann integral is an antiderivative, that is Z x d f (t)dt = f (x). dx x0 1 EXPLICIT SOLUTIONS TO FIRST ORDER DIFFERENTIAL EQUATIONS OF SPECIAL TYPES 2 We can also use the indefinite integral to express the general solution Z y(x) = f (x)dx, which is just another notation for (1). 2. Separation of variables: y 0 = f (x, y) = −M (x) N (y) In this case it is convenient to write the differential equation in the form M (x) + N (y)y 0 = 0. (2) Again the equation can be solved very quickly using integration. Let F (x) be an antiderivative of M (x) and G(y), an antiderivative of N (y), that is d d F (x) = M (x) and G(y) = N (y). dx dy The solution to (2) is given by the following equation for the function y(x): F (x) + G(y(x)) = c. (3) That (3) defines a solution to (2) follows from the chain rule for differentiation, d d dy G(y(x)) = G(y) . dx dy dx This implies that any differential function y(x) satisying (3) will satisfy the differentiated equation d dy d F (x) + G(y) M (x) + N (y)y 0 = dx dy dx d = (F (x) + G(y)) dx dc because of (3) = dx = 0. We can write the solution (3) in abbreviated form Z Z M (x)dx + N (y)dy = c. How do we know there exists a function y(x) satisfying (3). The Implicit Function Theorem states that if F (x, y) has continous partial derivatives, (x0 , y0 ) satisfies the equation F (x0 , y0 ) = 0, and ∂F (x∂y0 ,y0 ) 6= 0, then there exists a differentiable function y(x) defined in a neighborhood of x0 satisfying F (x, y(x)) = 0 and y(x0 ) = y0 . In our case EXPLICIT SOLUTIONS TO FIRST ORDER DIFFERENTIAL EQUATIONS OF SPECIAL TYPES 3 the functions F (x) and G(y) are continously differentiable, so the only conditions we need to check are F (x0 ) + G(y0 ) = 0 and G0 (y0 ) 6= 0. Example. Consider the equation D.E. x + yy 0 = 0 I.C. y(1) = 1. R R The general solution is xdx + ydy = c, or 1 2 1 2 x + y = c. 2 2 Substituting x = 1, y(1) = 1 gives c = 1, multiplying everything by 2 the equation becomes x2 + y 2 = 2, (4) √ This is the equation of a circle of radius 2. Given a point (x0 , y0 ) √ 0 (0) = 0, on the circle other than the points √ (± 2, 0)√where G (0) = N√ there is a neighborhood of x0 , − 2 < x < 2, where y(x) = 2 − x2 defines a differentiable function of x such that x2 + y(x)2 = 2. The equation of the circle x2 + y 2 = a2 is a good example for understanding the implicit function theorem. 3. Linear equations: y 0 = f (x, y) = −P (x)y + Q(x), or y 0 + P (x)y = Q(x) The homogeneous linear equation y 0 + P (x)y = 0 can be solved by separation of variables in the form y1 y 0 + P (x) = 0 and the solution is Z R ln|y| + P (x)dx = c, or |y(x)| = ec e− P (x)dx . Allowing for y(x) to take negative values we write y(x) = ke− R P (x)dx . The solution to the inhomogeneous equation y 0 + P (x)y = Q(x) can R be found by substituting y(x) = v(x)e− P (x)dx . The resulting equation for v(x) is v 0 (x)e− R P (x)dx R = Q(x) or v 0 (x) = Q(x)e P (x)dx , which is solved by integration giving Z Z R R R P (x)dx − P (x)dx v(x) = Q(x)e dx and y(x) = e Q(x)e P (x)dx dx. Example: D.E. y 0 + 2xy = x, I.C. y(0) = 1. EXPLICIT SOLUTIONS TO FIRST ORDER DIFFERENTIAL EQUATIONS OF SPECIAL TYPES 4 R For this example RP (x) = 2x and Q(x) = x. Then P (x)dx = R 2 2xdx = x2 and e P (x)dx = ex . Z Z R 1 2 2 P (x)dx v(x) = Q(x)e dx = xex dx = ex + c. 2 This is where the arbitrary constant in the general solution appears. The general solution is then Z R R − P (x)dx y(x) = e ( Q(x)e P (x)dx dx) 2 2 1 = e−x ( ex + c) 2 1 2 = + ce−x . 2 To satisfy the initial condition we substitute y(0) = 1 and get 1 = 2 1 + ce0 = 12 + c so c = 21 and y(x) = 21 (1 + ex . 2 An equivalent way of solving a first order linear differential equation isR to multiply the whole equation by the so-called “integrating factor” e P (x)dx giving R e R P (x)dx 0 y + P (x)e P (x)dx R y = Q(x)e P (x)dx . (5) The left hand side of this equation is a derivative R (e P (x)dx R y)0 = e R P (x)dx 0 y + P (x)e P (x)dx y. So equation (5) becomes R (e P (x)dx R y)0 = Q(x)e P (x)dx , and is solved by integration. In other words, the R R equation says that e P (x)dx y is a function whose derivative is Q(x)e P (x)dx ; hence, Z R R P (x)dx e y = Q(x)e P (x)dx dx, where the indefinite integral on the right contains an arbitrary constant. 4. Exact equations: y 0 = when −M (x,y) N (x,y) ∂M (x,y) ∂y or M (x, y) + N (x, y)y 0 = 0 = ∂N (x,y) ∂x The basic idea here is to find a condition that tells us when the expression M (x, y) + N (x, y)y 0 looks like a derivative with respect to x EXPLICIT SOLUTIONS TO FIRST ORDER DIFFERENTIAL EQUATIONS OF SPECIAL TYPES 5 of a function F (x, y(x)), that is ∂F (x, y) ∂F (x, y) 0 + y ∂x ∂y d = F (x, y(x)). dx M (x, y) + N (x, y)y 0 = This amounts to finding a function F (x, y) such that ∂F (x, y) = M (x, y) and ∂x ∂F (x, y) = N (x, y) ∂y (6) In addition, we want a proceedure for finding the function F (x, y) when possible. We saw in class that the necessary and sufficient condition for the existence of such a function is the “integrability condition” ∂M (x, y) ∂N (x, y) = . ∂y ∂x (7) Note: Equation (7) is always satified when M (x, y) is independent of y and N (x, y) is independent of x, which is exactlty the case when we can separate variables and solve as in Section 2 with a function of the form F (x) + G(y). In general, when the integrability condition (7) is satisfied, we can find the function F (x, y) in the form Z F (x, y) = M (x, y)dx + g(y), R where M (x, y)dx means an antiderivative of M (x, y) relative to differentiation in x. That is, we first find some function F0 (x, y) such that ∂F0 (x,y) = M (x, y) and then correct it by adding a function g(y) of y ∂x (x,y) = N (x, y). Condition (7) guarantees that such alone to satisfy ∂F∂y a function exists. Example: x + y + (x + y 2 )y 0 = 0. ∂M (x, y) ∂(x + y) ∂(x + y 2 ) ∂N (x, y) = =1= = ∂y ∂y ∂x ∂x Z F (x, y) = Z M (x, y)dx + g(y) = 1 (x + y)dx + g(y) = x2 + xy + g(y). 2 Differentiating in y: ∂( 21 x2 + xy + g(y)) = x + g 0 (y)? =?x + y 2 . ∂y EXPLICIT SOLUTIONS TO FIRST ORDER DIFFERENTIAL EQUATIONS OF SPECIAL TYPES 6 So we must have g 0 (y) = y 2 or g(y) = 13 y 3 . We introduce the arbitrary constant at the end in the equation 1 1 F (x, y) = x2 + xy + y 3 = c. 2 3 We don’t expect you to solve this cubic equation explicitly for y(x). Final example: xy 0 + (x2 + 2y) = 0. In this case ∂M (x, y) ∂(x2 + 2y) = =2 ∂y ∂y ∂N (x, y) ∂(x) = 6= ∂x ∂x What to do? If we divide by x we convert the equation to the linear equation y 0 + x2 y = −x. Then we remultiply by the “integrating factor” R e P (x)dx = e2ln|x| = |x|2 = x2 to get the equation x2 y 0 + 2xy = −x3 or x2 y 0 + (x3 + 2xy) = 0, which is equivalent to the original equation at all points where x 6= 0. This new equation does satisfy the integrability condition and the solution to the differential equation is x2 y + 41 x4 = c, that is, 1 c y = 2 − x2 . x 4 Checking that we have a solution, c 1 c 1 xy 0 = x(−2 3 − x) = −2 2 − x2 x 2 x 2 and xy 0 + 2y = −x2 , as desired. The point of this example is to show that sometimes playing with the equation a little gives an equivalent form which can be solved explicitly.