Math 257/316 Assignment 1 Solutions Problem 1. Find the solution to the initial value problem for the ODE dy 1+y = dx 1+x for each of the initial conditions (a) y(0) = 1, (b) y(0) = −1, (c) y(0) = −2 The ODE is both separable and linear, so we can solve it either way. Let’s use its separability: Z Z dx dy = =⇒ ln |1+y| = ln |1+x|+C or, taking the exponential |y+1| = K(x+1) 1+y 1+x (since all the initial values are posed at x = 0, we have x + 1 > 0 and we can safely remove the absolute value from x + 1). (a) y(0) = 1 =⇒ 2 = K =⇒ y + 1 = 2(x + 1) =⇒ y = 2x + 1 (since y(0) = 1, we have y + 1 > 0 and we can remove the absolute value from y + 1). (b) y(0) = −1 =⇒ 0 = K =⇒ y + 1 = 0 =⇒ y = −1 (again we can remove the absolute value). (c) y(0) = −2 =⇒ 1 = K =⇒ |y + 1| = x + 1 =⇒ −(y + 1) = x + 1 =⇒ y = −x − 2 (since y(0) = −2, y+1 < 0 and we must introduce a minus sign when removing the absolute value). Problem 2. Find the general solutions to: (a) y 00 − 2y = 0 This is second-order constant-coefficient, whose characteristic equation r2 − 2 = 0 has √ roots r = ± 2, so the general solution is √ y = c1 e 2x √ + c2 e− 1 2x . (b) y 00 + y 0 − 6y = 0 Also second-order constant coefficient, with characteristic equation 0 = r2 + r − 6 = (r + 3)(r − 2) having roots r = 2 and r = −3. So the general solution is y = c1 e2x + c2 e−3x . (c) y 00 + 2y 0 + y = 0 Again, second-order constant coefficient, with characteristic equation 0 = r2 + 2r + 1 = (r + 1)2 having double root r = −1, so the general solution is y = c1 e−x + c2 xe−x . Problem 3. Find the solutions to the initial value problems: (a) y 00 + 9y = 0, y(0) = 1, y 0 (0) = 6 The characteristic equation r2 + 9 = 0 has roots r = ±3i, so the general solution is y = c1 cos(3x) + c2 sin(3x), and y 0 = −3c1 sin(3x) + 3c2 cos(3x). 1 = y(0) = c1 , (b) y 00 − 2y 0 + 5y = 0, 6 = y 0 (0) = 3c2 =⇒ c2 = 2 =⇒ y = cos(3x) + 2 sin(3x). y(0) = 1, y 0 (0) = 7 √ The characteristic equation 0 = r2 −2r+5 has roots r = 1± 1 − 5 = 1±2i so the general solution is y = ex (c1 cos(2x) + c2 sin(2x)), and y 0 = ex ((c1 + 2c2 ) cos(2x) + (c2 − 2c1 ) sin(2x)). 1 = y(0) = c1 , 7 = y 0 (0) = c1 +2c2 = 1+2c2 =⇒ c2 = 3 =⇒ y = ex (cos(2x) + 3 sin(2x)) . (c) x2 y 00 + 6xy 0 + 6y = 0, y(1) = 0, y 0 (1) = 1 This is an Euler ODE, with characteristic equation 0 = r(r − 1) + 6r + 6 = r2 + 5r + 6 = (r + 3)(r + 2) having roots r = −2 and r = −3, so the general solution (for x > 0) is y = c1 x−2 + c2 x−3 , and so y 0 = −2c1 x−3 − 3c2 x−4 . 0 = y(1) = c1 + c2 =⇒ c2 = −c1 , 1 = y 0 (1) = −2c1 − 3c2 = c1 , 2 =⇒ y = x−2 − x−3 . Problem 4. Find the first six non-zero terms in the power series y = general solution of the second-order, linear, homogeneous ODE: P∞ n n=0 an x of the (x2 − 1)y 00 + 3xy 0 + y = 0 P∞ P n−2 and plug into the ODE to n−1 , y 00 = Compute y 0 = ∞ n=2 n(n − 1)an x n=1 nan x find 0 = (x2 − 1) ∞ X n(n − 1)an xn−2 + 3x n=2 = ∞ X ∞ X nan xn−1 + n=1 n n(n − 1)an x − n=2 ∞ X n(n − 1)an x n−2 ∞ X an xn n=0 + n=2 ∞ X n 3nan x + n=1 ∞ X an xn n=0 and shifting the index in the second series, 0= ∞ X n n(n − 1)an x − n=2 ∞ X n (n + 2)(n + 1)an+2 x + n=0 ∞ X n 3nan x + n=1 ∞ X an xn n=0 The easiest way to proceed now, is to recognize that in both the first and third series, we can just change the starting point to n = 0 without changing the sums (because the terms we introduce by doing this are all zero), so: 0= = = ∞ X n=0 ∞ X n=0 ∞ X n(n − 1)an xn − ∞ X (n + 2)(n + 1)an+2 xn + n=0 ∞ X 3nan xn + n=0 ∞ X an xn n=0 [(n(n − 1) + 3n + 1)an − (n + 2)(n + 1)an+2 ] xn (n + 1)2 an − (n + 2)(n + 1)an+2 xn . n=0 (Note: we could also have combined the sums starting at n = 2, and collected the remaining n = 0 and n = 1 terms from the last three sums separately – it would work out the same.) Thus the recurrence relation is n+1 (n + 1)2 an − (n + 2)(n + 1)an+2 = 0 =⇒ an+2 = an , n = 0, 1, 2, 3, . . . . n+2 So a0 and a1 are free, while 1 2 3 3 4 4·2 a2 = a0 , a3 = a1 , a4 = a2 = a0 , a5 = a3 = a1 , · · · 2 3 4 4·2 5 5·3 and 1 3 4 2 4·2 5 y = a0 1 + x2 + x + · · · + a1 x + x3 + x + ··· . 2 4·2 3 5·3 3