1 00:00:00,500 --> 00:00:01,330 GILBERT STRANG: OK. 2 00:00:01,330 --> 00:00:05,760 We're still solving systems of differential equations 3 00:00:05,760 --> 00:00:08,500 with a matrix A in them. 4 00:00:08,500 --> 00:00:12,620 And now I want to create the exponential. 5 00:00:12,620 --> 00:00:18,420 It's just natural to produce e to the A, or e to the A t. 6 00:00:18,420 --> 00:00:20,920 The exponential of a matrix. 7 00:00:20,920 --> 00:00:27,450 So if we have one equation, small a, 8 00:00:27,450 --> 00:00:31,636 then we know the solution is an e to the A t, 9 00:00:31,636 --> 00:00:34,220 times the starting value. 10 00:00:34,220 --> 00:00:41,250 Now we have n equations with a matrix A and a vector y. 11 00:00:41,250 --> 00:00:48,025 And the solution should be, at time t, e to the A t, 12 00:00:48,025 --> 00:00:49,750 times the starting value. 13 00:00:49,750 --> 00:00:54,200 It should be a perfect match with this one, where 14 00:00:54,200 --> 00:00:56,710 this had a number in the exponent 15 00:00:56,710 --> 00:00:59,120 and this has a matrix in the exponent. 16 00:00:59,120 --> 00:01:00,440 OK. 17 00:01:00,440 --> 00:01:01,620 No problem. 18 00:01:01,620 --> 00:01:06,090 We just use the series for e to the A t. 19 00:01:06,090 --> 00:01:09,770 We plug in a matrix instead of a number. 20 00:01:09,770 --> 00:01:18,280 So the identity, plus A t, plus 1/2 A t squared, 21 00:01:18,280 --> 00:01:23,450 plus 1/6 of A t cubed, forever. 22 00:01:23,450 --> 00:01:24,130 It's the same. 23 00:01:24,130 --> 00:01:25,840 It's the exponential series. 24 00:01:25,840 --> 00:01:29,480 The most important series in mathematics, I think. 25 00:01:29,480 --> 00:01:32,590 And it gives us an answer. 26 00:01:32,590 --> 00:01:34,870 And that answer is a matrix. 27 00:01:34,870 --> 00:01:38,060 Everything here, every term, is a matrix. 28 00:01:38,060 --> 00:01:38,860 OK. 29 00:01:38,860 --> 00:01:41,220 Now, is that the right answer? 30 00:01:41,220 --> 00:01:45,570 We check that by putting it into the differential equation. 31 00:01:45,570 --> 00:01:49,590 So I want to put that solution into the equation. 32 00:01:49,590 --> 00:01:51,900 So I need to take the derivative. 33 00:01:51,900 --> 00:01:54,360 The derivative of this is the derivative 34 00:01:54,360 --> 00:01:56,050 of-- that's a constant. 35 00:01:56,050 --> 00:02:02,170 The derivative of that is A. The derivative of this is 1/2. 36 00:02:02,170 --> 00:02:06,520 I have an A squared, and I have a t squared. 37 00:02:06,520 --> 00:02:11,250 The derivative of t squared is 2t, so that'll just be a t. 38 00:02:11,250 --> 00:02:13,500 The 2 and the 2 cancel. 39 00:02:13,500 --> 00:02:14,430 OK. 40 00:02:14,430 --> 00:02:19,380 Now I have A cubed here. 41 00:02:19,380 --> 00:02:20,410 t cubed? 42 00:02:20,410 --> 00:02:26,050 The derivative of t cubed is 3t squared, so I have a t squared. 43 00:02:26,050 --> 00:02:29,460 And the 3 cancels the 3 and the 6, 44 00:02:29,460 --> 00:02:35,990 and leaves 1 over 2 factorial, and so on. 45 00:02:35,990 --> 00:02:38,040 And I look at that. 46 00:02:38,040 --> 00:02:41,240 And I say it's very much like the one above. 47 00:02:41,240 --> 00:02:41,970 Look. 48 00:02:41,970 --> 00:02:47,130 This series is just A times this one. 49 00:02:47,130 --> 00:02:52,260 Multiply the top one by A. A times I is A. A times A t 50 00:02:52,260 --> 00:02:53,860 is A squared t. 51 00:02:53,860 --> 00:02:56,990 Term by term, it just has a factor A. 52 00:02:56,990 --> 00:03:02,210 So it's A e to the A t, is the derivative 53 00:03:02,210 --> 00:03:04,930 of my matrix exponential. 54 00:03:04,930 --> 00:03:08,030 It brings down an A. Just what we want. 55 00:03:08,030 --> 00:03:09,970 Just what we want. 56 00:03:09,970 --> 00:03:16,150 So then if I add a y of 0 in here, 57 00:03:16,150 --> 00:03:17,870 that's just a constant vector. 58 00:03:17,870 --> 00:03:19,033 I'll have a y of 0. 59 00:03:19,033 --> 00:03:22,550 I'll have a y of 0 here. 60 00:03:22,550 --> 00:03:25,250 When I put this into the differential equation, 61 00:03:25,250 --> 00:03:26,470 it works. 62 00:03:26,470 --> 00:03:27,760 It works. 63 00:03:27,760 --> 00:03:33,610 Now, is it better than what we had before, which was using 64 00:03:33,610 --> 00:03:36,570 eigenvalues and eigenvectors? 65 00:03:36,570 --> 00:03:39,650 It's better in one way. 66 00:03:39,650 --> 00:03:43,620 This exponential, this series, is totally fine 67 00:03:43,620 --> 00:03:48,910 whether we have n independent eigenvectors or not. 68 00:03:48,910 --> 00:03:50,940 We could have repeated eigenvalues. 69 00:03:50,940 --> 00:03:52,750 I'll do an example. 70 00:03:52,750 --> 00:03:57,420 So for with repeated eigenvalues and missing eigenvectors, 71 00:03:57,420 --> 00:04:00,360 e to the A t is still the correct answer. 72 00:04:00,360 --> 00:04:01,810 Still the correct answer. 73 00:04:01,810 --> 00:04:06,850 But if we want to use eigenvalues and eigenvectors 74 00:04:06,850 --> 00:04:10,230 to compute e to the A t, because we 75 00:04:10,230 --> 00:04:15,050 don't want to add up an infinite series very often, 76 00:04:15,050 --> 00:04:17,990 then we would want n independent eigenvectors. 77 00:04:17,990 --> 00:04:19,374 So what am I saying? 78 00:04:19,374 --> 00:04:23,100 I'm saying that this e to the A t-- All right, 79 00:04:23,100 --> 00:04:27,796 suppose we have n independent eigenvectors. 80 00:04:30,870 --> 00:04:33,410 And we know that that means, in that case, 81 00:04:33,410 --> 00:04:39,450 a is V times lambda times V inverse. 82 00:04:39,450 --> 00:04:42,360 And we can write V inverse because the matrix 83 00:04:42,360 --> 00:04:44,710 V has the eigenvectors. 84 00:04:44,710 --> 00:04:47,040 This is the eigenvector matrix. 85 00:04:47,040 --> 00:04:49,930 If I have n independent eigenvectors, 86 00:04:49,930 --> 00:04:51,840 that matrix is invertible. 87 00:04:51,840 --> 00:04:53,570 I have that nice formula. 88 00:04:53,570 --> 00:04:56,575 And now I can see what is-- e to the A 89 00:04:56,575 --> 00:05:03,110 t is always identity plus A. 90 00:05:03,110 --> 00:05:07,630 I'm now going to use the diagonalization, 91 00:05:07,630 --> 00:05:14,350 the eigenvectors, and the eigenvalues for A. 92 00:05:14,350 --> 00:05:16,920 So I'm doing the good case now, when 93 00:05:16,920 --> 00:05:20,970 there are a full set of independent eigenvectors. 94 00:05:20,970 --> 00:05:28,390 Then the A t is V lambda V inverse t. 95 00:05:28,390 --> 00:05:36,190 That's right, that's I, plus A t, plus 1/2 A t squared. 96 00:05:36,190 --> 00:05:37,110 Right? 97 00:05:37,110 --> 00:05:39,190 So I need A squared. 98 00:05:39,190 --> 00:05:44,050 So everybody remembers what A squared is. 99 00:05:44,050 --> 00:05:51,190 A squared is V lambda V inverse, times V lambda V inverse. 100 00:05:51,190 --> 00:06:00,230 And those cancel out to give V lambda squared V inverse, 101 00:06:00,230 --> 00:06:03,300 times t squared, and so on. 102 00:06:08,780 --> 00:06:13,710 You remember this A squared, so I'll take that away. 103 00:06:13,710 --> 00:06:16,980 And look at what I've got. 104 00:06:16,980 --> 00:06:18,120 Look what I've got it. 105 00:06:18,120 --> 00:06:19,080 Yes. 106 00:06:19,080 --> 00:06:23,230 Factor V out of the start, and factor 107 00:06:23,230 --> 00:06:25,990 V inverse out of the end. 108 00:06:25,990 --> 00:06:32,760 And in here I have V times V inverse is I, so that's fine. 109 00:06:32,760 --> 00:06:37,460 V times V inverse, I have a lambda t. 110 00:06:37,460 --> 00:06:44,210 V and a V inverse, so I have a 1/2 half lambda 111 00:06:44,210 --> 00:06:47,470 squared t squared. 112 00:06:47,470 --> 00:06:52,130 And so on, times V inverse. 113 00:06:52,130 --> 00:06:55,120 This is all just what we hope for. 114 00:06:55,120 --> 00:06:59,590 We expect that a V goes out at the far left at the front. 115 00:06:59,590 --> 00:07:02,400 This V inverse comes out at the far right. 116 00:07:02,400 --> 00:07:04,800 And what do you see in the middle? 117 00:07:04,800 --> 00:07:13,010 You see-- so this is now my formula for e to the A t, is V. 118 00:07:13,010 --> 00:07:15,570 And what do I have there? 119 00:07:15,570 --> 00:07:20,270 I have the exponential series for lambda t. 120 00:07:20,270 --> 00:07:26,300 So it's e to the lambda t V inverse. 121 00:07:26,300 --> 00:07:28,420 And what is e to the lambda t? 122 00:07:28,420 --> 00:07:31,460 Let's just understand the matrix exponential. 123 00:07:31,460 --> 00:07:35,070 When the matrix is diagonal, the best possible matrix, 124 00:07:35,070 --> 00:07:39,660 this will be V. What does my matrix look like? 125 00:07:39,660 --> 00:07:41,240 V inverse. 126 00:07:41,240 --> 00:07:44,230 If I'm looking at this, looking at this. 127 00:07:44,230 --> 00:07:45,610 Lambda is diagonal. 128 00:07:45,610 --> 00:07:49,780 All these matrices are diagonal with lambdas. 129 00:07:49,780 --> 00:07:56,025 So that'll be e to the lambda 1t down to e to the lambda nt. 130 00:07:59,320 --> 00:08:02,920 I'm not doing anything brilliant here. 131 00:08:02,920 --> 00:08:10,730 I'm just using the standard diagonalization 132 00:08:10,730 --> 00:08:18,060 to produce our exponential from the eigenvector matrix 133 00:08:18,060 --> 00:08:19,760 and from the eigenvalues. 134 00:08:19,760 --> 00:08:22,600 So I'm just taking the exponentials 135 00:08:22,600 --> 00:08:24,900 of the n different eigenvalues. 136 00:08:24,900 --> 00:08:26,422 So e to the A t. 137 00:08:29,830 --> 00:08:37,409 This would lead to e to the A t y at 0, would be-- y of 0 is 138 00:08:37,409 --> 00:08:38,669 some combination. 139 00:08:38,669 --> 00:08:43,770 And then there's an e to the lambda 1t coming from here. 140 00:08:43,770 --> 00:08:54,110 And there's an x eigenvector x1, plus C2 e to the lambda 2t x2, 141 00:08:54,110 --> 00:08:54,680 so on. 142 00:08:54,680 --> 00:08:57,910 That's the solution that we had last time. 143 00:08:57,910 --> 00:09:02,600 That's the solution that using eigenvalues and eigenvectors. 144 00:09:02,600 --> 00:09:03,100 Now. 145 00:09:03,100 --> 00:09:08,240 Can Can I get something new here? 146 00:09:08,240 --> 00:09:12,120 Something new will be, suppose there are not 147 00:09:12,120 --> 00:09:15,880 a full set of n independent eigenvectors. 148 00:09:15,880 --> 00:09:18,910 e to the A t is still OK. 149 00:09:18,910 --> 00:09:23,130 But this formula is no good. 150 00:09:23,130 --> 00:09:25,720 That formula depends on V and V inverse. 151 00:09:25,720 --> 00:09:28,210 And suppose we have an example. 152 00:09:28,210 --> 00:09:31,230 So all that is very nice. 153 00:09:31,230 --> 00:09:33,480 That's what we expect. 154 00:09:33,480 --> 00:09:38,640 But we could have a matrix like this one. 155 00:09:38,640 --> 00:09:42,215 A equals-- well, here's an extreme case. 156 00:09:46,250 --> 00:09:48,740 What are the eigenvalues of that matrix? 157 00:09:48,740 --> 00:09:50,200 It's a diagonal matrix. 158 00:09:50,200 --> 00:09:53,030 The eigenvalues are 0 and 0. 159 00:09:53,030 --> 00:09:55,890 The eigenvalue of 0 is repeated. 160 00:09:55,890 --> 00:09:57,800 It's a double eigenvalue. 161 00:09:57,800 --> 00:10:00,760 And we hope for two eigenvectors, 162 00:10:00,760 --> 00:10:02,710 but we don't find them. 163 00:10:02,710 --> 00:10:05,510 That has only one line of eigenvectors. 164 00:10:05,510 --> 00:10:10,530 It only has an x1 equals 1, 0, I think. 165 00:10:10,530 --> 00:10:16,480 If I multiply that A, times that x1, gives me 0 times x1. 166 00:10:16,480 --> 00:10:19,440 That's an eigenvector. 167 00:10:19,440 --> 00:10:21,410 Well, because the eigenvalue is 0, 168 00:10:21,410 --> 00:10:24,330 I'm looking for the null space. 169 00:10:24,330 --> 00:10:28,270 There is in the null space, but the null space 170 00:10:28,270 --> 00:10:30,490 is only one-dimensional. 171 00:10:30,490 --> 00:10:32,460 Only one eigenvector. 172 00:10:32,460 --> 00:10:34,090 Missing an eigenvector. 173 00:10:34,090 --> 00:10:39,210 Still, still, I can do e to the A t. 174 00:10:39,210 --> 00:10:41,170 That's still completely correct. 175 00:10:41,170 --> 00:10:42,870 That series will work. 176 00:10:42,870 --> 00:10:45,500 So to do this series I need to know a squared. 177 00:10:48,150 --> 00:10:50,340 So I'm actually going to use the series, 178 00:10:50,340 --> 00:10:53,530 but you'll see that it cuts off very fast. 179 00:10:53,530 --> 00:10:56,770 a squared, if you work that out, it's all 0's. 180 00:10:59,560 --> 00:11:07,755 So our e to the A t is just I, plus A t, plus STOP. 181 00:11:11,700 --> 00:11:13,440 A squared is all 0's. 182 00:11:13,440 --> 00:11:15,240 A cubed is all 0's. 183 00:11:15,240 --> 00:11:22,570 So the matrix e to the A t is identity, a times t. 184 00:11:22,570 --> 00:11:26,285 a is this, times t is going to put a t there. 185 00:11:30,060 --> 00:11:32,000 There you go. 186 00:11:32,000 --> 00:11:35,910 That's a case of the matrix exponential, 187 00:11:35,910 --> 00:11:40,070 which would lead us to the solution of the equations. 188 00:11:40,070 --> 00:11:42,556 Of course, it's a pretty simple exponential. 189 00:11:46,000 --> 00:11:48,660 But it comes from pretty simple equations. 190 00:11:48,660 --> 00:11:52,900 The equations dy dt, that system of two equations, 191 00:11:52,900 --> 00:11:55,840 with that matrix in it. 192 00:11:55,840 --> 00:12:01,690 Our system of equations is just dy1 dt, 193 00:12:01,690 --> 00:12:05,170 I have a 1 there so it would be a y2. 194 00:12:05,170 --> 00:12:13,930 And dy2 dt is 0 on the second row. 195 00:12:13,930 --> 00:12:17,000 Well, that's pretty easy to solve. 196 00:12:17,000 --> 00:12:20,510 In fact, this tells you how to solve-- you could naturally 197 00:12:20,510 --> 00:12:24,460 ask the question, how do we solve differential equations 198 00:12:24,460 --> 00:12:29,810 when the matrix doesn't have n eigenvectors? 199 00:12:29,810 --> 00:12:31,750 Here's an example. 200 00:12:31,750 --> 00:12:34,130 This matrix has only one eigenvector. 201 00:12:34,130 --> 00:12:37,820 But the equation that we just solved by, you could say, 202 00:12:37,820 --> 00:12:39,450 back substitution. 203 00:12:39,450 --> 00:12:42,515 This gives Y2 equal constant. 204 00:12:45,170 --> 00:12:51,330 And then that equation, dy1 dt equal that constant, gives me 205 00:12:51,330 --> 00:12:54,630 y1 equals t times constant. 206 00:13:00,120 --> 00:13:01,191 That's what I'm seeing. 207 00:13:01,191 --> 00:13:01,690 Oh. 208 00:13:01,690 --> 00:13:03,490 Yeah. 209 00:13:03,490 --> 00:13:06,570 Are you surprised to see a t show up here? 210 00:13:06,570 --> 00:13:11,220 Normally I don't see a t in matrix exponentials. 211 00:13:11,220 --> 00:13:14,980 But in this repeated case, that's 212 00:13:14,980 --> 00:13:17,290 the t that we're always seeing when 213 00:13:17,290 --> 00:13:19,150 we have repeated solutions. 214 00:13:19,150 --> 00:13:23,740 Everybody remembers that when we have second-order equations, 215 00:13:23,740 --> 00:13:29,520 and we have the two exponents are the same. 216 00:13:29,520 --> 00:13:33,260 So we only get one solution of that, e to the st. 217 00:13:33,260 --> 00:13:35,090 And we have to look for another one. 218 00:13:35,090 --> 00:13:37,040 And that other one is? 219 00:13:37,040 --> 00:13:40,800 te to the st. It's that same t there. 220 00:13:40,800 --> 00:13:42,470 OK. 221 00:13:42,470 --> 00:13:46,170 There is an example of how a matrix 222 00:13:46,170 --> 00:13:54,840 with a missing eigenvector, the exponential pops a t in. 223 00:13:54,840 --> 00:13:56,840 The exponential pops a t in. 224 00:13:56,840 --> 00:13:59,810 And if I had two missing eigenvectors, 225 00:13:59,810 --> 00:14:01,800 then in the exponential. 226 00:14:01,800 --> 00:14:05,910 Shall I just show you an example with two missing eigenvectors? 227 00:14:05,910 --> 00:14:13,490 Let a be-- well, here it would be 0, 0, 0, 0, 0, 228 00:14:13,490 --> 00:14:16,875 triple 0, with, let's say. 229 00:14:19,860 --> 00:14:25,890 There's a matrix with three 0 eigenvalues, 230 00:14:25,890 --> 00:14:28,010 but only one eigenvector. 231 00:14:28,010 --> 00:14:30,260 So it's missing two eigenvectors. 232 00:14:30,260 --> 00:14:33,260 And I would, in the end, in e to the A t 233 00:14:33,260 --> 00:14:40,300 here, I would see probably 1, 1, 1, t, t, 234 00:14:40,300 --> 00:14:43,120 and probably I'll see a 1/2 t squared there. 235 00:14:46,120 --> 00:14:48,160 A little bit like that. 236 00:14:48,160 --> 00:14:49,950 But one step worse. 237 00:14:49,950 --> 00:14:55,130 Because the triple eigenvalue, well, that's 238 00:14:55,130 --> 00:14:57,720 not going to happen very often in reality. 239 00:14:57,720 --> 00:15:02,530 But we see what it produces. 240 00:15:02,530 --> 00:15:06,606 It produces a t squared as well as the t's. 241 00:15:06,606 --> 00:15:07,452 OK. 242 00:15:07,452 --> 00:15:10,340 So, the x matrix exponential gives 243 00:15:10,340 --> 00:15:15,900 a beautiful, concise, short formula for the solution. 244 00:15:15,900 --> 00:15:21,380 And it gives a formula that's correct, 245 00:15:21,380 --> 00:15:25,690 even in the case of missing eigenvectors. 246 00:15:25,690 --> 00:15:27,430 Thank you.