First In-Class Exam Solutions Math 26, Professor David Levermore Tuesday, 2 February 207 ) [6] In the absence of predators the population of mosquitoes in a certain area would increase at a rate proportional to its current population such that it would double every five weeks. There are 250,000 mosquitoes in the area when a flock of birds arrives that eats 0,000 mosquitoes per week. Write down an initial-value problem that governs Mt), the population of mosquitoes in the area after the flock of birds arrives. Do not solve the initial-value problem!) Solution. The population tripling every five weeks means that the growth rate r satisfies e r5 = 3, whereby r = log2). Therefore the initial-value problem that M 5 satisfies is dm dt = 5 log2)m 0, 000, M0) = 250, 000. 2) [22] Find an explicit solution for each of the following initial-value problems. a) dw dt + 2tw + t =, w0) = 2. 2 + t 2 ) 2 Solution. This equation is linear. It is already in normal form. Its coefficient 2t and forcing are both continuous over the entire real line. Therefore +t 2 +t 2 ) 2 the interval of definition for each solution is, ). You were not asked for this, but you might have been.) An integrating factor is t ) 2s exp + s ds = exp log + t 2 ) ) = + t 2, 2 0 so the equation has the integrating factor form d + t 2 )w ) = + t 2 ) dt + t 2 ) = 2 + t. 2 By integrating this we find that + t 2 )w = The initial condition w0) = 2 implies that + t 2 dt = tan t) + c. + 0 2 ) 2 = tan 0) + c, whereby c = 2. Therefore the solution is w = tan t) + 2 + t 2.
2 b) dz dt = z2 cost), z0) = 3. Solution. This equation is separable. Its right-hand side is defined everywhere. Its stationary points are z = 2 and z = 2. The initial value 3 is not a stationary point, so the solution will be nonstationary. Moreover, because the solution z = Zt) cannot cross the stationary point at z = 2, we know that Zt) > 2 so long as it exists. The differential equation has the separated differential form dz = cost) dt, z 2 whereby z 2 dz = cost) dt = sint) + c. By the partial fraction identity z 2 = )z 2) = z 2, we see that for every z > 2 z 2 dz = z 2 ) dz ) z 2 = logz 2) log) = log. Therefore an implicit general solution is ) z 2 log = sint) + c. The initial condition z0) = 3 implies that ) 3 2 log = sin0) + c, 3 + 2 whereby c = log ) = log5). Hence, the solution is governed implicitly by 5 log 5 z 2 ) = sint). By exponentiating both sides we find z 2 = 5 expsint)), which can be solved to obtain the explicit solution z = 2 5 + expsint)) 5 expsint)). Remark. Because the denominator never vanishes, we see that the interval of definition of this solution is, ). You were not asked for this, but you might have been.
3) [2] Consider the differential equation dv dt = v2 v 3 e v. 8 v a) [9] Sketch its phase-line portrait over the interval v 2. Identify points where it has no solution. Identify its stationary points and classify each as being either stable, unstable, or semistable. b) [] If v0) = 2, how does the solution vt) behave as t? c) [] If v0) = 2, how does the solution vt) behave as t? d) [] If v0) = 6, how does the solution vt) behave as t? Solution a). This equation is autonomous. Its right-hand side is undefined at v = 8, where the denominator 8 v vanishes, and is differentiable elsewhere. It has stationary points at v = 0 and v =, where the numerator v 2 v 3 = v 2 v) vanishes. A sign analysis shows that the phase-line portrait for this equation is + + + v 0 8 semistable stable undefined Remark. Only solutions of the differential equation can be described as stable, unstable, or semistable ; v = 8 is not unstable because it is not a solution. Solution b). The phase-line shows that if v0) = 2 then vt) 0 as t. Solution c). The phase-line shows that if v0) = 2 then vt) as t. Solution d). The phase-line shows that if v0) = 6 then vt) as t. ) [2] Consider the following MATLAB function M-file. function [t,y] = solveitti, yi, tf, n) t = zerosn +, ); y = zerosn +, ); t) = ti; y) = yi; h = tf - ti)/n; hhalf = h/2; for k = :n thalf = tk) + hhalf; tk + ) = tk) + h; fnow = tk))ˆ2 + costk)*yk)); yhalf = yk) + hhalf*fnow; fhalf = thalf)ˆ2 + costhalf*yhalf); yk + ) = yk) + h*fhalf; end Suppose the input values are ti = 0, yi =, tf = 0, and n = 50. a) [] What initial-value problem is being approximated numerically? b) [2] What is the numerical method being used? c) [2] What is the step size? d) [] What will be the output values of t2) and y2)? 3
Solution a). The initial-value problem being approximated numerically is dy dt = t2 + costy), y0) =. Remark. An initial-value problem consists of both a differential equation and an initial condition. Both must be given for full credit. Solution b). The Runge-midpoint method is being used. This is clear from the h*fhalf in last line of the for loop.) Solution c). Because tf = 0, ti = 0, and n = 50, the step size is tf ti h = = 0 0 = n 50 5 =.2. Remark. The correct values for tf, ti, and n had to be plugged in to get full credit. Solution d). Because h =.2, we have hhalf =.. Because ti = 0 and yi =, we have t) = ti = 0, and y) = yi =. Setting j = inside the for loop then yields fnow = t)) 2 + cost)*y)) = 0 2 + cos0 ) = 0 + =, thalf = t) + hhalf = 0 +. =., yhalf = y) + hhalf * fnow = +. = +. =., fhalf = thalf 2 + costhalf*yhalf) =.) 2 + cos..) =.0 + cos.), t2) = t) + h = 0 +.2 =.2, y2) = y) + h * fhalf = +.2.0 + cos.) ). Remark. This expression for y2) did not have to be simplified to get full credit. 5) [6] Give the interval of definition for the solution of the initial-value problem t dz dt + t t 2 6 z = t 2 +, z 2) = 7. You do not have to solve this equation to answer this question!) Solution. This problem is linear in z. Its normal form is dz dt + t 2 6 z = t t 2 +. The interval of definition can be read off from this normal form as follows. Notice that the coefficient is undefined at t = and t =, and is t 2 6 continuous elsewhere. Notice that the forcing is undefined at t = 0, and is continuous elsewhere. t t 2 + Therefore the interval of definition is, 0) because the initial time t = 2 is in, 0), both the coefficient and forcing are continuous over, 0), the coefficient is undefined at t = and the forcing is undefined at t = 0.
6) [6] Consider the initial-value problem dy dx = 3x2 2y, y) = y I for some y I in, 0). The solution satisfies y 2 = yi 2 + x 3. Gives its interval of definition as a function of y I. You do not have to find the explicit solution!) Solution. We need yi 2 + x3 > 0 for this equation to have a real solution for y. Because y I < 0 this solution is given by y = y 2 I + x3. The condition yi 2 + x3 > 0 is equivalent to yi 2 + > x3, which is then equivalent to x < ) + yi 2 3. Therefore the interval of definition is, + y 2 I Remark. We did not need to find an explicit expression for y to answer this question. We just had to notice that as y 2 decreases over 0, + ) the value of y increases over, 0). Hence, a unique solution for y will exist whenever yi 2 + x3 > 0. Remark. This problem was taken from the second quiz. 7) [8] Suppose you have used a numerical method to approximate the solution of an initial-value problem over the time interval [0, 5] with 000 uniform time steps. About how many uniform time steps do you need to reduce the global error of your approximation by a factor of 625 a) Runge-Kutta method b) Runge-midpoint method c) Runge-trapezoidal method d) Euler method ) 3 ). if the method you had used was each of the following? Solution a). The Runge-Kutta method is fourth order, so its error scales like h. To reduce the error by a factor of, we must reduce h by a factor of =. We 625 625 5 must increase the number of time steps by a factor of 5, which means we need 5, 000 uniform time steps. Solution b). The Runge-midpoint method is second order, so its error scales like h 2. To reduce the error by a factor of, we must reduce h by a factor of 2 =. 625 625 25 We must increase the number of time steps by a factor of 25, which means we need 25, 000 uniform time steps. Solution c). The Runge-trapezoidal method is second order, so its error scales like h 2. To reduce the error by a factor of, we must reduce h by a factor of 2 = 625 625 We must increase the number of time steps by a factor of 25, which means we need 25, 000 uniform time steps. 5 25.
6 Solution d). The explicit Euler method is first order, so its error scales like h. To reduce the error by a factor of, we must reduce h by a factor of. We must 625 625 increase the number of time steps by a factor of 625, which means we need 625, 000 uniform time steps. 8) [6] A tank with an open top has a square base with 2 meter edges and a height of.5 meters. The tank is initially empty when water begins to pour into it at a rate of 5 liters per minute. The water also drains from the tank through a hole in its bottom at a rate of h liters per minute where ht) is the height of the water in the tank in meters. Write down an initial-value problem that governs ht). Do not solve the initial-value problem!) Recall that m 3 = 000 lit.) Solution. Let V t) be the volume lit) of water in the tank at time t minutes. We have the following optional) picture. height.5 m inflow 5 lit/min water height ht) m water volume V t) lit outflow ht) lit/min V 0) = 0 lit. base area m 2 We want to write down an initial-value problem that governs ht). Because the tank has a base with an area of m 2, the volume of water in the tank is ht) m 3. Because m 3 = 000 lit, V t) = 000 ht) = 000ht) lit. Because V t) satisfies dv dt = RATE IN RATE OUT = 5 h, the initial-value problem that governs ht) is 000 dh dt = 5 h, h0) = 0. Each term in the differential equation has units of lit/min. Remark. The above solution is all that was required for full credit. If we had been asked whether or not the tank will overflow then we could have answered as follows. The differential equation is autonomous. Its right-hand side is defined for h 0 and is differentiable for h > 0. It has one stationary point at h = 25. Its phase-line 6 portrait for h > 0 is + h 25 6 This portrait shows that if h0) = 0 then ht) 25 as t. Because the height 6 of the tank is.5 and 25 >.5, the tank will overflow. 6
9) [22] For each of the following differential forms determine if it is exact or not. If it is exact then give an implicit general solution. Otherwise find an integrating factor. You do not need to find a general solution in the last case.) a) ye xy + cosx) ) dx + xe xy y 3 ) dy = 0. Solution. This differential form is exact because y ye xy + cosx) ) = e xy + xye xy = x xe xy y 3) = e xy + xye xy. Therefore we can find Hx, y) such that x Hx, y) = ye xy + cosx), y Hx, y) = xe xy y 3. Integrating the first equation with respect to x yields Hx, y) = e xy + sinx) + hy), whereby y Hx, y) = xe xy + h y). Plugging this expression for y Hx, y) into the second equation gives xe xy + h y) = xe xy y 3, which yields h y) = y 3. Taking hy) = y, an implicit general solution is given by e xy + sinx) y = c. b) x 2 y + 3xy 3 ) dx + x 3 + 3x 2 y 2 ) dy = 0. Solution. This differential form is not exact because y x 2 y + 3xy 3 ) = x 2 + 9xy 2 x x 3 + 3x 2 y 2 ) = 3x 2 + 6xy 2. Therefore we seek an integrating factor µ that satisfies y [x 2 y + 3xy 3 )µ] = x [x 3 + 3x 2 y 2 )µ]. Expanding the partial derivatives yields x 2 y + 3xy 3 ) y µ + x 2 + 9xy 2 )µ = x 3 + 3x 2 y 2 ) x µ + 3x 2 + 6xy 2 )µ. Grouping the µ terms together gives x 2 y + 3xy 3 ) y µ + x 2 + 3xy 2 )µ = x 3 + 3x 2 y 2 ) x µ. If we set y µ = 0 then this becomes x 2 + 3xy 2 )µ = x 3 + 3x 2 y 2 ) x µ = x 2 + 3xy 2 )x x µ, which reduces to x x µ = µ. This yields the integrating factor µ = x. Remark. Because the differential form was not exact, all we were asked to do was find an integrating factor. If we had been asked to find an implicit general solution then we would seek Hx, y) such that x Hx, y) = x 3 y + 3x 2 y 3, y Hx, y) = x + 3x 3 y 2. These can be integrated to find Hx, y) = x y + x 3 y 3. Therefore an implicit general solution is x y + x 3 y 3 = c. 7