Math 220, Differential Equations Spring 2011 Exam 1 Solutions - 2-October-2011 Landon Kavlie These are solutions to this practice exam given on February 18, 2011 by Professor Nicholls. 1. (20 pts) Solve the initial value problem ( dy 1+x2 dx = sin(y) y(0) = π. This equation is seperable. Therefore, we move the xs to one side and the ys to the other to get that sin(y)dy = 1 + x2 dx. We then integrate. This is a trivial integration giving us that 1 − cos(y) = x + x3 + C, 3 an implicit solution. Before solving for y, we use our initial conditions y(0) = π to find that 1 − cos(π) = 1 = 0 + 03 + C = C. 3 Thus, C = 1. So, solving for y, we find that 1 3 y = arccos −x − x − 1 . 3 2. (20 pts) Find the general solution to the differential equation −3e3x + π2 xy 3 dy = 4 3 2 2 . dx y − πx y This is again a first-order equation. However, it is not seperable and is clearly not linear. So, we hope that it ends up being exact. Rearranging, we have that 4 3 2 − x2 y 2 dy + 3e3x − xy 3 dx = 0. y π π So, we test for exactness. That is, we must take the partial derivative of the dy term with respect to x and compare it to the partial derivative of the dx term with 1 2 respect to y. ∂ ∂x ∂ ∂y 4 3 − x2 y 2 y π 2 3e3x − xy 3 π 3 = − (2x)y 2 π 6 = − xy 2 π 2 = − x(3y 2 ) π 6 = − xy 2 . π Thus, our equation is exact. So our solution will be of the form F (x, y) = C for some constant C and F satisfies the property that 4 3 2 2 ∂F = − x y ∂y y π ∂F 2 3 3x = 3e − xy . ∂x π Integrating the second one with respect to x gives us that Z 2 F (x, y) = 3e3x − xy 3 dx π 1 = e3x − x2 y 3 + g(y) π for some function g(y) depending ONLY on y and not on x. Thus, we take the partial derivative with respect to y and compare it to ∂F ∂y . ∂F 3 = − x2 y 2 + g 0 (y) ∂y π 4 3 = − x2 y 2 . y π This gives us that g 0 (y) = y4 . Integrating, we find that g(y) = 4 ln(y), up to a constant which we are allowed to choose. Therefore, our solution is given by F (x, y) = C. That is, 1 e3x − x2 y 3 + 4 ln(y) = C. π 3. (20 pts) Consider the initial value problem dy dt = y y(0) = 2. (1) (5 points) What is the exact solution? (2) (5 points) Use one step of Euler’s method to approximate y(1). What is the error? (3) (5 points) Use two steps of Euler’s method to approximate y(1). What is the error? 3 (4) (5 points) Use one step of Improved Euler’s Method to approximate y(1). What is the error? Note: Improved Euler’s Method is specified by the formula: h yn+1 = yn + [f (xn , yn ) + f (xn + h, yn + hf (xn , yn ))]. 2 For part (1), we can easily solve this using either seperability or first-order linear methods. Since we have already done a seperable equation, lets use integrating factors. That is, we rewrite the equation as dy − y = 0. dt Thus, our integrating factor is e R −1dt = e−t . Multiplying our equation through by e−t , our equation collapses as d −t e y = 0. dt Thus, we solve this by taking antiderivatives as e−t y = C ⇒ y = Cet . Using the initial condition, we find that y = 2et . Hence, we find that the exact value of y(1) is 2e ≈ 5.43656. For the second part, we recall that Euler’s method is given by the recursive formula yn+1 = yn + hf (xn , yn ). Also, for one step, to get from 0 to 1, our step size must be 1. Thus, by Euler’s method, with x0 = 0, and y0 = 2, we find that y1 = y0 + h[y0 ] = 2 + 2 = 4. The error between this and y(1) is |2e − 4| ≈ 1.43656. For the third part, we just need to adjust our step size to 0.5 to allow for two steps between 0 and 1. In this case, Euler’s method gives us that y0 = 2 y1 = y0 + h[y0 ] = 2 + 0.5[2] = 3 y2 = y1 + h[y1 ] = 3 + 0.5[3] = 4.5. The error between this and y(1) is |2e − 4.5| ≈ .93656. Finally, we use Improved Euler’s method with a single step, giving us a step-size of 1. In this case, we find that h y1 = y0 + [y0 + (y0 + h[y0 ])] 2 = 2 + 0.5[2 + 2 + 2] = 2 + 3 = 5. The error between this and y(1) is |2e − 5| ≈ .43656. Cool... 4 4. (20 pts) Solve the initial value problem 00 y (t) − 6y 0 (t) + 9y(t) = 0 y(0) = −2 0 y (0) = −5. The characteristic equation (gotten by replacing y 0 by r, etc) is given by r2 − 6r + 9 = 0. This has the double root r = 3. Thus, our general solution is given by y = C1 e3t + C2 te3t . To find C1 and C2 , we use our initial conditions. Using y(0) = −2, we have that −2 = y(0) = C1 . Next, we find that y 0 = 3C1 e3t + C2 e3t + 3C2 te3t . Thus, to solve for C2 , we find that −5 = y 0 (0) = 3C1 + C2 = −6 + C2 Using the value for C1 discovered above. Thus, we find that C2 = 1. Therefore, y(t) = −2e3t + te3t . 5. (20 pts) Consider the differential equation dp = p(p − 2)(3 − p) dt for the population p (in thousands) of a certain species at time t. (1) (10 points) Sketch the direction field. (2) (4 points) If the initial population is 5000 (i.e., p(0) = 5), what can you say about the limiting population limt→∞ p(t)? (3) (4 points) If p(0) = 2.4, what is limt→∞ p(t)? (4) (4 points) If p(0) = 1.1, what is limt→∞ p(t)? Although you can solve this for an implicit solution, since it is separable, the only way to figure out the asymptotic behavior (as t → ∞) is to argue analytically based on the sign of the derivative.To start, this is a picture I generated using this direction field plotter. 5 But, without a direction field plotter, just notice that your derivative is zero when p = 0, 2, 3 and the sign of your derivative is given as follows: p < 0 : p(p − 2)(3 − p) > 0 0 < p < 2 : p(p − 2)(3 − p) < 0 2 < p < 3 : p(p − 2)(3 − p) > 0 p > 3 : p(p − 2)(3 − p) < 0. This will allow you to accurately draw the picture without the aid of software. Now, for the “solving” approach. We will use separability. Thus, we rewrite our equation as 1 dp = dt. p(p − 2)(3 − p) Next, we integrate. The right-hand side trivially becomes t + C. the left-hand side needs some work. First, you have to use partial fractions. Then, you can integrate it giving you that Z Z 1 1 1 1 dp = + + dp p(p − 2)(3 − p) −6p 2(p − 2) −3(p − 3) 1 1 1 = − ln(p) + ln(p − 2) − ln(p − 3) + C 6 2 3 But coming up with a fomula for p is nearly impossible. Instead, we just look at the picture and argue analytically what the asymptotic behavior is. First, if p(0) = 5 > 3, by the above chart, the solution has a negative derivative. Thus, the solution will decay until it passes 3. If it were to pass 3, then the positive derivative will make the solution increase again. Thus, our solution seems to be “stuck” at 3 as t → ∞. Therefore, lim p(t) = 3 t→∞ if p(0) = 5. Next, since 2 < 2.4 < 3, we see that the derivative is positive. So, the solution will increase towards 3. Then, we have the same behavior where our 6 solution becomes “stuck” near 3. Thus, we find that lim p(t) = 3 t→∞ if p(0) = 5. Finally, since 0 < 1.1 < 2, the derivative is now negative. That is until it reaches p = 0. So, this time, using similar logic to before, we find that lim p(t) = 0 t→∞ if p(0) = 1.1.