MATH 215/255, Homework 3 1. Consider the ODE y 0 (t) = y − t, y(0) = 2. (1) (a) Find the exact solution to this problem, and show that y(1) ≈ 4.71xx. What are the next two digits xx? (b) Use Euler’s method to approximate y (1) with (1) h = 0.5 (2) h = 0.25; and (3) h = 0.125. For each h, record the value you obtained, as well as the error. Based on your data, comment on what happens to the the error each time you half h. Answer. (a) Using integrating factors (or otherwise) we get y(t) = et + t + 1 so that y(1) = e1 + 2 = 4.71828. (b) Here is the table along with the matlab code used to generate it. for h=[0.5, 0.25, 0.125] y=2; for t=0:h:1-h h=0.5 yn=4.25, err=0.468282 y=y+h*(y-t); h=0.25 yn=4.44141, err=0.276876 end; h=0.125 yn=4.56578, err=0.152497 err=exp(1)+2-y; fprintf(’h=%g yn=%g, err=%g\n’,h,y,err); end; The error roughly halfs each time h is halfed. 2. (a) Find the general solution to the ODE y 00 − y 0 − 2y = 0. (b) Find the solution to this ODE subject to initial conditions y(0) = 0, y 0 (0) = −1. Answer. Try the anzatz y = exp (λt) to obtain λ2 − λ − 2λ = (λ + 1) (λ − 2) = 0 so that the general solution is y = Ae−t + Be2t . Initial conditions then yield A + B = 0, −A + 2B = −1 so that y = 31 e−t − e2t . 3. (a) Find the general solution to the ODE 4y 00 − 4y 0 + y = 0. (b) Find the solution to this ODE that in addition satisfies initial conditions y(0) = 1, y 0 (0) = 2. 2 Answer. Try the anzatz y = exp (λt) to obtain 4λ2 − 4λ + 1 = (2λ − 1) = 0. There is a double root λ = 1/2 so that the general solution is y = Aet/2 + Btet/2 . (b) Initial conditions yield A = 1, A/2 + B = 2 so that A = 1, B = 3/2 and y = et/2 + 23 tet/2 . 4. Find real numbers x, y such that z = x + iy where (a) z = Answer. (a) 2 3−4i 2(3+4i) 32 +42 (b) z = e3+iπ/4 . 8 + 25 i == e3 [cos( π4 ) + i sin( π4 )] = e3 √12 + i √12 . = (b) e3+iπ/4 = e3 eiπ/4 2(3+4i) (3−4i)(3+4i) 2 3−4i . = = 6 25 √ 2015 3i. Find r and θ such that z = reiθ . (b) What is 1 + 3i ? √ √ Answer. (a) The point 1, 3 is at distance 2 from the origin. The line through 1, 3 and the √ 2015 origin is at an angle of 60 degrees with the x-axis. Thus r = 2 and θ = π/3. (b) 1 + 3i = iπ/3 2015 2015 iπ2015/3 iπ2015/3 672πi −iπ/3 −iπ/3 2e =2 e . Now 2015/3= 672 −1/3 so that e =e e =e . √ √ 2015 3 2015 −iπ/3 2015 1 Thus 1 + 3i =2 e =2 2 − 2 i . 5. (a) Let z = 1 + √ 6. (a) Find the general solution to the ODE y 00 − 4y 0 + 5y = 0. (b) Find the solution to this ODE that in addition satisfies initial conditions y(0) = 1, y 0 (0) = 2. 1 Answer. Try the anzatz y = exp (λt) to obtain λ2 − 4λ + 5 = 0 =⇒ λ = 2 ± i. So y = e2t eit is a particular solution; and so is its real and imaginary part. Hence e2t cos t and e2t sin t are also solutions so that the general solution is y = Ae2t cos t + Be2t sin t. (b) Initial conditions yield A + B = 1, 2A + B = 2 so that A = 1, B = 0 and y = e2t cos(t) 7. Find the general solution to the ODE y 00 + y = xp for some p. y0 x − 4 x2 y = 0. Hint: first try the solution of the form Answer. Plug in y = xp to obtain p (p − 1) + p − 4 = 0 or p = ±2. So the general solution is y = Ax2 + Bx−2 . 8. A mass of m = 0.1 kg is attached to a spring. The spring constant is known to be k = 50N/m, and you wish to find the friction constant c; recall that the mass motion satisfies mx00 + cx0 + kx = 0. To find the spring constant, you observe the spring oscillates with a frequency of 3 Hertz. Determine c. √ 1 c ±i 2m 4mk − c2 . Answer. Recall that characterisitic equation mλ2 +cλ+k = 0 has roots λ = − 2m c − 2m t The solution is then given by x = Ae √ cos(ωt−C) where A, C are some constants that depend on 1 initial conditions, and where ω = 2m 4mk − c2 . Frequency of 3 Hertz means three full oscillations √ per second, so that ω = 3 × 2π = 6π. Solving for c we then obtain c = 4mk − 4m2 ω 2 ≈ 2.4058. 2