First Order Differential Equations Ordinary Differential Equations Dr. Marco A Roque Sol 12/01/2015 Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations First Order Differential Equations Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Modeling Example 20 Newton’s Law of Cooling Newton’s Law of Cooling states that the temperature of a body changes at a rate proportional to the difference in temperature between its own temperature and the temperature of its surroundings. We can therefore write dT = −k (T − Ts ) dt Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Modeling where, T = Temperature of the body at any time t Ts = Temperature of the surroundings (also called ambient temperature) T0 = Initial temperature of the body k = constant of proportionality Integrating this separable differential equation dT = −k (T − Ts ) dt Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Modeling 1 dT = −kdt T − Ts Z Z 1 dT = − kdt T − Ts ln|T − Ts | = −kt + C |T − Ts | = e −kt+C Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Modeling T = Ts + ce −kt ; T > Ts (why ?) Applying initial conditions T (0) = T0 c = T0 − Ts Thus, the solution is T = Ts + (T0 − Ts )e −kt Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Linear and Nonlinear Equations Theorem 1 (Existence and Uniqueness). Suppose p(t) and g (t) are continuous real-valued functions on an interval (α, β) that contains the point t0 . Then, for any choice of (initial value) y0 , there exists a unique solution y (t) on the whole interval (α, β) to the linear differential equation dy (t) + p(t)y (t) = g (t) dt for all t ∈ (α, β) and y (t0 ) = yo. Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Linear and Nonlinear Equations Theorem 2 (Existence and Uniqueness). Suppose that both f (t, y ) and ∂f (t, y ) are continuous functions ∂y defined on a region R as R = {(t, y ) : t0 − δ < t < t0 + δ; y0 − < y < y0 + } containing the point (t0 , y0 ). Then there exists a number δ1 (possibly smaller than δ) so that a solution y = f (t) to y 0 = f (t, y ) y (t0 ) = y0 is the unique solution for t0 − δ1 < t < t0 + δ1 Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Linear and Nonlinear Equations Example 21 Consider the ODE y 0 = t − y + 1; y (1) = 2 In this case, both the function f (t, y ) = ty + 1 and its partial ∂f derivative (t, y ) = −1 are defined and continuous at all points ∂y (x, y ). The theorem guarantees that a solution to the ODE exists in some open interval centered at 1, and that this solution is unique in some (possibly smaller) interval centered at 1 Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Linear and Nonlinear Equations In fact, an explicit solution to this equation is y (t) = t + e 1t This solution exists (and is the unique solution to the equation) for all real numbers t. In other words, in this example we may choose the number δ and δ1 as large as we please. Example 22 Consider the ODE y 0 = 1 + y 2; Dr. Marco A Roque Sol y (0) = 0 Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Linear and Nonlinear Equations In this case, both the function f (t, y ) = 1 + y 2 and its partial ∂f derivative (t, y ) = 2y are defined and continuous at all points ∂y (t, y ). The theorem guarantees that a solution to the ODE exists in some open interval centered at 0, and that this solution is unique in some (possibly smaller) interval centered at 1 By separating variables and integrating, we derive a solution to this equation of the form y (t) = tan(t) Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Linear and Nonlinear Equations As an abstract function of t, this is defined for all t 6= ..., −3π/2, π/2, π/2, 3π/2, .... However, in order for this function to be considered as a solution to this ODE, we must restrict the domain. Specifically, the function y (t) = tan(t); −π/2 < x < π/2 is a solution to the above ODE. In this example we must choose δ1 = π/2, although the initial value δ, may be chosen as large as we please. Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations One particular case of a separable equation is the so called Autonomous Equation, which is an equation of the form dy = f (y ) dt That is, the right hand side only depends on y and therefore the directional field can be found only analyzing horizontal lines. We will use some concrete examples to see how we can use a qualitative analysis to determine the behavior of the function. Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations Population If P(t) represents a population in a given region at any time t the basic equation that we will use is identical to the one that we used for mixing. Namely, Rate of change of P(t) = Rate at which P(t) enters the region Rate at which P(t) exits the region Here the rate of change of P(t) is still the derivative. For population problems all the ways for a population to enter the region are included in the entering rate. Birth rate and migration into the region are examples of terms that would go into the rate at which the population enters the region. Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations Likewise, all the ways for a population to leave an area will be included in the exiting rate. Therefore things like death rate, migration out and predation are examples of terms that would go into the rate at which the population exits the area. Example 23 A population of insects in a region will grow at a rate that is proportional to their current population. In the absence of any outside factors the population will triple in two weeks time. On any given day there is a net migration into the area of 15 insects and 16 are eaten by the local bird population and 7 die of natural causes. If there are initially 100 insects in the area will the population survive? If not, when do they die out? Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations Solution Let’s start out by looking at the birth rate. We are told that the insects will be born at a rate that is proportional to the current population. This means that the birth rate can be written as rP(t) where r is a positive constant that will need to be determined. Now, let’s take everything into account and get the IVP for this problem. P 0 (t) = (rP + 15) − (16 + 7) P(0) = 100 P 0 (t) = rP − 8 P(0) = 100 Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations Note that we don’t make use of the fact that the population will triple in two weeks time in the absence of outside factors here. In the absence of outside factors means that the only thing that we can consider is birth rate. Nothing else can enter into the picture and clearly we have other influences in the differential equation. So, just how does this tripling come into play? We will use the fact that the population triples in two week time to help us find r . In the absence of outside factors the differential equation would become. P 0 (t) = rP P(0) = 100 P(14) = 300 Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations This differential equation is separable and linear and is a simple differential equation to solve. The general solution is : P(t) = ce rt Applying the initial condition gives c = 100. Now apply the second condition. 300 = P(14) = 100e 14r And solving for r , we have r= ln3 14 Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations Now, that we have r we can go back and solve the original differential equation. We will rewrite it a little for the solution process. ln3 0 P = −8 P(0) = 1000 P (t) − 14 This is a simple linear differential equation, with integrating fractor given by: µ(t) = e − R ln3 dt 14 ln3 = e − 14 t And the solution is Z Z 0 ln3 − ln3 t 14 Pe dt = −8 e − 14 t dt Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations P(t) = ln3 112 + ce 14 t ln3 And applying the initial condition, we get ln3 112 112 ln3 t 112 P(t) = + 100 − e 14 = − (1.947) e 14 t ln3 3 ln3 Now, the exponential has a positive exponent and so will go to plus infinity as t increases. Its coefficient, however, is negative and so the whole population will go negative eventually. Since the population cannot be negative, there is a time such tha,t all of them die out Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations ln3 112 − (1.9468) e 14 t = 0 ln3 t = 50.4 days Thus, the insects will survive for around 7 weeks. Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations Example 24 Logistic Growth Previously we have modeled a population based on the assumption that the growth rate would be a constant A much more realistic model of a population growth is given by the logistic growth equation. Here is the logistic growth equation. P 0 P =r 1− P K In the logistic growth equation r is the intrinsic growth rate. It is the growth rate that will occur in the absence of any limiting factors. K is called either the saturation level or the carrying capacity. Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations Now, we claimed that this was a more realistic model for a population. Lets see if that in fact is correct. To allow us to sketch a direction field let’s pick a couple of numbers for r and K . We will use r = 1/2 and K = 10. For these values the logistics equation is. P 1 0 1− P P = 2 10 First notice that the derivative will be zero at P = 0 and P = 10. Also notice that these are in fact solutions to the differential equation. These two values are called equilibrium solutions since they are constant solutions to the differential equation. Here is the direction field as well as some solutions sketched in as well. Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations Now, lets move on to the point of this section. The logistics equation is an example of an autonomous differential equation. dy = f (y ) dt Notice that if f (y0 ) = 0 for some value y = y0 ) = 0 then this will also be a solution to the differential equation. These values are called equilibrium solutions or equilibrium points. What we would like to do is classify these solutions. So, let’sgo backto our logistic equation 1 P P0 = 1− P 2 10 Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations As we pointed out there are two equilibrium solutions to this equation P = 0 and P = 10. If we the fact that we’re dealing with population these points break up the P number line into two distinct regions. 0 < P < 10; 10 < P < ∞ We will say that a solution starts near an equilibrium solution if it starts in a region that is on either side of that equilibrium solution. Equilibrium solutions, in which solutions that start near them move away from the equilibrium solution, are called unstable equilibrium points or unstable equilibrium solutions. So, for our logistics equation, P = 0 is an unstable equilibrium solution. Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations Next, solutions that start near P = 10 all move in toward P = 10 as t increases. Equilibrium solutions in which solutions that start near them move toward the equilibrium solution are called asymptotically stable equilibrium points or asymptotically stable equilibrium solutions. So, P = 10 is an asymptotically stable equilibrium solution Example 25 Find and classify all the equilibrium solutions to the following differential equation. y0 = y2 − y − 6 Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations Solution First, find the equilibrium solutions. This is generally easy enough to do. y 2 − y − 6 = (y − 3)(y + 2) = 0 So, it looks like we’ve got two equilibrium solutions. Both y = −2 and y = 3 are equilibrium solutions. Thus, those points divide the pane in three sections, namely −∞ < y < −2; −2 < y < 3; 3<y <∞ In those regiones we have the following behavior for y 0 : Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations In the region −∞ < y < −2 the derivative y 0 is positive. In the region −2 < y < 3 the derivative y 0 is negative. In the region 3 < y < ∞ the derivative y 0 is positive. Thus, y = −2 is an asymptotically stable equilibrium solution and y = 3 is an unstable equilibrium solution. Example 26 Find and classify all the equilibrium solutions to the following differential equation. y 0 = (y 2 − 4)(y + 1)2 Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations Solution First, find the equilibrium solutions. This is generally easy enough to do. (y 2 − 4)(y + 1)2 = (y − 2)(y + 2)(y + 1)2 = 0 So, it looks like we’ve got three equilibrium solutions. Both y = −2, y = −1 and y = 2 are equilibrium solutions. Thus, those points divide the pane in four sections, namely −∞ < y < −2; −2 < y < −1; −1 < y < 2; 2<y <∞ In those regiones we have the following behavior for y 0 : Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Autonomous Equations In the region −∞ < y < −2 the derivative y 0 is positive. In the region −2 < y < −1 the derivative y 0 is negative. In the region −1 < y < 2 the derivative y 0 is negative again. In the region 2 < y < ∞ the derivative y 0 is positive. Thus, y = −2 is an asymptotically stable equilibrium solution, y = −1 is a semi-stable equilibrium solution, and y = 2 is an unstable equilibrium solution. Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Exact Equations e Integrating Factors The next type of first order differential equations that we will be looking at is exact differential equations. Suppose that we have the following differential equation. M(x, y ) + N(x, y ) dy =0 dx or equivalently M(x, y )dx + N(x, y )dy = 0 Now, if there is a function somewhere out there in the world, ψ(x, y ), so that Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Exact Equations e Integrating Factors ∂ψ(x, y ) =M ∂x and ∂ψ(x, y ) =N ∂y then we call the differential equation exact. In these cases we can write the differential equation as ∂ψ(x, y ) ∂ψ(x, y ) dy + =0 ∂x ∂y dx Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Exact Equations e Integrating Factors Then using the chain rule from Calculus III we can further reduce the differential equation to the following derivative: d (ψ (x, y (x))) = 0 dx this implies that ψ (x, y (x)) = c = constant This then is an implicit solution for our differential equation! Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Exact Equations e Integrating Factors Finding the function ψ(x, y ) is clearly the central task in determining if a differential equation is exact and in finding its solution. Therefore, it would be nice if there was some simple test that we could use before even starting to see if a differential equation is exact or not. Since it’s exact we know that somewhere out there is a function ψ(x, y ) that satisfies ∂ψ(x, y ) =M ∂x Dr. Marco A Roque Sol and ∂ψ(x, y ) =N ∂y Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Exact Equations e Integrating Factors Now, provided ψ(x, y ) is continuous and its first order derivatives are also continuous we know that ψ(x, y )xy = ψ(x, y )yx However, we also have the following. ψ(x, y )xy = (ψ(x, y )x )y = (M)y = My ψ(x, y )yx = ψ(x, y )y = (N)x = Nx x Therefore, if a differential equation is exact and ψ(x, y ) meets all of its continuity conditions we must have. Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Exact Equations e Integrating Factors M y = Nx Therefore, we will use the above equation as a test for exact differential equations. If so, we will assume that the differential equation is exact and that ψ(x, y ) meets all of its continuity conditions and proceed with finding it Example 27 Solve the following IVP . 2xy − 9x 2 + (2y + x 2 + 1) Dr. Marco A Roque Sol dy = 0; dx y (0) = −3 Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Exact Equations e Integrating Factors Solution First identify M and N and check that the differential equation is exact. M = 2xy − 9x 2 N = 2y + x 2 + 1 My = 2x = Nx So, the differential equation is exact according to the test. Now, how do we actually find ψ(x, y ) ? Well recall that Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Exact Equations e Integrating Factors ψ(x, y )x = M ψ(x, y )y = N We can use either of these to get a start on finding ψ(x, y ) by integrating as follows. Z Z ψ(x, y ) = Mdx + h(y ) or ψ(x, y ) = Ndy + g (x) Often it doesn’t matter which one you choose to work with while in other problems one will be significantly easier than the other. Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Exact Equations e Integrating Factors So, I will use the first one. Z ψ(x, y ) = (2xy − 9x 2 )dx = x 2 y − 3x 3 + h(y ) Okay, we have got most of the function ψ(x, y ), we just need to determine h(y ) and we will be done. Differentiate our ψ(x, y ) with respect to y and set this equal to N : ψ(x, y )y = x 2 + h0 (y ) = N = 2y + x 2 + 1 From this we can see that h0 (y ) = 2y + 1 Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Exact Equations e Integrating Factors Note that at this stage h(y ) must be only a function of y and so if there are any x 0 s in the equation at this stage something is wrong and it’s time to go look for it. We can now find h(y ) by integrating. h(y ) = y 2 + y + k So, we can now write down ψ(x, y ) ψ(x, y ) = x 2 y − 3x 3 + y 2 + y + k implicit solution is then ψ(x, y ) = C =⇒ y 2 + (x 2 + 1)y − 3x 3 = C − k = c Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Exact Equations e Integrating Factors Applying the initial conditions (−3)2 + ((0)2 + 1)(−3) − 3(0)3 = c =⇒ c = 6 The complete (including the constant)implicit solution is then. y 2 + (x 2 + 1)y − 3x 3 − 6 = 0 Now, this is quadratic in y and so we can solve for y (x) by using the quadratic formula. p −(x 2 + 1) ± (x 2 + 1)2 − 4(1)(−3x 3 − 6) y= 2(1) Dr. Marco A Roque Sol Ordinary Differential Equations First Order Differential Equations Modeling Linear and Nonlinear Equations Autonomous Equations Exact Equations Exact Equations e Integrating Factors p (x 4 + 12x 3 + 2x 2 + 25 y= 2 Now, reapply the initial condition to figure out which of the two signs in the that we need. √ −1 ± 25 −1 ± 5 −3 = y (0) = = = −3, 2 2 2 So, it looks like the minus sign is the one that we need. The explicit solution is then. p −(x 2 + 1) − (x 4 + 12x 3 + 2x 2 + 25 y= 2 −(x 2 + 1) ± Dr. Marco A Roque Sol Ordinary Differential Equations