Mathematics for Physics 3: Dynamics and Diﬀerential Equations 12 63 Lecture 12: Second order diﬀerential equations - solutions methods: D’Alembert method and solution in a series In the previous lecture we discussed general properties of second and higher order equations. I particular, we looked at linear equations, and found that the general solution of non-homogeneous linear equations may be obtained as the sum of the general homogeneous solution plus a particular solution to the non-homogeneous equation. We then saw that the general homogeneous solution of an n-th order linear DE may be written as a linear combination of n linealy independent solutions. We now wish to concentrate on methods to solve non-trivial second- and highe-order equations. We will discuss two methods: D’Alembert method and solution in a series. Second order linear ODE: D’Alembert method Let us consider linear equations of the general form: ÿ + p(t)ẏ + q(t)y = r(t) (187) The general solution of these equations can be written as y(t) = yH (t) + yP (t) where yH (t) is the general solution of the homogeneous equation ÿ + p(t)ẏ + q(t)y = 0 (188) and yP (t) is a particular solution of (187). Let us assume that we have already determined yH (t) and we now wish to find a particular solution to (187) with the specified non-homogeneous r.h.s. r(t). The following is a general method to do that, which is called the D’Alembert method, or the method of variation of constants. Let f (t) be a solution to the homogeneous equation (188). N.B. It is emphasized that f (t) does not have to be the most general solution, just pick one of the two solutions to (188). Let us change the dependent variable from y(t) to x(t) such that: y(t) = x(t)f (t) . Since all functions are functions of t only we omit the notation (t), implying that dependence on t is understood. Computing the derivatives we get: ẏ = ẋf + xf˙ and substitution into (187) yields: ÿ = ẍf + 2ẋf˙ + xf¨ � � � � ẍf + 2ẋf˙ + xf¨ + p ẋf + xf˙ + qxf = r Collecting the various derivatives of x on the l.h.s. we get: � � � � ẍf + ẋ 2f˙ + pf + x f¨ + pf˙ + qf � �� � =r vanishes since f (t) solves (188) The last term, where the derivatives act always on f , is all we would have obtained if x were a constant. This combination vanishes owing to the fact that f (t) satisfies the homogeneous equation (188). We therefore remain with the following diﬀerential equation: � � f ẍ + 2f˙ + pf ẋ = r which is free of explicit x dependence, and can therefore be readily reduced to a first order equation by defining the dependent variable to be v(t) = ẋ(t): � � f v̇ + 2f˙ + pf v = r or � f˙ � r v̇ + 2 + p v = f f This equation can be solved by previous methods. We thus conclude that we have a general method to determine a particular solution to a linear non-homogeneous second order ODE, starting from the known solution of the corresponding homogeneous equation. Mathematics for Physics 3: Dynamics and Diﬀerential Equations 64 Example: Solve t2 ÿ + tẏ − 4y = t3 (189) First we need a solution of the homogeneous equation t2 ÿ + tẏ − 4y = 0 Let us try a solution of the form y = tβ . We have ẏ = βtβ−1 and ÿ = β(β − 1)tβ−2 so the equation yields β(β − 1) + β − 4 = 0 β = ±2 =⇒ Thus the solutions of the homogeneous equations are t2 and t−2 . To use D’Alembert method we pick one of them, say t2 , and write: yP (t) = x(t)t2 Let’s substitute this into the original non-homogeneous equation (189). We have: ẏ = ẋt2 + 2tx, ÿ = ẍt2 + 4tẋ + 2x . Substituting this into (189) we get: t2 (ẍt2 + 4tẋ + 2x) + t(ẋt2 + 2tx) − 4xt2 = t3 or ẍt + 5ẋ = 1 which is can be readily reduced to a first order equation by defining v = ẋ. v̇t + 5v = 1 This equation is separable and gives: dv dt = 1 − 5v t =⇒ recovering x: x= and finally y = xt2 : � 1 − ln(1 − 5v) = ln t + ln c 5 t v(t)dt = � t dτ � 1 1 − 5 5(cτ )5 � =⇒ = v= 1 1 − 5 5(ct)5 t c1 − + c2 5 t4 t3 c1 − 2 + c 2 t2 5 t where we can identify the first term as a particular solution and the latter two as the solutions to the homogeneous equation. y(t) = Diﬀerential equations: solution in a series We have just learnt and illustrated the D’Alembert method, extending the set of tools we have to deal with nonhomogeneous linear diﬀerential equations. Now we discuss another method to handle ordinary diﬀerential equations, namely solution in series. The range of examples where this method can be used is vast, and includes in particular: • linear ODE’s with variable (non-constant) coeﬃcients (both homogeneous and non-homogeneous) • non-linear ODE’s, both are classes of problems we have not addressed in general before. The starting point is to expand the dependent function, say y(x), in Taylor expansion about a given point x = x0 , y(x) = ∞ � y (k) (x0 ) k=0 k! (x − x0 )k . (190) The unknown function y(x) is thus replaced by an infinite set of constant (x independent) coeﬃcients, namely its derivatives about the point x = x0 . It should be noted that some care is needed in choosing the point about which to expand. The series is not guaranteed to converge, and it often has a finite radius of convergence R, namely it converges for |x − x0 | < R. Mathematics for Physics 3: Dynamics and Diﬀerential Equations 65 Since it is always possible to first shift the independent variable, we can consider, with out loss of generality, a Maclaurin series, i.e. The Taylor expansion about x = 0, y(x) = ∞ � k=0 ak xk = a0 + a1 x + a2 x2 + a3 x3 + · · · , (191) where we defined y (k) (0) . (192) k! The strategy will be to seek a solution of the ODE in the form of (191), i.e. an infinite polynomial. Obviously, if the exact solution is a finite polynomial, we will readily find it this way (see example I below). But the method works in a much wider class of problems. First, in some cases an approximation based on the first few orders is suﬃcient. Second, as we shall see, in certain cases it is possible to compute the coeﬃcients ak to all orders and then sum up the series to obtain a closed form expression, an explicit solution for y(x). The latter will be our goal. In order to translate the diﬀerential equation into conditions on the coeﬃcients ak we need to expand out each and every term in the equation so as to express the entire equation as a power series in the independent variable (x). In particular we may have to expand: ak ≡ • Derivatives of the dependent variable y (n) (x), for example, the first derivative, y � (x) = a1 + 2a2 x + 3a3 x2 + · · · = ∞ � k ak xk−1 = k=1 ∞ � (k + 1) ak+1 xk , (193) (k + 2)(k + 1) ak+2 xk , (194) k=0 and the second, y �� (x) = 2a2 + 6a3 x + · · · = ∞ � k=2 k(k − 1) ak xk−2 = ∞ � k=0 In each of these cases the first sum is obtained by diﬀerentiating term by term (diﬀerentiation is a linear operation) while the second sum is obtained from the first by shifting the summation index such that the power of x is restored. • products of derivatives of the dependent variable with functions of the independent variable. In general, the equation may have terms such as g(x)y � . To expand it in powers of x one may first expand g(x) and then multiply this expansion, with the expansion of y � . A simple example is xy � (x) = a1 x + 2a2 x2 + 3a3 x3 + · · · = ∞ � k a k xk , (195) k=1 2 • Non-linear terms such as (y(x)) : 2 (y(x)) = � ∞ � n=0 an x n �� ∞ � am x m m=0 � = ∞ � k � an ak−n xk (196) k=0 n=0 It is easiest to learn the method by looking at specific examples. We consider two diﬀerential equations in turn. The first is a first order linear equation whose exact solution is a finite polynomial. The second is a more complicated first order equation, whose exact solution is non-polynomial, and yet, it is simple enough to obtain by summing the power series. An even more complicated example will be done in the next lecture. All the examples we will study are simple, and may be solved by other methods. Yet they are useful to illustrate the method. Example I: first order diﬀerential equation with a finite polynomial solution Consider the equation xy � − y = x3 . Using the expansion for y(x) in (191) and for xy � (x) in (195) the l.h.s. of the equation takes the form: LHS = ∞ � k=1 k ak xk − ∞ � k=0 ak xk = ∞ � k=0 (k − 1) ak xk Mathematics for Physics 3: Dynamics and Diﬀerential Equations 66 The r.h.s. requires no expansion as it is a pure power, RHS = x3 Comparing the l.h.s. to the r.h.s. power by power, we find: k = 0 −a0 = 0 =⇒ a0 = 0 k = 1 0a1 = 0 =⇒ a1 arbitrary k = 2 a2 = 0 =⇒ a2 = 0 k = 3 2a3 = 1 =⇒ a3 = k≥4 We therefore conclude that (197) 1 2 (k − 1)ak = 0 =⇒ ak = 0 1 y(x) = a1 x + x3 2 which is the exact general solution of the diﬀerential equation considered. We observe that we got both the homogeneous part of the solution, with its arbitrary coeﬃcient (here expressed as a1 ), and the particular part. Example II: first order diﬀerential equation with an exponential solution Consider the example y � − y = x2 . Now the l.h.s. has the following expansion: LHS = ∞ � k=1 k ak xk−1 − ∞ � ak xk = k=0 The r.h.s is a simple power, as before: ∞ � k=0 (k + 1) ak+1 xk − ∞ � ak xk = k=0 ∞ � � k=0 � (k + 1) ak+1 − ak xk RHS = x2 Comparing the l.h.s. to the r.h.s. power by power, we find: k = 0 a1 − a0 = 0 =⇒ a0 is arbitrary, and a1 = a0 k = 1 2a2 − a1 = 0 =⇒ a2 = 12 a1 = 12 a0 k = 2 3a3 − a2 = 1 =⇒ a3 = 13 a2 + k≥3 (k + 1)ak+1 − ak = 0 =⇒ ak+1 = 1 3 = 16 a0 + 1 3 (198) 1 k+1 ak We now obtained a typical situation for solution in a series: a recursion relation between coeﬃcients of diﬀerent order. We would like to solve this recursion to have an explicit expression for the general ak coeﬃcient. In our case this is simple to do. In fact we can see the solution by computing a few more terms: 1 1 1 1 a4 = a0 + and a5 = a0 + 2·3·4 3·4 2·3·4·5 3·4·5 so we can guess the solution, for any k ≥ 4: a0 + 2 ak = k! so summing up the series we have: � � � 3 � x2 x3 xk x xk y(x) = a0 1 + x + + + ... + + ... + 2 + ... + + ... 2 6 k! 6 k! which we may write as: � � � � x2 x3 xk x2 y(x) = (a0 + 2) 1 + x + + + ... + + ... − 2 1 + x + 2 6 k! 2 and we observe that the first series simply sums up to an exponential: � � x2 x y(x) = (a0 + 2)e − 2 1 + x + 2 which is the final solution. We observe again that we got both the homogeneous part of the solution, with its arbitrary coeﬃcient (here expressed as a0 + 2), and the particular part.