Diagonalization of Matrices Dr. E. Jacobs One of the very interesting lessons in this course is how certain algebraic techniques can be use to solve ifferential equations. The purpose of these notes is to escribe how the solution of the matrix equation a b u c u λ u u will apply to the solution of the ifferential equa- tion a y y + a + a 0y 0. As we will see later, the ifferential equation can be rewritten in a matrix form an then the eigenvectors an eigenvalues of the matrix then lea to a solution. Review of Eigenvectors an Eigenvalues Let A a b c an u u u. A number λ is sai to be an eigenvalue of A if there is a nonzero vector u so that A u λ u. The vector u is sai to be an eigenvector of A. Please note that the equation A λi u 0, where I 0 0 an 0 0 0, is completely equivalent to the equation A u λ u. This is important because if we seek a nonzero solution u of A λi u 0 then the matrix A λi ha better not have an inverse. After all, if A λi ha an inverse, then the equation A λi u 0 coul be solve by multiplying both sies by this inverse an we woul obtain u A λi 0 0. This coul not be if u is suppose to be a nonzero solution of the equation. If A λi has no inverse then the eterminant of A λi must be 0, an this is how we fin the eigenvalues. Example: Fin the eigenvalues an eigenvectors of A 4 The eterminant of A λi is λ 4 λ λ 5λ + 6. This is zero only when λ or λ 3, so these are the eigenvalues. To fin the eigenvectors corresponing to λ, we solve A I u 0 A I u u u u u 0 0
If we multiply out an compare coorinates, we get u + u u u u u u u u u 0 so Thus, any nonzero scalar multiple of will be an eigenvector corresponing to eigenvalue λ. Next, we fin the eigenvectors corresponing to λ 3 by solving the matrix equation A 3I u 0 A 3I u u u This implies that u is a solution only if u + u 0 u u u u u u 0 0 Therefore, any nonzero scalar multiple of will be an eigenvector corresponing to eigenvalue λ 3.
Diagonal Matrices A matrix a b is sai to be iagonal if b c 0. c So, for example, the ientity matrix 0 0 is a iagonal matrix. Just about any matrix calculation in easy to o with iagonal matrices. For example, look at the following matrix multiplication, where the matrices are not iagonal: a a b b a b + a b a b + a b a a b b a b + a b a b + a b Compare this to the simplicity of multiplying two iagonal matrices: a 0 b 0 a b 0 0 a 0 b 0 a b Fining the inverse of a matrix is also simpler if the matrix is iagonal. If a b has an inverse, then it is given by: c a b c a bc c a bc b a bc a a bc Notice how much simpler this formula is if the matrix is iagonal: a 0 a 0 0 0 Diagonalization of Matrices 4 In many cases, we can take matrices that are not iagonal an put them in terms of a iagonal matrix through a simple matrix multiplication formula. As a simple emonstration, take the matrix A whose eigenvectors an have alreay been calculate. We begin by constructing a matrix P from these eigenvectors. Now, look what happens when we calculate the matrix prouct P AP. P AP 4 0 3 6 0 3 We have just obtaine a iagonal matrix. This formula applies to a more general matrix a b. c
Suppose the eigenvalues of A u p p an u p p a b c are λ an λ with eigenvectors respectively. This means that: A u λ u A u λ u a a p λ p a a p λ p a a p λ p a a p λ p Now, let s combine these results. Let P p p p p a a AP p p λ p λ p a a p p λ p λ p Compare this to the prouct PΛ where Λ λ 0 0 λ p p PΛ λ 0 λ p λ p p p 0 λ λ p λ p We see that AP PΛ. This means that P AP Λ an therefore P AP is a iagonal matrix. Of course, this assumes that the matrix P has an inverse. It is easy to prove that as long as λ λ, then the columns of P are linearly inepenent an P will have an inverse. Example: Let A. Fin a matrix P so that P AP is iagonal. 0 8 6 We begin by solving 0 eta λi λ 6λ + 8 to get the eigenvalues. λ λ 4 The corresponing eigenvectors are: 4 an therefore, the require matrix P is 4
Let s check this answer: P AP 0 8 6 4 4 4 0 0 4 4 The result is a iagonal matrix. Notice that the entries along the iagonal are exactly the eigenvalues of A. Application to Systems of Linear Differential Equations Problems involving interconnecting spring systems, tank systems an electric circuits involve several unknown functions solving a system of ifferential equations. Let s consier, for example the problem of fining two functions x x t an x x t that solve the following system of ifferential equations: x t a x t + a x t x t a x t + a x t Let s put this in matrix notation. Let x a a x x so x x x an let A a a. The system of ifferential equations can now be written as x A x. The trick to solving this equation is to perform a change of variable that transforms this ifferential equation into one involving only a iagonal matrix. Using the eigenvector proceure, we can fin a matrix P so that P AP λ 0 0 λ. We can efine a vector-value function v v t v by the formula t v P x. Make the substitution x P v into the ifferential equation x A x.
x A x P v A x AP v P v AP v v P AP v Since P AP is a iagonal matrix, the matrix ifferential equation is now: v v λ 0 v λ v 0 λ v λ v If we now compare coorinates, we get two simple ifferential equations: v λ v v λ v These equations can be solve easily using separation of variables. v t c e λ t v t c e λ t where c an c are constants. Now that we have the coorinates of v, we can obtain the coorinates of x from the equation x P v. Example: Solve the following system of ifferential equations: x t x t + x t x t x t + 4x t In matrix form this equation is x A x where A 4. For this matrix, we have alreay foun P so if we make the substitution
x P v into the equation x A x, we will get v 0 0 3 v whose solution is v c e t c e. The solution we seek is: 3t x P v Comparing coorinates, we get: c e t c e c e 3t t + c e 3t c e t + c e 3t x t c e t + c e 3t an x t c e t + c e 3t There is also a useful vector format for the answer if we split up the vector solution as follows: c e x t + c e 3t c e c e t + c e 3t t c e c e t + 3t c e 3t c e t + c e 3t Notice that the general solution is a linear combination of terms of the form ue rt where r is an eigenvalue an u is the corresponing eigenvector. This observation can spee up the solution process.
Example: An animal is receiving meication from an external rug recycling system at an animal hospital. There are 3 liters of bloo in this animal. Flui is being elivere into the animal intravenously. The flui, containing both bloo an the rug, is entering the animal at the rate of 8 liters/hour. A saline solution, containing no rug at all, is entering the animal at the rate of 4 liters/hour. Bloo is being rawn from the animal an sent back to the external system at the rate of 3 8 liters/hour. Flui is also being rawn out of the external system an into a waste receptacle at the rate of 4 liters/hour. The external system has liters of flui altogether an this volume stays constant. Let xt be the number of milligrams of rug in the animal after t hours. Let yt be the number of milligrams of rug in the external system after t hours. Assume an initial conition of x0 0 an y0 0 milligrams of rug. Fin the formulas for xt an yt by solving the appropriate system of ifferential equations. x y More concisely: Rate Rate In Out 8 Rate Rate 3 In Out 8 liter hour y liter hour x 3 x 8 x + 6 y mg liter 3 8 mg liter 3 8 liter hour x 3 liter hour y mg liter mg liter y 8 x 3 6 y
Or, in matrix form: x y /8 /6 /8 3/6 x y If x x y an A /8 /6. We can now solve x /8 3/6 A x. We begin with the eigenvalues by solving: 0 eta λi /8 λ /6 /8 3/6 λ λ + 5 6 λ + 64 After factoring: 0 λ + λ + 4 6 So, the eigenvalues are: λ 4 The corresponing eigenvectors are: u λ 6 u If we procee just as we i in the last example, we en up with the general solution: x c e t/4 + c e t/6 We have an initial conition x0 0 0 which implies that c 70 an c 70 so Equating coorinates: xt 70 yt e t/4 + 70 e t/6 xt 70 e t/4 + e t/6 yt 70 e t/4 + e t/6
Example: Solve the equation x A x where A an x are efine as: A 0 0 0 0 x x t x t x 3 t We begin with the eigenvalues of A which we get by solving eta λi 0. λ 0 0 λ λ 0 Fortunately, this factors nicely Therefore the eigenvalues are: λ 3 + λ + λ 0 λ λ + λ 0 λ λ λ an, if you calculate the corresponing eigenvectors, you will get: u u u 4 If the format from the previous example also applies to this three imensional case, we woul expect the general solution to be a linear combination of all solutions of the form ue rt which woul give us: x c e t + c e t + c 3 4 e t Will this really be true? Again, the iagonalization metho comes to the rescue. We form the matrix P with the eigenvectors making up the columns. P 4
Now, we can calculate P AP an verify that it is iagonal. / / P AP /3 / /6 0 0 0 0 /3 0 /3 4 0 0 0 0 0 0 If we now efine v P x as before, the equation x A x transforms to the equation v Λ v where Λ is a iagonal matrix. v v 0 0 0 0 v v v v v 3 0 0 v 3 v 3 Equate coorinates: v v v v v 3 v 3 v c e t v c e t v 3 c 3 e t
x P v c e t c e t 4 c 3 e t c e t + c e t + c 3 e t c e t c e t + c 3 e t c e t + c e t + 4c 3 e 4t c e t + c e t + c 3 e t 4 This verifies the solution we ha assume at the outset. The Repeate Root Case Our solution of x A x epene on being able to fin a matrix an invertible matrix P so that P AP is a iagonal matrix. This cannot always be one. Consier, for example, x A x when x x t x an A t 0. The first step is to fin the eigenvalues by solving eta λi 0 λ 0 λ 0 λ λ 0 This time, we only get one istinct eigenvalue, λ. This is an example of the repeate root case. The eigenvectors consist of all nonzero scalar multiples of 0, so P? 0?. We on t have another eigenvector to put in the secon column of P. If we take some scalar multiple of 0 to be the secon column, then P c 0 0 will not have an inverse an we still can t calculate P AP. Fortunately, we can still solve x 0 x a ifferent way, so we can see what the solution looks like. x x x + x 0 x x x
Comparing coorinates: x x + x x x The solution of x x is x t be t, where b is a constant. If we substitute this into x x + x, we get the equation x x + be t which can be solve using an integrating factor. The solution of x x + be t is x t ae t + bte t where a is another constant. Put these coorinates into the vector x ae x t + bte t be t a e t t + b e t 0 The vector 0 e t is of the form ue rt, where u is an eigenvector, but the vector t e t oes not have this form. Nonhomogeneous Equations If P AP is iagonal then the equation x A x is easily solve. The equation x A x is referre to as a homogeneous ifferential equation. We can also solve equations of the form x A x + f a nonhomogeneous ifferential equation. Let s use A iscovere that if P 4 then P AP 0 0 3 because we have alreay. Let f e t. As usual, we make the substitution x P v into the equation x A x + f P v AP v + f P v AP v + f v P AP v + P f v 0 v e t v + e + t 0 3 v 0 3v e t v 0
Comparing coorinates, we get: v v + e t v 3v e t Solve each of these using integrating factors. v c e t + te t v c e 3t + e t Now we can substitute into P v an get the solution x c e x t + te t c e 3t + e t If we multiply out an regroup we can write the solution in the form: x c e t + c e 3t t + + e t t + Solution of Secon Orer Linear Differential Equations The matrix ifferential equations we have solve can be applie to equations of the form a y y + a + a 0y 0. Since we can always ivie both sies by a, we might as well assume that a, so the equation becomes y + a y + a 0 y 0. This equation can always be converte to a matrix form. Let x y an x y. If x x then the erivative of x is: x x y y y x a 0 y a y a 0 x a x 0 x a x We have just converte the scalar ifferential equation y + a y + a 0 y 0 to a matrix equation x A x. The first coorinate of x will be the solution of y + a y + a 0 y 0. Example: Fin the general solution y yt of y 6y + 8y 0 If we let x y y then x 0 8 6 x. We have alreay iscovere that the eigenvalues of this matrix are λ an λ 4 an the corresponing eigenvectors are. Therefore, the solution of x A x is: x c an 4 e t + c 4 x e 4t a 0 c e t + c e 4t c e t + 4c e 4t x
The solution y yt is the first coorinate of this vector so: y c e t + c e 4t Notice that each term is a constant times e rt where r is an eigenvalue. Example: Fin the general solution of y y y + y 0. This is a thir orer ifferential equation, but we can exten our matrix techniques so we can solve this too. Let x y, x y an x 3 y be the coorinates of a vector x. Take the erivative of x. x x x x 3 x x 3 y x x 3 y + y + y We can write this as a matrix multiplication. x 0 0 0 0 x x x 3 We have solve x solution is: x c e t + c e t + c 3 x x 3 x + x + x 3 A x for this particular matrix alreay. The general 4 e t Now, we can extract the first coorinate of this solution to get yt y c e t + c e t + c 3 e t