1 00:00:05,181 --> 00:00:06,780 PROFESSOR: Hi everyone. 2 00:00:06,780 --> 00:00:08,470 Welcome back. 3 00:00:08,470 --> 00:00:12,470 So today, I'd like to take a look at solving a linear ODE 4 00:00:12,470 --> 00:00:14,630 but with a periodic input. 5 00:00:14,630 --> 00:00:16,630 And specifically, we're asked to find 6 00:00:16,630 --> 00:00:20,090 one solution, a particular solution, which is also 7 00:00:20,090 --> 00:00:22,480 the periodic solution of the differential equation 8 00:00:22,480 --> 00:00:28,400 x dot dot plus 2x dot plus 4x equals the square wave 9 00:00:28,400 --> 00:00:29,440 function. 10 00:00:29,440 --> 00:00:32,259 So the square wave function is a periodic function 11 00:00:32,259 --> 00:00:33,870 with period 2pi. 12 00:00:33,870 --> 00:00:36,790 It's defined as minus 1 and 1 on the intervals minus pi 13 00:00:36,790 --> 00:00:39,310 to 0 and 0 to pi. 14 00:00:39,310 --> 00:00:42,180 And we know that the square wave function has 15 00:00:42,180 --> 00:00:44,800 the following Fourier series. 16 00:00:44,800 --> 00:00:47,050 So I'll let you think about this problem for a moment. 17 00:00:47,050 --> 00:00:48,341 And I'll come back in a second. 18 00:00:58,360 --> 00:00:59,670 Hi everyone. 19 00:00:59,670 --> 00:01:02,150 Welcome back. 20 00:01:02,150 --> 00:01:04,790 So the reason we've been studying Fourier series 21 00:01:04,790 --> 00:01:06,870 is to essentially solve differential equations 22 00:01:06,870 --> 00:01:10,530 with complicated forcing inputs on the right-hand side which 23 00:01:10,530 --> 00:01:11,960 are periodic. 24 00:01:11,960 --> 00:01:14,600 And the reason we've been studying Fourier series 25 00:01:14,600 --> 00:01:17,490 is because we know that differential equations 26 00:01:17,490 --> 00:01:20,200 with sines and cosines as forcing terms 27 00:01:20,200 --> 00:01:24,340 on the right-hand side are relatively easy to solve. 28 00:01:24,340 --> 00:01:27,900 And we want to be able to solve the same differential 29 00:01:27,900 --> 00:01:30,760 equation with a more complicated periodic function 30 00:01:30,760 --> 00:01:32,360 on the right-hand side. 31 00:01:32,360 --> 00:01:44,350 So the general approach is to first decompose 32 00:01:44,350 --> 00:01:49,230 the right-hand side into a Fourier series. 33 00:01:57,529 --> 00:01:59,570 And this step is essentially already done for us. 34 00:01:59,570 --> 00:02:02,810 We're told what the Fourier series is. 35 00:02:02,810 --> 00:02:09,445 And what we do is we solve the ODE x 36 00:02:09,445 --> 00:02:14,500 dot dot plus 2x dot plus 4x. 37 00:02:14,500 --> 00:02:19,790 And I'm just going to take one term of the Fourier series, 38 00:02:19,790 --> 00:02:20,520 sine n*t. 39 00:02:23,251 --> 00:02:24,750 So if we know the right-hand side is 40 00:02:24,750 --> 00:02:27,620 a sum of a whole bunch of sines, what we're going to do 41 00:02:27,620 --> 00:02:32,287 is we're going to solve for any specific one of those sines. 42 00:02:32,287 --> 00:02:34,245 So we want to solve this differential equation. 43 00:02:36,920 --> 00:02:41,610 And then, we use superposition. 44 00:02:45,660 --> 00:02:49,319 So if we know what the solution is to one sine n*t, 45 00:02:49,319 --> 00:02:51,860 and we know that the right-hand side forcing is a sum of many 46 00:02:51,860 --> 00:02:55,670 sine n*t's with appropriate weight factors, 47 00:02:55,670 --> 00:03:05,240 then we can use superposition to construct a final solution. 48 00:03:11,180 --> 00:03:15,220 So this is the method to attack this problem. 49 00:03:15,220 --> 00:03:20,180 So we were given step one, and we want to solve step two. 50 00:03:20,180 --> 00:03:22,900 And we can solve this just using the exponential response 51 00:03:22,900 --> 00:03:23,775 formula. 52 00:03:23,775 --> 00:03:25,400 So what we're going to do is we're just 53 00:03:25,400 --> 00:03:28,030 going to complexify the right-hand side. 54 00:03:32,150 --> 00:03:35,590 So if I want to solve the differential equation x dot dot 55 00:03:35,590 --> 00:03:39,650 plus 2x dot plus 4x equals sine n*t, 56 00:03:39,650 --> 00:03:44,200 I'm going to denote the solution with the subscript n. 57 00:03:44,200 --> 00:03:48,224 And it's going to be the imaginary part 58 00:03:48,224 --> 00:03:51,430 of-- and I'm just using the exponential response formula-- 59 00:03:51,430 --> 00:03:58,110 1 over the characteristic polynomial evaluated at i*n, 60 00:03:58,110 --> 00:04:01,367 e to the i*n*t. 61 00:04:01,367 --> 00:04:02,700 You might ask how do I get that. 62 00:04:05,670 --> 00:04:15,910 Well, I basically just took the complexified equation, 63 00:04:15,910 --> 00:04:19,075 and noted that sine n*t was the imaginary part of e 64 00:04:19,075 --> 00:04:22,910 to the i*n*t, and then used the exponential response formula. 65 00:04:22,910 --> 00:04:25,410 And I want to take the imaginary part at the end of the day. 66 00:04:29,760 --> 00:04:32,630 So what is the characteristic polynomial? 67 00:04:32,630 --> 00:04:37,320 In this case, it's s squared plus 2s plus 4, 68 00:04:37,320 --> 00:04:43,060 which means that p of i*n is going to be negative n squared 69 00:04:43,060 --> 00:04:46,820 plus 4-- so I'll just group the real terms together-- 70 00:04:46,820 --> 00:04:54,290 plus 2i*n, so the 2i*n comes from the 2s term. 71 00:04:54,290 --> 00:05:01,960 And then x of n is going to be the imaginary part of 1 over 4 72 00:05:01,960 --> 00:05:08,720 minus n squared plus 2i*n e to the i*n*t. 73 00:05:12,100 --> 00:05:18,240 And I'm going to use the amplitude-phase form. 74 00:05:23,100 --> 00:05:25,720 I'm going to convert this Cartesian complex number 75 00:05:25,720 --> 00:05:28,270 into an amplitude-phase form just because it's 76 00:05:28,270 --> 00:05:31,237 going to make taking the imaginary part of the solution 77 00:05:31,237 --> 00:05:32,570 very easy at the end of the day. 78 00:05:36,100 --> 00:05:41,080 So the amplitude of this complex number is 4 minus n squared, 79 00:05:41,080 --> 00:05:45,410 quantity squared, plus the imaginary part squared, 80 00:05:45,410 --> 00:05:48,900 so that's 4n squared, square rooted. 81 00:05:51,790 --> 00:05:58,369 And then, upstairs is e^(i*n*t). 82 00:05:58,369 --> 00:06:00,160 And downstairs, it's going to be e^(i*phi). 83 00:06:04,600 --> 00:06:09,370 And I'm going to put a subscript n on the phi 84 00:06:09,370 --> 00:06:13,090 just because for each complex number, 85 00:06:13,090 --> 00:06:15,740 we're going to have a different phase phi. 86 00:06:15,740 --> 00:06:20,460 And that phase phi_n is going to be 87 00:06:20,460 --> 00:06:33,480 the arctangent of 2n divided by 4 minus n squared, like that. 88 00:06:38,430 --> 00:06:43,000 So now, I can combine phi of n with the upstairs term, i*n*t, 89 00:06:43,000 --> 00:06:44,740 in the exponent. 90 00:06:44,740 --> 00:06:46,500 And when I take the imaginary part, 91 00:06:46,500 --> 00:06:52,200 I'm only going to be left with sine of n*t minus phi_n. 92 00:06:52,200 --> 00:07:02,750 So x of n is going to be 1 over 4 minus n squared squared plus 93 00:07:02,750 --> 00:07:12,780 4n squared quantity squared-- square rooted-- 94 00:07:12,780 --> 00:07:20,350 times sine of n*t minus phi_n, where phi_n was given using 95 00:07:20,350 --> 00:07:23,050 the arctangent formula. 96 00:07:23,050 --> 00:07:26,000 And this gives us a solution, which note 97 00:07:26,000 --> 00:07:27,340 is periodic with period 2t-- 98 00:07:27,340 --> 00:07:29,000 AUDIENCE: [INAUDIBLE]. 99 00:07:29,000 --> 00:07:31,020 PROFESSOR: Right. 100 00:07:31,020 --> 00:07:46,490 I should also note that phi of n is between 0 and pi. 101 00:07:49,010 --> 00:07:52,270 And this gives us this one solution to the differential 102 00:07:52,270 --> 00:07:56,130 equation with a forcing of sine n*t on the right-hand side. 103 00:07:56,130 --> 00:07:59,340 So now what we want to do is we want sum up 104 00:07:59,340 --> 00:08:02,850 many of these solutions using the superposition principle. 105 00:08:02,850 --> 00:08:06,632 So if I go back now, I'm going to write 106 00:08:06,632 --> 00:08:08,090 the original differential equation. 107 00:08:11,280 --> 00:08:15,320 So I'm just going to go back and just rewrite this. 108 00:08:15,320 --> 00:08:17,500 And I'm going to write the right-hand side using its 109 00:08:17,500 --> 00:08:24,920 Fourier series, 1 over n sine n*t, where n is odd. 110 00:08:28,570 --> 00:08:31,170 And this is the problem we originally wanted to solve. 111 00:08:31,170 --> 00:08:33,640 And essentially what we've done is we've solved the problem 112 00:08:33,640 --> 00:08:36,240 for each individual sine n*t. 113 00:08:36,240 --> 00:08:37,789 So how do we get the full solution? 114 00:08:37,789 --> 00:08:40,289 Well, what we have to do is we have to multiply the solution 115 00:08:40,289 --> 00:08:45,292 for each sine n*t by a factor of 4 divided by pi and 1 over n. 116 00:08:45,292 --> 00:08:47,250 And then, we have to add all of these solutions 117 00:08:47,250 --> 00:08:49,660 up for all odd values of n. 118 00:08:53,360 --> 00:09:04,710 So for example, x is just going to be 4 over pi sum of n odd, 119 00:09:04,710 --> 00:09:10,620 1 over n times the solution to every sine n*t, 120 00:09:10,620 --> 00:09:14,925 which we've already computed, and I've denoted it as x sub n. 121 00:09:14,925 --> 00:09:17,870 And x sub n is up here. 122 00:09:17,870 --> 00:09:21,810 So if we want to be explicit about it, 123 00:09:21,810 --> 00:09:32,220 I'll write the whole thing out as 4 over pi, n odd, 1 over 4 124 00:09:32,220 --> 00:09:35,120 minus n squared, quantity squared, 125 00:09:35,120 --> 00:09:39,720 plus 4n squared, square rooted. 126 00:09:39,720 --> 00:09:43,500 We also have a factor of n out front. 127 00:09:43,500 --> 00:09:48,174 We have a sine n*t minus phi_n. 128 00:09:51,890 --> 00:09:55,180 So there's the final answer for a particular solution 129 00:09:55,180 --> 00:09:58,320 in its full glorious detail. 130 00:09:58,320 --> 00:10:00,370 We can also check that this particular solution 131 00:10:00,370 --> 00:10:02,330 is periodic. 132 00:10:02,330 --> 00:10:04,740 Note how each sine n*t is periodic. 133 00:10:04,740 --> 00:10:09,070 And each sine n*t has period of at least 2pi. 134 00:10:09,070 --> 00:10:11,080 So when we sum up a whole bunch of functions 135 00:10:11,080 --> 00:10:13,950 which all have a period of at least 2pi, 136 00:10:13,950 --> 00:10:17,110 the sum is also going to be periodic function with at least 137 00:10:17,110 --> 00:10:17,610 2pi. 138 00:10:21,250 --> 00:10:25,770 And as a result, this gives us the answer we're looking for. 139 00:10:25,770 --> 00:10:28,070 Also, in addition, if we want the full general solution 140 00:10:28,070 --> 00:10:31,110 to the differential equation to this particular solution, 141 00:10:31,110 --> 00:10:35,340 we also have to add the homogeneous piece. 142 00:10:35,340 --> 00:10:37,610 So this concludes the problem. 143 00:10:37,610 --> 00:10:39,460 And I'll just quickly recap. 144 00:10:39,460 --> 00:10:40,960 When solving a differential equation 145 00:10:40,960 --> 00:10:43,340 with a periodic forcing function on the right-hand side, 146 00:10:43,340 --> 00:10:45,880 again, to iterate the steps, you first 147 00:10:45,880 --> 00:10:48,160 Fourier decompose the right-hand side 148 00:10:48,160 --> 00:10:50,940 into summation of sines and cosines. 149 00:10:50,940 --> 00:10:54,490 You then solve the differential equation for sine n*t, 150 00:10:54,490 --> 00:10:57,810 cosine n*t individually. 151 00:10:57,810 --> 00:10:59,760 This gives you a solution for each term 152 00:10:59,760 --> 00:11:02,250 on the right-hand side of the differential equation. 153 00:11:02,250 --> 00:11:03,708 And then at the end of the day, you 154 00:11:03,708 --> 00:11:06,260 use superposition to sum up all of the solutions. 155 00:11:06,260 --> 00:11:09,910 And that gives you one final big solution. 156 00:11:09,910 --> 00:11:11,330 So I hope you enjoy this problem. 157 00:11:11,330 --> 00:11:13,484 And I'll see you next time.