1 00:00:00,250 --> 00:00:01,290 GILBERT STRANG: OK? 2 00:00:01,290 --> 00:00:04,710 I want to talk about a slightly different way 3 00:00:04,710 --> 00:00:09,560 to solve a linear first-order equation. 4 00:00:09,560 --> 00:00:13,020 And if you look at the equation-- I'll do an example. 5 00:00:13,020 --> 00:00:13,850 That's the best. 6 00:00:13,850 --> 00:00:19,380 Do you notice what's different from our favorite equation? 7 00:00:19,380 --> 00:00:21,790 The change is 2t. 8 00:00:21,790 --> 00:00:26,960 The interest rate a is increasing with time, 9 00:00:26,960 --> 00:00:28,590 changing with time. 10 00:00:28,590 --> 00:00:32,659 So we still have a linear equation, still just y. 11 00:00:32,659 --> 00:00:36,350 But the coefficient is varying. 12 00:00:36,350 --> 00:00:39,860 We have a variable coefficient 2t. 13 00:00:39,860 --> 00:00:46,240 And if we think here of applications to economy, 14 00:00:46,240 --> 00:00:50,965 to banks, that would be rampant inflation, 15 00:00:50,965 --> 00:00:55,440 the interest rate 2t climbing and climbing forever. 16 00:00:55,440 --> 00:01:00,150 But we want to see that this is a class of equations 17 00:01:00,150 --> 00:01:02,070 that we can solve. 18 00:01:02,070 --> 00:01:02,850 OK. 19 00:01:02,850 --> 00:01:08,820 And the new method is called an integrating factor. 20 00:01:08,820 --> 00:01:14,370 It's a magic factor that makes the equation simple. 21 00:01:14,370 --> 00:01:17,790 So that's another nice way to solve 22 00:01:17,790 --> 00:01:21,340 all the problems that we've dealt with so far, 23 00:01:21,340 --> 00:01:23,050 plus this new one. 24 00:01:23,050 --> 00:01:24,930 So what is this factor? 25 00:01:24,930 --> 00:01:32,080 Well, for this 2t problem, the right factor 26 00:01:32,080 --> 00:01:36,070 is e to the minus t squared. 27 00:01:36,070 --> 00:01:38,790 And why is that the right factor? 28 00:01:38,790 --> 00:01:40,370 This is the factor that I'm going 29 00:01:40,370 --> 00:01:44,190 to multiply the equation by and make it simple. 30 00:01:44,190 --> 00:01:46,590 And the reason that's the right choice 31 00:01:46,590 --> 00:01:51,180 is that the derivative of this-- you 32 00:01:51,180 --> 00:01:53,720 remember how to take the derivative by the chain rule? 33 00:01:53,720 --> 00:01:56,660 The derivative will be the same e to the minus t 34 00:01:56,660 --> 00:02:03,940 squared, the same I, times the derivative of the exponent. 35 00:02:03,940 --> 00:02:08,690 And the derivative of that exponent is minus 2t. 36 00:02:08,690 --> 00:02:11,570 Minus t squared becomes minus 2t. 37 00:02:11,570 --> 00:02:19,330 So it's that little device that gives us an integrating factor 38 00:02:19,330 --> 00:02:21,450 that makes the equation simple. 39 00:02:21,450 --> 00:02:24,350 And now I'm going to look at the equation. 40 00:02:24,350 --> 00:02:28,440 What I want to look at is the derivative of I times y. 41 00:02:28,440 --> 00:02:31,160 Instead of just dy dt, let me look 42 00:02:31,160 --> 00:02:33,210 at the derivative of I times y. 43 00:02:33,210 --> 00:02:35,770 So I have a product here. 44 00:02:35,770 --> 00:02:38,170 Got to use the product rule. 45 00:02:38,170 --> 00:02:43,350 So that will be I-- so I dy dt. 46 00:02:49,350 --> 00:02:50,420 OK. 47 00:02:50,420 --> 00:02:57,580 dy dt is-- we can take dy dt from the equation, I 48 00:02:57,580 --> 00:03:04,865 times 2ty plus q of t. 49 00:03:11,390 --> 00:03:17,810 And now I have to add on dI dt y. 50 00:03:22,310 --> 00:03:24,310 Good. 51 00:03:24,310 --> 00:03:27,950 So it's the product rule-- I times the derivative of y 52 00:03:27,950 --> 00:03:30,490 plus the derivative of I times y. 53 00:03:30,490 --> 00:03:32,180 But now look. 54 00:03:32,180 --> 00:03:36,166 dI dt we know is minus 2tI. 55 00:03:36,166 --> 00:03:41,190 So that dI dt, now I'm using the key fact about I, 56 00:03:41,190 --> 00:03:43,015 that that's minus 2tIy. 57 00:03:46,200 --> 00:03:52,570 Look, minus 2tIy cancels 2tIy. 58 00:03:52,570 --> 00:03:55,060 So I have a nice equation now. 59 00:03:55,060 --> 00:04:00,940 The derivative of Iy is Iq. 60 00:04:00,940 --> 00:04:03,470 The derivative of Iy is Iq. 61 00:04:03,470 --> 00:04:07,110 I can just integrate both sides. 62 00:04:07,110 --> 00:04:08,540 And that's the key. 63 00:04:08,540 --> 00:04:09,730 That's the key. 64 00:04:09,730 --> 00:04:13,880 If I integrate the left-hand side-- 65 00:04:13,880 --> 00:04:18,050 so I'll just move this up-- integrate 66 00:04:18,050 --> 00:04:20,610 the derivative-- of course, the integral of the derivative 67 00:04:20,610 --> 00:04:31,110 is the function-- at time t, Iy at time t minus Iy at time 0, 68 00:04:31,110 --> 00:04:32,530 y of 0. 69 00:04:32,530 --> 00:04:36,780 Because notice that I at t equals 0-- can 70 00:04:36,780 --> 00:04:42,004 I just mention that-- I at 0 is 1. 71 00:04:42,004 --> 00:04:47,900 When t is 0, I of e to the 0 power, which is 1. 72 00:04:47,900 --> 00:04:50,110 So that I of 0 is 1. 73 00:04:50,110 --> 00:04:52,490 So that's the integral of the derivative. 74 00:04:52,490 --> 00:04:56,130 And on the right-hand side, I have the integral from 0 75 00:04:56,130 --> 00:05:02,470 to t of I times q. 76 00:05:02,470 --> 00:05:12,790 So I'll put in-- yeah, e to the minus s squared q of s ds. 77 00:05:12,790 --> 00:05:16,870 I've introduced a variable of integration 78 00:05:16,870 --> 00:05:21,240 s going from 0 to t. 79 00:05:21,240 --> 00:05:24,550 You remember this type of formula? 80 00:05:24,550 --> 00:05:29,000 The input is continuous over time, 81 00:05:29,000 --> 00:05:33,200 and I'm looking at the resulting output at time t. 82 00:05:33,200 --> 00:05:35,280 So all the inputs go in. 83 00:05:35,280 --> 00:05:38,540 They're all multiplied by some factor 84 00:05:38,540 --> 00:05:44,500 and integrated gives the total result from those inputs. 85 00:05:44,500 --> 00:05:46,290 OK. 86 00:05:46,290 --> 00:05:47,770 I'm almost here. 87 00:05:47,770 --> 00:05:53,950 I just want to remember I want to divide by I of t 88 00:05:53,950 --> 00:05:55,915 so I have a formula for y. 89 00:05:55,915 --> 00:05:56,415 OK. 90 00:05:56,415 --> 00:05:59,640 So my formula for y. 91 00:05:59,640 --> 00:06:04,960 When I divide by I of t-- don't forget what I of t is. 92 00:06:04,960 --> 00:06:06,850 Let me put it again here. 93 00:06:06,850 --> 00:06:08,190 Let me remind myself. 94 00:06:08,190 --> 00:06:12,400 I of t is e to the minus t squared. 95 00:06:12,400 --> 00:06:15,470 That was the magic integrating factor. 96 00:06:15,470 --> 00:06:15,970 OK. 97 00:06:15,970 --> 00:06:18,370 So I'm going to divide by that, which 98 00:06:18,370 --> 00:06:22,210 means I'll multiply by e to the t squared. 99 00:06:22,210 --> 00:06:26,140 So that will knock out the I here. 100 00:06:26,140 --> 00:06:30,500 I'll put this on the other side of the equation, y of 0, 101 00:06:30,500 --> 00:06:33,130 y of 0, and it will be multiplied by the e 102 00:06:33,130 --> 00:06:34,520 to the t squared. 103 00:06:34,520 --> 00:06:37,900 And this thing will be multiplied by e 104 00:06:37,900 --> 00:06:38,700 to the t squared. 105 00:06:38,700 --> 00:06:43,370 The integral from 0 to t of e to the t squared minus 106 00:06:43,370 --> 00:06:48,510 s squared q of s ds. 107 00:06:48,510 --> 00:06:51,254 That's my answer. 108 00:06:51,254 --> 00:06:53,640 Well, let's look at it. 109 00:06:53,640 --> 00:06:56,630 I have y of t. 110 00:06:56,630 --> 00:06:59,260 This is what comes out of y of 0. 111 00:06:59,260 --> 00:07:04,370 You see that the growth factor has changed from our old e 112 00:07:04,370 --> 00:07:09,230 to the at-- that was the growth at constant rate, 113 00:07:09,230 --> 00:07:12,760 interest rate a-- to e to the t squared. 114 00:07:12,760 --> 00:07:18,220 That's our growth from an increasing interest rate. 115 00:07:18,220 --> 00:07:23,270 And over here, I'm seeing the result, the output, 116 00:07:23,270 --> 00:07:29,770 from the input q, from all the inputs between 0 and t. 117 00:07:29,770 --> 00:07:34,510 Each input is multiplied by now that factor 118 00:07:34,510 --> 00:07:38,600 is the growth not from 0 to t. 119 00:07:38,600 --> 00:07:41,000 This is the growth from 0 to t. 120 00:07:41,000 --> 00:07:45,250 This is the growth from s to t, because the input went in 121 00:07:45,250 --> 00:07:49,560 at time s, and it had the shorter time, t minus s, 122 00:07:49,560 --> 00:07:50,750 to grow. 123 00:07:50,750 --> 00:07:53,740 So that's the formula for the answer. 124 00:07:53,740 --> 00:08:00,010 If you give me any particular q of s, I just do the integral, 125 00:08:00,010 --> 00:08:03,210 and I find the solution to the differential equation. 126 00:08:03,210 --> 00:08:07,760 So that integrating factor has made things work. 127 00:08:07,760 --> 00:08:10,930 Maybe I should say what the integrating factor 128 00:08:10,930 --> 00:08:13,800 would be in general. 129 00:08:13,800 --> 00:08:23,350 So let me take a moment to see-- this was an example. 130 00:08:23,350 --> 00:08:27,855 This was an example with a of t equal to 2t. 131 00:08:30,590 --> 00:08:32,915 What's the general integrating factor? 132 00:08:36,870 --> 00:08:39,695 So we always want the integrating factor. 133 00:08:42,740 --> 00:08:46,280 Our construction rule is that it should 134 00:08:46,280 --> 00:08:51,585 give us-- the derivative should be minus a of t times I itself. 135 00:08:54,210 --> 00:08:59,640 That's how we chose the e to the minus t squared. 136 00:08:59,640 --> 00:09:02,390 Then a of t was 2t. 137 00:09:02,390 --> 00:09:04,210 Now I want to give the general rule. 138 00:09:04,210 --> 00:09:07,650 The general rule for the integrating factor 139 00:09:07,650 --> 00:09:12,490 is the solution to that equation. 140 00:09:12,490 --> 00:09:15,540 The solution to that equation is giving us the e 141 00:09:15,540 --> 00:09:18,130 to the t squared in the example. 142 00:09:18,130 --> 00:09:19,620 This was the example. 143 00:09:19,620 --> 00:09:26,110 But now I want a formula just to close off the entire case 144 00:09:26,110 --> 00:09:28,570 of varying interest rate. 145 00:09:28,570 --> 00:09:31,280 I want to find the solution to that equation. 146 00:09:31,280 --> 00:09:34,340 And it is-- so here's the integrating factor. 147 00:09:34,340 --> 00:09:39,590 It's e to the minus because of that minus sign. 148 00:09:39,590 --> 00:09:45,750 Now I'm wanting a to come down when I take a derivative. 149 00:09:45,750 --> 00:09:51,774 So what I'll put up here, the integral of a of t 150 00:09:51,774 --> 00:09:57,050 dt, say, from 0 to t. 151 00:09:57,050 --> 00:10:01,700 Now, let me just do again this example just to see. 152 00:10:01,700 --> 00:10:09,470 I have e to the minus the integral of 2t, 153 00:10:09,470 --> 00:10:12,540 which is e to minus t squared. 154 00:10:16,420 --> 00:10:19,690 That's how I get t squared as the right choice 155 00:10:19,690 --> 00:10:21,060 for our example. 156 00:10:21,060 --> 00:10:24,310 And the general rule is there. 157 00:10:24,310 --> 00:10:27,270 That's the integrating factor. 158 00:10:27,270 --> 00:10:32,680 And finally, finally, if a is a constant, which 159 00:10:32,680 --> 00:10:35,220 is the most common case-- the only case we've 160 00:10:35,220 --> 00:10:39,990 had until this video-- if a is a constant, 161 00:10:39,990 --> 00:10:44,380 then the integral of a from 0 to t is just a times t. 162 00:10:44,380 --> 00:10:48,100 So number one example, number zero example, 163 00:10:48,100 --> 00:10:51,580 would be e to the minus at. 164 00:10:51,580 --> 00:10:55,370 That would be the correct integrating factor 165 00:10:55,370 --> 00:10:57,987 if we had constant a. 166 00:10:57,987 --> 00:11:03,300 And I'll create some examples, some problems, 167 00:11:03,300 --> 00:11:07,030 just to go through the steps in that best 168 00:11:07,030 --> 00:11:10,030 case of all with constant integrating factor. 169 00:11:10,030 --> 00:11:15,780 But now we can solve it with a varying interest rate. 170 00:11:15,780 --> 00:11:16,570 Good. 171 00:11:16,570 --> 00:11:18,390 Thank you.