Jim Lambers MAT 285 Spring Semester 2012-13 Week 13 Notes These notes correspond to Sections 4.1-4.4 in the text. Higher Order Linear Equations We now consider linear ODE of order n > 2, which have the form y (n) + p1 (t)y (n−1) + p2 (t)y (n−2) + · · · + pn−1 (t)y 0 + pn (t)y = g(t), where y (n) = dn y/dtn , with n initial conditions y(t0 ) = y0 , y 0 (t0 ) = y00 , y 00 (t0 ) = y000 , (n−1) y (n−1) (t0 ) = y0 . We will see that these equations can be solved using techniques very similar to those we have learned for solving second-order equations. General Theory of nth Order Linear Equations If the coefficients p1 (t), . . . , pn (t) and g(t) are continuous on an open interval I, then the above initial value problem has a unique solution on I. In order obtain this unique solution, we can first obtain a general solution of the form y(t) = c1 y1 (t) + c2 y2 (t) + · · · + cn yn (t) + yp (t), where c1 , c2 , . . . , cn are constants that are determined by the initial conditions and yp (t) is a particular solution of the ODE, which is zero if g(t) = 0 (that is, the ODE is homogeneous. Once we obtain the general solution, we need to solve a system of n linear equations c1 y1 (t0 ) + c2 y2 (t0 ) + · · · + cn yn (t0 ) = y0 − yp (t0 ), c1 y10 (t0 ) + c2 y20 (t0 ) + · · · + cn yn0 (t0 ) = y00 − yp0 (t0 ), .. . (n−1) c1 y1 (n−1) (t0 ) + c2 y2 (n−1) (t0 ) + · · · + cn yn(n−1) (t0 ) = y0 − yp(n−1) (t0 ) for the n unknown values c1 , c2 , . . . , cn . This system of equations has a unique solution if and only if the determinant of the cofficient matrix y1 (t0 ) y2 (t0 ) ··· yn (t0 ) y10 (t0 ) y20 (t0 ) ··· yn0 (t0 ) A(t0 ) = .. .. . . (n−1) (n−1) (n−1) y1 (t0 ) y2 (t0 ) · · · yn (t0 ) has a nonzero determinant. That is, the Wronskian W (y1 , y2 , . . . , yn )(t0 ) = det A(t0 ) 1 must be nonzero. When this is the case, we say that the solutions y1 , y2 , . . . , yn form a fundamental set of solutions of the homoegeneous form of the ODE. If W (y1 , y2 , . . . , yn )(t) 6= 0 for some t in an interval I, we also say that y1 , y2 , . . . , yn are linearly independent on I. In general, we say that a set of n functions {y1 , y2 , . . . , yn } is linearly indepdendent if the equation c1 y1 (t) + c2 y2 (t) + · · · + cn yn (t) = 0, where c1 , c2 , . . . , cn are constants, is only satisfied when c1 = c2 = · · · cn = 0. Equivalently, {y1 , y2 , . . . , yn } is a linearly independent set if and only if it is not possible to express any function yi in the set as a linear combination yi (t) = n X dj yj (t), 1 ≤ i ≤ n, j=1,j6=i of the other functions in the set, which would make yi redundant in a general solution. A set of functions that is not linearly independent is said to be linearly dependent. These notions of linear indepdendence and dependence are exactly the same as those defined for vectors, as functions themselves can be treated as vectors. Example Let y1 (t) = cos2 t, y2 (t) = sin2 t, y3 (t) = cos 2t. Then cos2 t sin2 t cos 2t 2 sin t cos t −2 sin 2t W (y1 , y2 , y3 )(t) = det −2 sin t cos t 2 2 2 2 2 sin t − 2 cos t 2 cos t − 2 sin t −4 cos 2t = cos2 t[(2 sin t cos t)(−4 cos 2t) − (−2 sin 2t)(2 cos2 t − 2 sin2 t)] − sin2 t[(−2 sin t cos t)(−4 cos 2t) − (−2 sin 2t)(2 sin2 t − 2 cos2 t)] + cos 2t[(−2 sin t cos t)(2 cos2 t − 2 sin2 t) − (2 sin t cos t)(2 sin2 t − 2 cos2 t)] = −8 sin t cos3 t cos 2t + 4 cos4 t sin 2t − 4 sin2 t cos2 t sin 2t − [8 sin3 t cos t cos 2t + 4 sin4 t sin 2t − 4 sin2 t cos2 t sin 2t] + −4 sin t cos3 t cos 2t + 4 sin3 t cos t cos 2t − 4 sin3 t cos t cos 2t + 4 sin t cos3 t cos 2t = −8 sin t cos t cos 2t + 4 cos2 t sin 2t − 4 sin2 t sin 2t = −4 sin 2t cos 2t + 4 cos t sin 2t = 0. It follows that these functions are linearly dependent. This can be seen by using the trigonometric identity cos 2t = cos2 t − sin2 t to conclude that y3 (t) = y1 (t) − y2 (t). That is, y3 (t) is a linear combination of y1 (t) and y2 (t). 2 Homogeneous Equations with Constant Coefficients We now consider an nth order, linear, homogeneous ODE with constant coefficients, which has the form y (n) + p1 y (n−1) + p2 y (n−2) + · · · + pn−2 y 00 + pn−1 y 0 + pn y = 0, where p1 , p2 , . . . , pn are constants. As in the second-order case, this ODE can be rewritten as a system of n first-order equations in new variables corresponding to y, y 0 , y 00 , . . . , y (n−1) . 2 By attempting to decouple these equations from one another so that they can be solved independently, as in the second-order case, we obtain the characteristic equation λn + p1 λn−1 + p2 λn−2 + · · · + pn−2 λ2 + pn−1 λ + pn = 0, which is analogous to the (quadratic) characteristic equation for second-order ODE of this type. Solving this equation yields n roots λ1 , λ2 , . . . , λn , which can then be used to obtain the general solution y(t) = c1 y1 (t) + c2 y2 (t) + · · · + cn yn (t). The functions y1 , y2 , . . . , yn can be obtained as follows: • If a root λi is distinct from all other roots, then yi (t) = eλi t . • If a root λi is repeated k times, then yi (t) = eλi t , yi+1 (t) = teλi t , yi+2 (t) = t2 eλi t , ... yi+k−1 (t) = tk−1 eλi t . • If two roots λi = α + iβ, λi+1 = α − iβ are complex conjugates of one another, then yi (t) = eαt cos βt, yi+1 (t) = eαt sin βt. • If a pair of complex roots λi = α + iβ, λi+1 = α − iβ is repeated k times, then yi (t) = eαt cos βt, yi+1 (t) = eαt sin βt, yi+2 (t) = teαt cos βt, yi+3 (t) = teαt sin βt, yi+4 (t) = t2 eαt cos βt, yi+5 (t) = t2 eαt sin βt, and so on, up to yi+2k−2 (t) = tk−1 eαt cos βt, yi+2k−1 (t) = tk−1 eαt sin βt. It can be seen that the general solution is obtained in a very similar manner as in the second-order case. Then, the constants c1 , c2 , . . . , cn are obtained using the initial conditions. Example The characteristic equation of the ODE y 000 − 2y 00 − y 0 + 2y = 0 is λ3 − 2λ2 − λ + 2 = 0. Using factoring by grouping, we obtain λ2 (λ − 2) − (λ − 2) = (λ2 − 1)(λ − 2) = (λ + 1)(λ − 1)(λ − 2) = 0, and therefore the roots are λ1 = −1, λ2 = 1, and λ3 = 2. Therefore the general solution of the ODE is y(t) = c1 e−t + c2 et + c3 e2t where c1 , c2 , and c3 are constants. 2 3 Example The characteristic equation of the ODE y 0000 − y = 0 is λ4 − 1 = 0, which factors into (λ2 − 1)(λ2 + 1) = (λ + 1)(λ − 1)(λ + i)(λ − i) = 0. Therefore, the roots are λ1 = −1, λ2 = 1, λ3 = −i and λ4 = i. Therefore, the general solution of the ODE is y(t) = c1 e−t + c2 et + c3 cos t + c4 sin t where c1 , c2 , c3 and c4 are constants. 2 The Method of Undetermined Coefficients The method of undetermined coefficients, previously introduced as a method for solving certain inhomogeneous second-order linear equations with constant coefficients, can also be applied to higher-order equations of the same form. In fact, the method is exactly the same, so there is no need to generalize its description. Example We seek a particular solution of the ODE y 000 − 3y 00 + 3y 0 − y = (t2 + 1)et . The characteristic equation is λ3 − 3λ2 + 3λ − 1 = (λ − 1)3 = 0. Therefore, the characteristic equation has a triple root of λ1,2,3 = 1. Since g(t) = (t2 + 1)et is of the form Pn (t)eat , where n = 2, P2 (t) = t2 + 1, and a = 1, the particular solution is of the form yp (t) = ts (A0 + A1 t + · · · + An tn )eat = t3 (A0 + A1 t + A2 t2 )et , where A0 , A1 , A2 are undetermined coefficients and s = 3 because 1 occurs 3 times as a root of the characteristic equation. 2 Variation of Parameters The method of variation of parameters can be generalized to higher-order equations. We assume that the equation y (n) + p1 (t)y (n−1) + p2 (t)y (n−2) + · · · + pn−1 (t)y 0 + pn (t)y = g(t), where g(t) 6= 0, has a particular solution of the form yp (t) = y1 (t)w1 (t) + y2 (t)w2 (t) + · · · + yn (t)wn (t), where y1 , y2 , . . . , yn are solutions of the corresponding homogeneous equation. If we define the new variables u1 = y, u2 = y 0 , u3 = y 00 , . . . un = y (n−1) , 4 then express the nth-order ODE as a system of n first order equations u01 = u2 u02 = u3 .. . u0n = −p1 un − p2 un−1 − · · · − pn−1 u2 − pn u1 + g, or, in matrix-vector form, u0 (t) = A(t)u(t) + b(t), where u(t) = u1 (t) u2 (t) .. . 0 A= , un (t) 1 0 .. . 0 y2 (t) y20 (t) ··· ··· .. . ··· 0 1 .. . .. 0 .. . . 0 0 0 1 −pn −pn−1 · · · −p2 −p1 , b(t) = 0 .. . 0 g(t) . If we define Y (t) = y1 (t) y10 (t) .. . (n−1) y1 (n−1) (t) y2 yn (t) yn0 (t) (n−1) (t) · · · yn , (t) w1 (t) w(t) = w2 (t) , .. .w (t) n and then let u(t) = Y (t)w(t), then we obtain Y 0 (t)w(t) + Y (t)w0 (t) = AY (t)w(t) + b(t), but Y 0 (t) = AY (t), which yields the system of equations Y (t)w0 (t) = b(t). Writing out each of the equations in this system, we obtain y1 (t)w10 (t) + y2 (t)w20 (t) + · · · + yn (t)wn0 (t) = 0, y10 (t)w10 (t) + y20 (t)w20 (t) + · · · + yn0 (t)wn0 (t) = 0, .. . (n−2) (t)w10 (t) + y2 (n−1) (t)w10 (t) + y2 y1 y1 (n−2) (t)w20 (t) + · · · + yn(n−2) (t)wn0 (t) = 0, (n−1) (t)w20 (t) + · · · + yn(n−1) (t)wn0 (t) = g(t). To solve this system of equations, we can use a formula known as Cramer’s Rule. It states that the solution x of the system of n linear equations Ax = b is given by xj = det Aj , det A j = 1, . . . , n, 5 where Aj is the matrix obtained by replacing the jth column of A with b. Using this rule, we obtain Z det Yj (t) wj (t) = g(t) dt, W (y1 , y2 , . . . , yn (t) where Yj (t) is the matrix obtained from Y (t) by replacing the jth column of Y (t) with a column that has all zero entries, except that the nth entry is a 1. Example We seek a general solution of the inhomogeneous third-order linear equation y 000 − 2y 00 + y 0 = 1. The characteristic equation is λ3 − 2λ2 + λ = 0, which factors into λ(λ2 − 2λ + 1) = λ(λ − 1)2 = 0. Therefore, the roots are λ1 = 0, λ2 = λ3 = 1, which yields the general solution of the homogeneous equation yh (t) = c1 y1 (t) + c2 y2 (t) + c3 y3 (t) = c1 + c2 et + c3 tet . To use variation of parameters, we first comptue the Wronskian y1 (t) y2 (t) y3 (t) W (y1 , y2 , y3 )(t) = det y10 (t) y20 (t) y30 (t) y100 (t) y200 (t) y300 (t) 1 et tet = det 0 et tet + et 0 et tet + 2et = 1[et (tet + 2et ) − (tet + et )et ] = te2t + 2e2t − te2t − e2t = e2t , as well as the determinants 0 y2 (t) y3 (t) det Y1 (t) = det 0 y20 (t) y30 (t) 1 y200 (t) y300 (t) 0 et tet = det 0 et tet + et 1 et tet + 2et = et (tet + et ) − tet et = e2t , y1 (t) 0 y3 (t) det Y2 (t) = det y10 (t) 0 y30 (t) y100 (t) 1 y300 (t) 1 0 tet = det 0 0 tet + et 0 1 tet + 2et 6 = −tet − et , y1 (t) det Y3 (t) = det y10 (t) y100 (t) 1 et = det 0 et 0 et y2 (t) 0 y20 (t) 0 y200 (t) 1 0 0 1 = et . Then, a particular solution is of the form yp (t) = y1 (t)w1 (t) + y2 (t)w2 (t) + y3 (t)w3 (t) where y2 (t)y30 (t) − y3 (t)y20 (t) g(t) dt W (y1 , y2 , y3 )(t) Z t t e (te + et ) − tet et = (1) dt e2t Z = 1 dt = t, Z y3 (t)y10 (t) − y1 (t)y30 (t) w2 (t) = g(t) dt W (y1 , y2 , y3 )(t) Z tet (0) − (1)(tet + et ) = (1) dt e2t Z = − e−t (t + 1) dt Z w1 (t) = = 2e−t + te−t , Z y1 (t)y20 (t) − y2 (t)y10 (t) w3 (t) = g(t) dt W (y1 , y2 , y3 )(t) Z 1(et ) − et (0) (1) dt = e2t Z = e−t dt = −e−t . Therefore the particular solution is yp (t) = (1)(t) + (et )(2e−t + te−t ) + (tet )(−e−t ) = t + 2 + t − t = t + 2. The second term, 2, is redundant because it is a solution of the homogeneous equation. We conclude that the general solution is y(t) = yh (t) + yp (t) = c1 + c2 et + c3 tet + t. 2 7 Appendix: Determinants We have previously computed the Wronskian of two functions y1 and y2 , which is y1 (t) y2 (t) W (y1 , y2 )(t) = det = y1 (t)y20 (t) − y2 (t)y10 (t). y10 (t) y20 (t) The above 2 × 2 matrix is invertible at t0 if and only if its determinant, W (y1 , y2 )(t0 ) is nonzero, which allows any initial conditions at t0 to be satisfied. This generalizes the fact that a 1 × 1 matrix A is invertible if and only if its single entry, a11 = a, is nonzero. We now discuss the generalization of this determination of invertibility to general square matrices. The determinant of an n × n matrix A, denoted by det(A) or |A|, is defined as follows: • If n = 1, then det(A) = a11 . • If n > 1, then det(A) is recursively defined by det(A) = n X aij (−1)i+j det(Mij ), 1 ≤ i ≤ n, j=1 where Mij , called a minor of A, is the matrix obtained by removing row i and column j of A. This formula shows that the determinant can be computed by multiplying the elements of any row, with the appropriate sign, by the determinants of matrices with one less row and column. • Alternatively, det(A) = n X aij (−1)i+j det(Mij ), 1 ≤ j ≤ n. i=1 That is, expansion along any column can be used to compute the determinant as well. The matrix Aij = (−1)i+j Mij is called a cofactor of A. This definition of the determinant, however, does not lead directly to a practical algorithm for its computation, because it requires O(n!) arithmetic operations, whereas typical algorithms for matrix computations run in polynomial time. However, the computational effort can be reduced by choosing from the multiple formulas for det(A) above. By consistently choosing the row or column with the most zeros, the number of operations can be minimized. However, more practical methods for computing the determinant can be obtained by using its properties: • If any row or column of A has only zero entries, then det(A) = 0. • If any two rows or columns of A are the same, then det(A) = 0. • If à is obtained from A by adding a multiple of a row of A to another row, then det(Ã) = det(A). • If à is obtained from A by interchanging two rows of A, then det(Ã) = − det(A). • If à is obtained from A by scaling a row by a scalar λ, then det(Ã) = λ det(A). • If B is an n × n matrix, then det(AB) = det(A) det(B). 8 • det(AT ) = det(A) • If A is nonsingular, then det(A−1 ) = (det(A))−1 • If A is a triangular matrix (either upper or lower), then det(A) = Qn i=1 aii . The best-known application of the determinant is the fact that it indicates whether a matrix A is nonsingular, or invertible. The following statements are all equivalent. • det(A) 6= 0. • A is nonsingular. • A−1 exists. • The system Ax = b has a unique solution for any n-vector b. • The system Ax = 0 has only the trivial solution x = 0. The determinant has other interesting applications. The determinant of a 3 × 3 matrix is equal to the volume of a parallelepiped defined by the vectors that are the rows (or columns) of the matrix. This is a special case of the fact that the determinant of an n × n matrix is equal to the product of its eigenvalues. Example We can compute the determinant of 1 −2 3 A = 0 4 −5 0 6 −7 by expanding along the first row, which yields 4 −5 0 −5 0 4 − (−2) det A = 1 0 −7 + 3 0 6 6 −7 = 1[4(−7) − (−5)(6)] + 2[0(−7) − (−5)(0)] + 3[0(6) − 4(0)] = 2. Alternatively, we can expand along the first column, since det(A) = det(AT ), and easily obtain det(A) by multiplying 1 by the determinant of the 2 × 2 matrix obtained by deleting the first row and column, since the rest of the entries in the first column are zero: 4 −5 = [4(−7) − (−5)(6)] = 2. det A = 1 6 −7 2 Example Because the matrices L= 1 0 0 2 4 0 , −3 −5 −6 1 −1 0 5 0 2 3 −6 U = 0 0 −4 7 0 0 0 8 are lower and upper triangular, respectively, their determinants are the products of their diagonal entries. That is, det(L) = 1(4)(−6) = −24, det(U ) = 1(2)(−4)(8) = −64. 2 9 Appendix: Derivation of Cramer’s Rule Cramer’s Rule can be derived using the following properties of determinants: • If a column of A is scaled by a constant factor c, then its determinant is multiplied by c. • If a column of a matrix A is replaced by the sum of itself and a linear combination of other columns, then the determinant of A is unchanged. Suppose that the matrix Aj is obtained by replacing the jth column of A with a vector b, and that the vector x is the solution of the system of linear equations Ax = b. If we write A = a1 a2 · · · an , where aj is the jth column of a, then b = Ax = x1 a1 + x2 a2 + · · · + xn an . Now, suppose we scale the jth column of A, aj , by xj , to obtain a new matrix Ãj . It follows from the first property listed above that det Ãj = xj det A. Then, if we modify Ãj by adding xi ai to the jth column, for each i = 1, 2, . . . , n, i 6= j, to obtain a new matrix Aj , then by the second property listed above, det Aj = det Ãj . It follows that xj = det Aj , det A j = 1, 2, . . . , n. Cramer’s Rule is not the most efficient method of solving a system of equations, but it is useful for systems whose matrices are of small dimension or have functions as entries. 10