SMA 208: Ordinary differential equations I First Order differential equations Lecturer: Dr. Philip Ngare (Contacts: pngare@uonbi.ac.ke, Tue 12-2 PM) School of Mathematics, University of Nairobi Feb 26, 2013 P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 1 / 26
Introduction: Classification of Differential Equations (1) Ordinary and Partial differential equations We can classify differential equations based on whether the unknown function depends on a single independent variable (Ordinary) or several independent variables (partial differential equations). That is dy(x) = dy(x) dx (Ordinary DE) dx z(x, y) z(x, y) dz(x, y) = dx + dy x y (Partial DE) P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 2 / 26
(2) Systems of Differential equations We can classify differential equations depending on the number of unknown functions that are involved. If there is a single function to be determined, then one equation is sufficient. However, if there are two or more unknown function, then a system of equation is required. For example the Lotka-Voltera or predator-prey, equation are important in ecological modeling. They have the form dx dy = ax αxy = cy + γxy (1) where x(t) and y(t) are respectively population of the prey and predator species. The constants a, α, c and γ are based on empirical observations and depends on the particular species being studied. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 3 / 26
(3) Order The order of a differential equation is the order of the highest derivatives that appears in the equation. More generally, the equation F [t, y, y,, y (n) ] = 0 is an ODE of the nth order. (4) Linear or Nonlinear equation The ODE F (t, y, y,, y (n) ) = 0 is linear if F is a linear function of the variables y, y,, y (n). Thus the general linear ODE of order n is a 0 (t)y (n) + a 1 (t)y (n 1) + +a n (t)y = g(t) (2) An equation that is not of the form (2) is nonlinear equation. Example y + 2e t y + yy = t 4 Is nonlinear because of the terms that involved the product yy while (1) is nonlinear because of terms that involve product xy. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 4 / 26
Example A simple physical problem that leads to a nonlinear differential equation is the oscillation pendulum. The angle θ that an oscillating pendulum of length L makes with the vertical direction satisfies the equation d 2 θ 2 + g L sinθ = 0 The presence of the term involving sin θ makes above equation nonlinear. But if the angle is small, then sin θ θ and above equation can be approx by linear d 2 θ 2 + g L θ = 0 The process of approximating a nonlinear equation by a linear one is called Linearisation and it is an extremely valuable way to deal with nonlinear equations. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 5 / 26
First order differential equation Remark This section deals with differential equation of first order dy where f is a given function of two variables. = f (t, y) (3) Any differential function y = φ(t) that satisfies this equation for all t in some interval is called a solution Our objective is to determine whether such functions (solution) exist and if so, to develop methods for finding them. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 6 / 26
Linear equation with constant coefficients If the function f in equation (3) depends linearly on the dependent variables y, then equation (3) is called a first order linear equation. A typical example is dy = ay + b (4) where a and b are given constants. Equation (4) can be solved by straightforward integration method dy/ y (b/a) = a = y = (b/a) + ce at P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 7 / 26
Questions Solve the following ordinary differential equations 1 dv = 9.8 v 5 2 dp = 0.5p 450 3 dm = 500 0.4M 4 dq = 3 0.0003Q dy 5 + 2y = 3 P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 8 / 26
Linear equations with variable coefficients (1) Method of Integrating factor We will usually write the general first order linear equation in the form dy + p(t) = g(t), (5) where p and g are given functions of the independent variables t. However, this direct method of solution cannot be used to solve the general equation (5). In this case we use the method due to Leibniz; it involves multiplying the differential equation (5) by certain function µ(t) (called an integrating factor) chosen so that the resulting equation us readily integrable. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 9 / 26
Example Use the method of integrating factor to solve the following ordinary differential equation dy + p(t)y = g(t) where p and g are given functions. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 10 / 26
Solution Multiplying both sides by undetermined function µ(t), µ(t) dy + p(t)µ(t)y = µ(t)g(t) (6) = dµ(t) = p(t)µ(t) ln µ(t) = p(t) + k = µ(t) = exp p(t) Returning to equation (6), we have d [µ(t)y] = µ(t)g(t) = µ(t)y = µ(s)g(s)ds + c So the general solution of equation (6) is y = µ(s)g(s)ds+c µ(t) P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 11 / 26
Questions Use the method of integrating factor to solve the following differential equations: 1 2 3 4 dy + 2y = 3 dy + ay = b dy 2y = 4 t dy + 1 2 y = 2 + t, Sketch several solution and find the particular solution whose graph contains the point (0, 2). 5 Solve the initial value problem ty + 2y = 4t 2, y(1) = 2 6 Consider the initial value problem y + 1 2y = 2 cos t, y(0) = 1, find the coordinates of the first local maximum points of the solution for t > 0. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 12 / 26
Questions (7) Find the general solution of the given differential equation and use it to determine how solution behaves as t = (i) y + (1/t)y = 3 cos 2t, t > 0 (ii) (1 + t 2 )y + 4ty = (1 + t 2 ) 2 (8) (Variation of Parameters) Consider the following methods of solving the general linear equation of first order: y + p(t)y = g(t) (i) If g(t) is identically zero, show that the solution is y = A exp[ p(t)] where A is a constant (ii) If g(t) is not identically zero, assume that the solution is of the form y = A(t) exp[ p(t)], where A is now a function of t. By substituting for y in the given differential equation, show that A(t) must satisfy the condition A (t) = g(t) exp[ p(t)]. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 13 / 26
Solution (1) Consider dy + 2y = 3 Multiply above equation by µ(t)(yet to be determined) µ(t) dy + 2µ(t)y = 3µ(t) (7) Recall that d [µ(t)y] = µ(t)dy + dµ(t) y (8) Comparing equation (7) and (8), we notice that we should choose µ(t) such that, dµ(t) = = 2µ(t) dµ(t) µ(t) = 2 = µ(t) = 2t + c = µ(t) = ce 2t P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 14 / 26
Suppose we choose C = 1 and multiplying our original equation by the integrating factor e 2t, we obtain 2t dy e + 2e2t y = 3e 2t = d (e2t y) = 3e 2t = e 2t y = 3 2 e2t + c y = 3 2 + ce 2t We notice that the solution converges to the equilibrium solution y = 3 2 which corresponds to c = 0. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 15 / 26
Solution (5) Given ty + 2y = 4t 2 The above equation can further be written as y + (2/t)y = 4t (9) So p(t) = 2/t and g(t) = 4t. To solve equation (9) we first compute the integrating factor µ(t) : 2 µ(t) = exp p(t) = exp( t ) = e2 ln t = t 2 Multiplying (9) by µ(t) = t 2, we obtain t 2 y + 2ty = (t 2 y) = 4t 3 = t 2 y = t 4 + c, c is an arbitrary constant. It follows that y = t 2 + c. t 2 To satisfy the initial condition above, it is necessary to choose c = 1, thus y = t 2 + 1 t 2, t > 0. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 16 / 26
Separable Equation Consider the first order differential equation dy = f (x, y) dx and assume that it s nonlinear. Suppose that we could write the above equation as M(x, y) + N(x, y) dy dx = 0 (10) i.e set M(x, y) = f (x, y) and N(x, y) = 1 In the event that M is a function of x only and N is a function of y only, then equation (10) becomes M(x) + N(y) dy dx = 0 M(x)dx + N(y)dy = 0 Such an equation is said to be separable. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 17 / 26
Questions 1 Show that the equation dy for its integral curves dx = x2 1 y 2 is separable and find an equation 2 Solve the initial value problem dy dx = 3x2 +4x+2 2(y 1), y(0) = 1 and determine the interval in which the solution exist. 3 Find the solution of the initial value problem dy, y(0) = 1. dx = y cos x 1+2y 4 Solve the initial value problem y = 3x 2 /(3y 2 4), y(1) = 0 and determine the interval in which the solution is valid. 5 Solve the initial value problem y = (2 e x )/(3 + 3y), y(0) = 0 and determine where the solution attains maximum value. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 18 / 26
Solution (1) Consider dy dx = x 2 + (1 y 2 ) dy dx = x 2 1 y 2 (1 y 2 )dy = x 2 dx (y y 3 3 ) = x 3 3 + c x 3 + 3y y 3 = c = 0 (hence separable) x 3 + 3y y 3 = c is an equation for the integral curves of dy dx = x2. 1 y 2 P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 19 / 26
Homogeneous Equation Definition If the right side of the equation dy/dx = f (x, y) can be expressed as a function of the ratio y/x only, then the equation is said to be homogeneous. Such equation can always be transformed into separable equations by change of the dependent variable. Questions Consider dy dx = y 4x x y (a) Show that the above equation can be written as dy above equation is homogeneous. dx = (y/x) 4 1 (y/x) thus (b) Introduce a new dependent variable v so that v = y/x or y = xv(x), express dy/dx in terms of x, v and dv/dx. (c) Replace y and dy/dx by expression in (b), show that the resulting DE is v + x dv dv or x and solve it. dx = v 4 1 v dx = v 2 4 1 v P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 20 / 26
Difference between linear and Nonlinear Equation Existence and uniqueness of Solutions Does every initial value problems for first order equations have exactly one solution? Theorem (Linear DE) If the function p and g are continuous on an open interval I : α < t < β containing the point t = t 0, then there exists a unique function y = φ(t) that satisfies the differential equation y + p(t)y = g(t) (11) for each t in I, and that also satisfies the initial condition y(t 0 ) = y 0, where y 0 is an arbitrary prescribed initial value. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 21 / 26
Interpretation The theorem states that given initial value problem has a solution and also that the problem has only one solution. Also, it states that the solution exists throughout any interval I containing the initial point to which the coefficients p and g are continuous. The solution can be discontinuous or fail to exist only at points where at least one of p and g is discontinuous. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 22 / 26
Example Use the theorem above to find an interval in which the initial value problem ty + 2y = 4t 2, y(1) = 2 has a unique solution. Solution We rewrite ty + 2y = 4t 2, y + (2/t)y = 4t y(1) = 2 in the form (11), we have So p(t) = 2/t and g(t) = 4. Thus, g is continuous for all t, while p is continuous only for t < 0 or t > 0. The interval t > 0 contains the initial points. Consequently theorem above guarantees that problem above has a unique solution on the interval 0 < t <. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 23 / 26
Theorem (nonlinear DE) Let the function f and f y be continuous in some rectangle α < t < β, γ < y < δ containing the points (t 0, y 0 ). Then in some interval t 0 h < t < t 0 + h contained in α < t < β, there is a unique solution y = φ(t) of the initial value problem y = f (t, y), y(t 0 ) = y 0 (12) Interpretation Observe that the hypotheses in Theorem above reduces to those of the previous theorem if the differential equation is linear. For then f (t, y) = p(t)y + g(t) and f (t, y)/ y = p(t), so the continuity of f and f / y is equivalent to the continuity of p and g in this case. The conditions stated in the theorem above are sufficient to guarantee the existence of a unique solution of the initial value problem (12) in some interval t 0 h < t < t 0 + h, but they are not necessary. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 24 / 26
Example Apply the theorem above to the initial value problem dy dx = 3x 2 + 4x + 2, y(0) = 1 2(y 1) Solution Note that the previous theorem is not applicable to this problem since since the differential equation is nonlinear. To apply above theorem, we observe that f (x, y) = 3x2 +4x+2 2(y 2), f (x,y) y = 3x2 +4x+2 2(y 1) 2 Thus both these functions are continuous everywhere except on the line y = 1. Consequently, a rectangle can be drawn about the initial points (0, 1) in which both f and f / y are continuous. Therefore the theorem above guarantees that the initial value problem has a unique solution in some interval about x = 0. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 25 / 26
Example Solve the initial value problem y = y 2, y(0) = 1. Solution The theorem above guarantees that this problem has a unique solution since f (t, y) = y 2 and f / y = 2y are continuous everywhere. We use the method of separation of variable to find solution: y 2 dy = = y 1 = t + c = y = 1 t+c. Substituting initial condition; c = 1, so y = 1 1 t is solution. P. Ngare (University of Nairobi) SMA 208: Ordinary differential equations I Feb 26, 2013 26 / 26