Week 3: First order linear ODEs Instructor: Jérémie Bettinelli (jeremiebettinelli@polytechniqueedu) Tutorial Assistants: Nicolas Brigouleix (groups 2&4, nicolasbrigouleix@polytechniqueedu) Ludovic Cesbron (groups 1&3, ludoviccesbron@polytechniqueedu) The solutions of the exercises that have not been solved during tutorials will be available on the course webpage 1 Basic exercises Understand and master these exercises in order to pass the course Exercise 1 Solve y + 2xy = x and find the solution satisfying y(0) = 1 Solution of exercise 1 The solutions to the associated homogeneous equation y = 2xy are the functions x R ce x2 for any c R We now need to find a particular solution Before plunging into the method of the variation of constants, it is always a good idea to try simple guesses: here, x R 1 2 works! Alternatively, if no solutions had come to mind, we use the variation of constants as follows We look for one particular solution of the form z : x R c(x)e x2 where c : R R is a differentiable function z + 2xz = x c (x)e x2 2xc(x)e x2 + 2xc(x)e x2 = x c (x)e x2 = x c (x) = xe x2 For instance, c : x R 1 2 ex2 works This gives z(x) = c(x)e x2 = 1 2 ex2 e x2 = 1 2 All in all, the solutions to y + 2xy = x are the functions x R 1 2 + ce x2 for any c R The solution satisfying the initial condition y(0) = 1 is the function x R 1 2 +ce x2 with 1 2 +ce0 = 1, that is, c = 1 2 In other words, this is the function x R 1 2( 1 + e x 2 ) Exercise 2 Solve y + 3y + xe 2x = 0 Solution of exercise 2 The solutions to the homogeneous equation y = 3y are the functions x R ce 3x for any c R We recognize that the ODE has a particular form (y = αy +P (x)e βx ) for which we know a faster way than to use variation of constants We know that there exists a particular solution 1
of the form z : x R (ax + b)e 2x where a, b R We have z + 3z + xe 2x = 0 ( a + 2(ax + b) ) e 2x + 3(ax + b)e 2x + xe 2x = 0 (5a + 1)x + (5b + a) = 0 a = 1 5 and b = 1 25 The solutions to y + 3y + xe 2x = 0 are thus the functions ( x R 1 5 x + 1 ) e 2x + ce 3x for any c R 25 2 Important exercises Master these exercises for a good grade Exercise 3 Non uniqueness of solutions with an initial condition 1 Solve y = 2 y 2 Can we speak of the solution satisfying y(0) = 0? Solution of exercise 3 1 This equation only makes sense for nonnegative functions y The only constant solution is y 0 Assuming y positive, we can rewrite the ODE as y 2 y = 1 ( y ) = 1 λ R, y = x λ As y > 0, this only works for x > λ We thus obtain y λ : x (λ,+ ) (x λ) 2 Let us see now if this solution can be extended at x = λ As x λ, y λ (x) 0 and y λ (x) = 2(x λ) 0, so that y λ can be patched in a C 1 way with x (,λ] 0 Finally, the solutions are the functions x R (x λ) 2 1 (λ,+ ) (x) for λ R y (x λ) 2 1 (λ,+ ) (x) 0 λ x 2 No, there is an infinite number of solutions satisfying this initial condition, namely all the 2
functions x R (x λ) 2 1 (λ,+ ) (x) with λ R + Recall that we learned that Cauchy Lipschitz (existence and uniqueness of solutions satisfying an initial condition) works with equations of the form y = a(x)y + b(x) where a, b : I R are continuous functions We have here an example showing that Cauchy Lipschitz does not apply in general! Exercise 4 We consider the following system of ODEs: x = x + 3y + e t y = 2x + 4y 1 What is this? 2 Diagonalize the matrix A associated with this system of ODEs Hint: Recall that, in order to diagonalize A M n (R), you need to find n numbers λ i R and nonzero vectors v i R n \ {0} such that Av i = λ i v i The diagonal matrix D associated with A is then the matrix with these λ i on the diagonal and the matrix P = (v 1,v 2,,v n ) will be such that A = P DP 1 3 Solve the homogeneous system 4 Solve the full system Solution of exercise 4 1 This a linear first order nonhomogeneous system of 2 ODEs 2 The matrix A associated with the system is 1 3 A = 2 4 In order to solve this ODE, we need to diagonalize the matrix A, to which end we look for any λ R and v = (a,b) (0,0) such that Av = λv: a + 3b = λa b = 4 λ 2 a and λ 4 Av = λv 2a + 4b = λb λ 2 3λ + 2 = 0 λ = 1 and b = 2 3 a or λ = 2 and b = a The matrix A has two eigenvalues, 1 and 2, associated respectively with the eigenvectors (3,2) 3
and (1,1) We thus have A = P DP 1, where 3 1 1 0 P = 2 1 and D = 0 2 Note: this is very classical algebra; if you have not seen it yet, you will very soon see it in Algebra 102 3 The homogeneous equation is X = AX = P DP 1 X As a result, if we introduce Y = P 1 X, then Y satisfies Y = DY, the set of solutions to which is { t e td α β = αe t }, α,β R βe 2t Hence, the solutions to the homogeneous equation are X = P Y for Y in the previous set The set of solutions is thus given by { S H = t α 2e t + β e 2t }, α,β R 4 To solve the original system of ODEs, we need to find a particular solution We can find one using the variation of constants We write X p = α(t) 2e t + β(t) e 2t and see that X p is a particular solution of our ODE if and only if X p = AX p + B(t) α (t) 2e t + e 2t β (t) = e t 0 α (t)3e t + β (t)e 2t = e t α (t)2e t + β (t)e 2t = 0 3α (t) + 2β (t)e t = 1 2α (t) + β (t)e t = 0 β (t) = 2e t α (t) = 1 We can take for instance α(t) = t and β(t) = 2e t and that gives us the particular solution X p (t) = t 2e t + e 2t 2e t = (3t + 2)e t (2t + 2)e t 4
The set of solutions to the ODE X = AX + B(t) is then { (3t + 2 + 3α)e t + βe 2t S = t (2t + 2 + 2α)e t + β, } α,β R In other words, the solutions are the functions x : t R (3t + 2 + 3α)e t + βe 2t y : t R (2t + 2 + 2α)e t + βe 2t, for any α,β R 3 Homework exercises Prepare these exercises for the next TA session (week 4); they will be corrected at the beginning of the session Exercise 5 Solve 2y 5y = 3 ( cos(2x) + 1 ) Exercise 6 Solve y ( ) 2x 1 x y = 1 on R + 4 More involved exercises (optional) Master these exercises in order to exceed expectations Exercise 7 Solve x ( 1 + log 2 (x) ) y + 2log(x)y = 1 on (0,+ ) Exercise 8 Solve x y + (x 1)y = x 3 5 Fun exercises (optional) Do these exercises for fun! Exercise 9 Savings account Professor K wants to set up a savings account for his pet capybaras 1 He initially places 2000 reeds in a savings account that pays interest at the rate of 1% per year and arranges for 15 reed to be deposited weekly into the savings account Knowing that his capybaras eat 3 reeds a day, he wonders how long it is going to be before they are starved We assume that the interests are computed continuously and that the deposits and withdrawals are continuous 1 Write a differential equation the amount r(t) on deposit after t years 2 When will the account dry out? 1 5