Practice Midterm Solutions Math 4B: Ordinary Differential Equations Winter 20 University of California, Santa Barbara TA: Victoria Kala DO NOT LOOK AT THESE SOLUTIONS UNTIL YOU HAVE ATTEMPTED EVERY PROBLEM ON THE PRACTICE MIDTERM February 2, 20
Practice Midterm Solutions February 2, 20 Answers This page contains answers only. Detailed solutions are on the following pages.. (a) Answers will vary (b) Answers will vary 2. See detailed solution 3. (a) y = 2 cos 2 + C e (b) (0, ) 4. sin (y) = 2 2 + sin ( ) π or y = sin ( 2 2 + sin ( )) π 5. y + 2 ln y = + 5 ln 3 + C. y 2 sin 3 y 2 + y ln y y = e 2 2 7. y = + 2, 0 < 2 2 + + 2, *Note that this problem is more difficult than it appears 8. (a) y = e 2 (c cos 3 + c 2 sin 3) (b) y = c + c 2 e + c 3 e (c) y = c e 2 + c 2 e 3 (d) y = c e + c 2 e + c 3 cos + c 4 sin 9. (a) W = 2e (b) W = c 2 e 0. (a) y 2 = 2 ln (b) See detailed solution (c) y = c 2 + c 2 2 ln 2
Detailed Solutions. Give an eample of a third (3rd) order (a) nonlinear differential equation (b) linear differential equation Proof. Recall a third order linear differential equation is given by a 3 ()y + a 2 ()y + a ()y + a 0 ()y = g() where a 3, a 2, a, a 0 are a functions of, not of y. One way to make a nonlinear differential equation is to have functions of y in front of the derivative terms. Some eamples are below: (a) yy e y = 2 is a nonlinear differential equation because of the term yy. (b) y 2y + ln y e + 4y = 0 is a linear differential equation because all of the functions in front of the derivative terms are functions of alone. 2. Verify P = cet dp is a solution to the differential equation + cet dt = P ( P ). Proof. We need to substitute P into the equation above and show that the left hand side equations the right hand side. Left hand side: (use the quotient rule or product rule for the derivative) dp dt = ( + cet )(ce t ) ce t ( + ce t ) ( + ce t ) 2 = ( + cet )(ce t ) ce t (ce t ) ce t ( + ce t ) 2 = ( + ce t ) 2 Right hand side: P ( P ) = cet + ce t ) ( ) ( cet + ce t = cet + ce t + ce t + ce t cet + ce t = cet The left hand side equals the right hand side, hence P = equation dp dt = P ( P ). 3. (a) Solve the following first order linear equation: y + ( + )y = e sin 2 + ce t + ce t = ce t ( + ce t ) 2 cet is a solution to the differential + cet Solution. Write the equation in standard form by dividing the equation on both sides by : ( ) + y + y = e sin 2 3
Now we wish to find an integrating factor. From the equation above, we see that P () = + = + (remember that P () is function in front of the y term in the differential equation). Therefore ( ) ( ( ) ) µ() = ep P ()d = ep + d = e ln + = e ln e = e Multiply the standard form equation above by µ(): ( ) ] + e [y + y = e sin 2 e y + ( + )e y = sin 2 () The left hand side should collapse down to the derivative of the product µ()y, that is, Don t believe it? You can always check: d d (e y) = sin 2. (2) d d (e y) = e y + (e ) y = e y + ( e + (e ) )y = e y + (e + e )y which is the same as the equation (). Now looking back at equation (2), we integrate both sides: e y = sin 2d e y = cos 2 + C 2 Solve for y: y = 2 cos 2 + C e (b) For the differential equation in part (a), determine the largest interval on which the eistence and uniqueness theorem for first order linear differential equations guarantees the eistence of a unique solution at the initial value y(4) =. Solution. We must look at the standard form equation: ( ) + y + y = e sin 2 We have that P () = +, f() = e sin 2 4
The domain of P () is all numbers such that 0. The domain of f() is also all numbers such that 0. Therefore the domain of the equation is all numbers such that 0, which can be written as (, 0) (0, ). Now let s look at the initial value y(4) =. This says when = 4 we have that y =. = 4 falls into the interval (0, ), hence this is the largest interval on which we are guaranteed a unique solution. 4. Solve the following initial value problem: dy d = y 2, y(0) = π Solution. This is a separable equation. We can separate the variables as follows: dy y 2 = d Integrate both sides: dy = y 2 d sin (y) = 2 2 + C (3) Here we will plug in the initial value (you can also solve for y then plug in the initial value if you wish). When = 0, y = π : ( sin π ) = ( 2 (0)2 + C C = sin π ) Therefore (3) becomes sin (y) = ( 2 2 + sin π ) This is the general solution in implicit form. If we were asked to solve for eplicit form, then we would need to solve for y: ( ( y = sin 2 2 + sin π ) ). 5. Solve the following separable equation: dy y + 2y 2 = d y 3y + 3 Solution. We need to factor the right hand side: dy y( + 2) ( + 2) = d y( 3) + ( 3) dy ( + 2)(y ) = d ( 3)(y + ) 5
Separate the variables as follows: y + y dy = + 2 3 d Integrate both sides: y + y dy = + 2 d (4) 3 You will need to use substitution or long division to evaluate these integrals. I will do substitution. Left hand side: Let u = y, then du = dy and y = u +. We substitute these into the integral: ( y + u + + y dy = du == + 2 ) du = u + 2 ln u = y + 2 ln y u u Right hand side: Let v = 3, then dv = d and = v + 3. We substitute these into the integral: ( + 2 v + 3 + 2 3 d = du = + 5 ) du = v + 5 ln v = 3 + 5 ln 3 v v Therefore the equation (4) becomes y + 2 ln y = 3 + 5 ln 3 + C y + 2 ln y = + 5 ln 3 + C This would be too difficult to solve for y, so we will leave it in implicit form.. Solve the initial value problem (y 2 cos 3 2 y 2)d + (2y sin 3 + ln(y))dy = 0, y(0) = e Solution. This equation is of the form Md + Ndy = 0. Let s check to see if the equation is eact; that is, we need to see if M y = N : M y = N so this equation is eact! M = y 2 cos 3 2 y 2 M y = 2y cos 3 2 N = 2y sin 3 + ln(y) N = 2y cos 3 2 We want to find an f(, y) such that f = M, so we will integrate M with respect to : f(, y) = Md + g(y) = (y 2 cos 3 2 y 2)d + g(y) = y 2 sin 3 y 2 + g(y)
We want df dy = N, so we will differentiate f with respect to y and set it equal to N: f y = N y (y2 sin 3 y 2 + g(y)) = 2y sin 3 + ln(y) Solve for g (y): and integrate: 2y sin 3 + g (y) = 2y sin 3 + ln y g (y) = ln y g(y) = ln ydy. You will need to use integration by parts to evaluate this integral. Try u = ln y, dv = dy. Then du = y dy, v = y and we have g(y) = ln ydy = y ln y y dy = y ln y y Substituting this into our equation above for f, we have Now set f(, y) = C: f(, y) = y 2 sin 3 y 2 + y ln y y. y 2 sin 3 y 2 + y ln y y = C dy = y ln y y This is the general solution to the differential equation. Now we need to plug in the initial value y(0) = e. When = 0, y = e: e 2 sin 0 (0) 3 e (0) 2 + e ln e = C C = e Therefore the solution is y 2 sin 3 y 2 + y ln y y = e. 7. Solve the initial value problem where f() = through. { ( + 2 ) dy + 2y = f(), y(0) = 0 d, 0 <. Hint: an integrating factor has already been multiplied, Solution. This is a first order linear differential equation. Because f() is a piecewise function, we really have two differential equations. When 0 <, we have and when ( + 2 ) dy + 2y =, y(0) = 0 d ( + 2 ) dy + 2y =, y() =? d 7
Notice the initial condition on the interval is different than the initial condition on the interval 0 <. We won t know what this different initial condition is until we solve the differential equation on the interval 0 <. Let s look at the differential equation on 0 < : ( + 2 ) dy + 2y =, y(0) = 0. d Using the hint that an integration factor has been multiplied through, the left hand side collapses down to a product rule: [( + 2 )y] = Don t believe it? Check it! Then integrate both sides: ( + 2 )y = d ( + 2 )y = 2 2 + C Solve for y: y = 2 2 + C + 2 Then plug in the initial condition y(0) = 0. When = 0, y = 0: 0 = Therefore the solution on 0 < is given by 2 (0)2 + C + (0) 2 C = 0 y = 2 2 + 2. Before we solve the differential equation on the interval, we want to find out the initial condition at =. To do this we plug in = into the solution above: Therefore the IVP on is y() = 2 ()2 + () 2 = 4. ( + 2 ) dy d + 2y =, y() = 4. Using the hint that an integration factor has been multiplied through, the left hand side collapses down to a product rule: [( + 2 )y] = Don t believe it? Check it! Then integrate both sides: ( + 2 )y = d ( + 2 )y = 2 2 + C 8
Solve for y: y = 2 2 + C + 2 Then plug in the initial condition y() = 4. When =, y = 4 : 4 = 2 ()2 + C + () 2 2 = 2 + C C = Therefore the solution on is given by y = 2 2 + + 2. We can write the solution as a the piecewise function: 2 2 y = + 2, 0 <. 2 2 + + 2, 8. Find the general solution of the following homogeneous higher-order differential equations: (a) y + 4y + 7y = 0 (use as the independent variable) Solution. The characteristic equation is r 2 + 4r + 7 = 0. Using the quadratic equation, we see the roots are r = 4 ± 4 2 4()(7) 2 r = 4 ± i2 3 2 = 2 ± i 3. We have two comple roots, hence the solution to the differential equation is y = e 2 (c cos 3 + c 2 sin 3) (b) y (3) + 2y + y = 0 (use as the independent variable) Solution. The characteristic equation is r 3 + 2r 2 + r = 0 which factors as r(r 2 + 2r + ) = 0 r(r + ) 2 = 0. Therefore the roots are r = 0 multiplicity, r = multiplicity 2. The solution to the differential equation is therefore y = c e 0 + c 2 e + c3e or y = c + c 2 e + c 3 e. 9
(c) 2 d2 u dt 2 5du dt 3u = 0 Solution. The characteristic equation is 2r 2 5r 3 = 0, which factors as (2r + )(r 3) = 0. The roots are r = 2, r = 3 each with multiplicity. The solution to the differential equation is therefore y = c e 2 + c 2 e 3. (d) d4 r ds 4 r = 0 Solution. The characteristic equation is m 4 = 0 (we cannot use r as our characteristic equation variable since it is being used in the differential equation). This factors as (m 2 )(m 2 + ) = 0 (m )(m + )(m i)(m + i) = 0. The roots are m =,, ±i. The solution to the differential equation is y = c e + c 2 e + e 0 (c 3 cos + c 4 sin ) y = c e + c 2 e + c 3 cos + c 4 sin. 9. (a) Calculate W (y, y 2, y 3 ) where y = e, y 2 = e 2, y 3 = e 3. Solution. e e 2 e 3 W (e, e 2, e 3 ) = (e ) (e 2 ) (e 3 ) (e ) (e 2 ) (e 3 ) = e e 2 e 3 e 2e 2 3e 3 e 4e 2 9e 3 = e 2e 2 3e 3 e 2 e 3 e + e 2 e 4e 2 9e 3 4e 2 9e 3 2e 2 e 3 3e 3 = e (8e 5 2e 5 ) e (9e 5 4e 5 ) + e (3e 5 2e 3 ) = e (e 5 5e 5 + e 5 ) = 2e (b) Suppose y, y 2 are solutions to the equation 2 y + (2 2 )y + y = 0. Find W (y, y 2 ). Proof. We need to write the differential equation in standard form by dividing through by 2 : y 2 2 + 2 y + 2 y = 0. 0
We see that P () = 2 2 = 2 2. Therefore, by using Abel s Theorem, ( ) ( ( ) ) 2 W (y, y 2 ) = c ep P ()d = c ep d = c ep (2 ln ) = ce 2 ln e = ce ln 2 e = c 2 e 0. (a) The function y = 2 is a solution of 2 y 3y + 4y = 0. Use the method of reduction of order to find a second solution y 2 to the differential equation on the interval (0, ). Proof. We need to write the differential equation in standard form by dividing through by 2 : y 3 y + 4 2 y = 0 (5) Let y 2 = vy where v is a function of. Since y = 2, then y 2 = 2 v. We wish to plug this into the equation above, so we need to find y 2, y 2 using the product rule: y 2 = 2 v y 2 = ( 2 ) v + 2 v = 2v + 2 v y 2 = (2v) + ( 2 v ) = (2) v + 2v + ( 2 ) v + 2 v = 2v + 2v + 2v + 2 v = 2v + 4v + 2 v Substitute these into the standard form equation (5) above: 2v + 4v + 2 v 3 (2v + 2 v ) + 4 2 (2 v) = 0 2v + 4v + 2 v v 3v + 4v = 0 Now let w = v, then w = v and () becomes 2 v + v = 0 () 2 w + w = 0 2 dw d = w. This is a separable equation. Separate the variables: Integrate both sides: dw w = dw w = d d ln w = ln ln w = ln ( ) Solve for w: w =.
But, w = v, and so we have v = v = d = ln Therefore y 2 = 2 v y 2 = 2 ln. (b) Show that y and y 2 form a fundamental set of solutions to the differential equation. Solution. We need to show that W (y, y 2 ) 0 in the interval (0, ). W (y, y 2 ) = 2 2 ln ( 2 ) ( 2 ln ) = 2 2 ln 2 2 ln + = 2 (2 ln + ) 2( 2 ln ) = 3 W = 3 which is nonzero since we are in the interval (0, ). (c) Write the general solution of the differential equation using y and y 2. Solution. The general solution to the differential equation is y = c y + c 2 y 2, which is y = c 2 + c 2 2 ln. 2