LECTURE 6 First Orer Linear Differential Equations A linear first orer orinary ifferential equation is a ifferential equation of the form ( a(xy + b(xy = c(x. Here y represents the unknown function, y its erivative with respect to the variable x, an a(x, b(c an c(x are certain prescribe functions of x (the precise functional form of a(x, b(x, an c(x will fixe in any specific example. So long as a(x 0, this equation is equivalent to a ifferential equation of the form (2 y + p(xy = g(x where p(x = b(x a(x, g(x = c(x a(x. We shall refer to a ifferential equation (2 as the stanar form of ifferential equation (. (In general, we shall say that an orinary linear ifferential equation is in stanar form when the coefficient of the highest erivative is. Our goal now is to evelop a formula for the general solution of (2. To accomplish this goal, we shall first construct solutions for several special cases. Then with the knowlege gaine from these simpler examples, we will evelop a general formula for the solution of any ifferential equation of the form (2.. The Homogeneous Case Let s begin with the case when the function g (x on the right han sie of (2 is ientically 0. ((3 y + p (x y = 0. The solution of this special case will actually play a funamental role in our solution of the general case later on. A similar phenomenon will happen when we look at secon orer linear ifferential equations. Because of this, we have a special nomenclature for the two basic possibilities for y-inepenent terms of a linear ifferential equation. We say that y + p (x y = 0 is a homogeneous st orer linear ifferential equation an y + p (x y = g (x is a nonhomogeneous st orer linear ifferential equation whenever g (x 0. OK. Let s see if we can solve (3. This is in fact relatively easy since (3 can be written in separable form: y + p (x y = 0 y 24 y = p (x x
. THE HOMOGENEOUS CASE 25 Applying the technique we evelope for Separable Equations: y = p (x x y y y = p (x x + C ln y = p (x x + C ( y = exp p (x x + C ( y = exp p (x x exp (C ( y = A exp p (x x where A = exp (C is an arbitrary constant Example 6.. Integrating both sies of the latter equation (the left han sie with respect to y an the right han sie with respect to x yiels ln(y = x p(x x + C or, exponentiating both sies [ x y = exp p(x x + C [ x y = exp p(x x + C [ x = e C exp p(x x [ x = A exp p(x x In the last step we have simply replace the constant e C, which is arbitrary since C is arbitrary, by another arbitrary constant A. There is nothing tricky here; the point is that in the general solution the numerical factor in front of the exponential function is arbitrary an so rather than writing this factor as e C we use the simpler form A. Thus, the general solution of is Example 6.2. y + 3 x y = 0 y + p(x = 0 [ x y = A exp p(x x First, we recognize this ifferential equation as a separable ifferential equation: y + 3 x y = 0 y. y x = 3 x We next apply the technique for solving separable equations: y = 3xx y y y = 3 x x + C ln y = 3 ln x + C y = exp ( 3 ln x + C y = exp ( 3 ln x exp (C y = A exp ( 3 ln x where A = exp (C is an arbitrary constant Digression: (a very common an useful ientity Let me begin by recalling three basic facts:
2. A SIMPLE NONHOMOGENOUS CASE 26 (i The exponential function exp (x e x where e = 2.7828... is the natural logarithmic base. (ii The logarithm function is the functional inverse of the exponential function: exp (ln x = x = ln (exp (x. (iii Powers of powers of a number obey ( A b c = A bc. Now consier the ientity Thus, we have an ientity x = exp (ln x by (ii x = e ln x by (i ( x a = e ln(x a = e a ln x exp (a ln x = x a by (i (4 exp (a ln x = x a by (iii Using this ientity, we can simply our expression for the general solution of y + 3 x y = 0: y = A exp ( 3 ln x y (x = Ax 3 Example 6.3. (Example Reloae In the preceing example, we solve y + 3 xy = 0 by repeating the steps by which we solve the general case y +p (x y = 0. However, the main reason for treating the general case, was to get a general formula for that case. Inee, ropping the intermeiary steps we have from our initial iscussion (5 y + p (x y = 0 y (x = A exp ( p (x x So another way of attacking y + 3 xy = 0 is to recognize it as a particular instance of the case governe by the formula (5. Thus, we can also procee as follows: y + 3 x y = 0 is of the form y + p (x y = 0 when we take p (x = 3 x. Plugging p (x = 3 x into the formula (5 for the solution of y + p (x y = 0 yiels ( 3 y (x = A exp x x = A exp ( 3 ln x = Ax 3 (applying ientify (4 Thus, recovering the same answer but a little more efficiently.. 2. A simple nonhomogenous case We are still not prepare to attack ifferential equations of the form y + p (x y = g (x x when g (x 0. However, we ll continue to pursue our strategy of eveloping solution techniques by introucing complications in a very controlle way. Having hanle the case when g (x = 0, the next simple case we might consier is when g (x 0 but at least the function p (x is only a constant; say p (x = a for all x. So now we ll try to solve (6 y + ay = g (x x where a is a constant.
3. THE GENERAL CASE 27 To solve this equation we ll employ a trick. Let s multiply both sies of this equation by e ax : e ax y + ae ax y = e ax g(x. Noticing that the right han sie is x (eax y (via the prouct rule for ifferentiation, we have x (eax y = e ax g(x. We now take anti-erivatives of both sies to get e ax y = x e ax g(x x + C or Example 6.4. y(x = x e ax e ax g(x x + Ce ax. y 2y = x 2 e 2x This equation is of type (iii with p = 2 g(x = x 2 e 2x. So we multiply both sies by e 2x to get ( e 2x y = e 2x (y 2y = e 2x ( x 2 e 2x = x 2 x Integrating both sies with respect to x, an employing the Funamental Theorem of Calculus on the left yiels or Let us now confirm that this is a solution e 2x y = 3 x3 + C y = 3 x3 e 2x + Ce 2x. y = x 2 e 2x + 2 3 x3 e 2x + 2Ce 2x so 2y = 2 3 x3 e 2x 2Ce 2x y 2y = x 2 e 2x 3. The General Case We are now prepare to hanle the case of a general first orer linear ifferential equation; i.e., ifferential equations of the form (7 y + p(xy = g(x with p(x an g(x are arbitrary functions of x. Note: This case inclues all the preceing cases. Accoring to Richar Feynman, if you employ a trick more than once, it becomes a metho. Inee, shortly, the trick introuce here will lea to a bone-fie metho - the integrating factors metho.
3. THE GENERAL CASE 28 We shall construct a solution of this equation in a manner similar to case when p(x is a constant; that is, we will try fin a function µ(x satisfying (8 µ(x (y + p(xy = x (µ(xy Multiplying (7 by µ(x, we coul then obtain which when integrate yiels or (µ(xy = µ(xg(x x µ(xy = x µ(x g(x x + C (9 y = x µ(x g(x x + C µ(x µ(x It thus remains to fin a suitable function µ(x; i.e., we nee to fin a function µ(x so that This will certainly be true if (0 For then x (µ(xy = µ(xy + p (x µ(xy µ(x = p(xµ(x. x ( x (µ(xy = µ(xy + x µ (x y = µ(xy + p (x µ(xy Thus, we have to solve another first orer, linear, ifferential equation of type (iii. As before we re-write (0 in terms of ifferentials to get µ µ = p(xx, an then integrate both sies; yieling ln(µ = x p(x x + A. Exponentiating both sies of this relation yiels ( x µ = exp p(x x + A ( x µ = exp p(x x + A ( x = A exp p(x x So a suitable function µ(x is ( x µ(x = A exp p(x x Inserting this expression for µ(x into our formula (9 for y yiels [ ( x x y(x = A exp ( x p(x x A exp p(x x g(x x + C
3. THE GENERAL CASE 29 It is easily see that the constant A in the enominator is irrelevant to the final answer. This is because it can be cancele out by the A within the integral over x, an it can be absorbe into the arbitrary constant C in the secon term. Thus, the general solution to a first orer linear equation is given by (a y(x = µ(x where (b Example 6.5. y + p(xy = g(x x µ(x g(x x + ( x µ(x = exp p(x x (2 xy + 2y = sin(x C µ(x Putting this equation in stanar form requires we set Now so Therefore, p(x x = p(x g(x = 2 x = sin(x x 2 x x = 2 ln(x = ln ( x 2, µ(x = exp [ x p(x x = exp [ ln ( x 2 = x 2 x y(x = µ(x g(x x + C µ(x µ(x = x x 2 (x 2 sin(x x x + C x 2 = x 2 x x sin(x x + C x 2 Now x sin(x x can be integrate by parts. Set Then u = x, v = sin(xx u = x, v = v = cos(x an the integration by parts formula, uv = uv vu, tells us that x sin(x x = x cos(x + cos(x x = x cos(x + sin(x.
3. THE GENERAL CASE 30 Therefore, we have as a general solution of (2, y(x = x 2 ( x cos(x + sin(x + C x 2 = x 2 sin(x x cos(x + C x 2.