1 00:00:00,000 --> 00:00:00,027 2 00:00:00,027 --> 00:00:02,110 The following content is provided under a Creative 3 00:00:02,110 --> 00:00:03,512 Commons license. 4 00:00:03,512 --> 00:00:05,220 Your support will help MIT OpenCourseWare 5 00:00:05,220 --> 00:00:10,050 continue to offer high-quality educational resources for free. 6 00:00:10,050 --> 00:00:12,530 To make a donation, or to view additional materials 7 00:00:12,530 --> 00:00:15,210 from hundreds of MIT courses, visit MIT OpenCourseWare 8 00:00:15,210 --> 00:00:20,190 at ocw.mit.edu. 9 00:00:20,190 --> 00:00:21,700 AUDIENCE: OK. 10 00:00:21,700 --> 00:00:25,490 I hoped I might have Exam 2 for you today, 11 00:00:25,490 --> 00:00:28,190 but it's not quite back from the grader. 12 00:00:28,190 --> 00:00:33,400 It's already gone to the second grader, so it will not be long. 13 00:00:33,400 --> 00:00:39,670 And I hope you've had a look at the MATLAB homework 14 00:00:39,670 --> 00:00:45,650 for a variety of possible-- I think we've got, 15 00:00:45,650 --> 00:00:49,910 there were some errors in the original statement, 16 00:00:49,910 --> 00:00:53,760 location of the coordinates, but I think they're fixed now. 17 00:00:53,760 --> 00:00:55,900 So ready to go on that MATLAB. 18 00:00:55,900 --> 00:00:58,740 Don't forget that it's four on the right-hand side and not 19 00:00:58,740 --> 00:01:02,900 one, so if you get an answer near 1/4 20 00:01:02,900 --> 00:01:07,330 at the center of the circle, that's the reason. 21 00:01:07,330 --> 00:01:12,760 Just that factor four is to remember. 22 00:01:12,760 --> 00:01:15,420 I'll talk more about the MATLAB this afternoon 23 00:01:15,420 --> 00:01:18,000 in the review session right here. 24 00:01:18,000 --> 00:01:22,380 Just to say, I'm highly interested in that problem. 25 00:01:22,380 --> 00:01:25,620 Not just increasing N, the number 26 00:01:25,620 --> 00:01:30,950 of mesh points in the octagon, but also 27 00:01:30,950 --> 00:01:34,190 increasing the number of sides. 28 00:01:34,190 --> 00:01:42,530 So there are two numbers there, we had N points on a ray, 29 00:01:42,530 --> 00:01:44,600 out from the center. 30 00:01:44,600 --> 00:01:49,290 But we have M sides of the polygon. 31 00:01:49,290 --> 00:01:55,320 And I'm interested in both of those, getting big. 32 00:01:55,320 --> 00:01:57,200 Growing. 33 00:01:57,200 --> 00:01:58,650 I don't know how. 34 00:01:58,650 --> 00:02:06,420 And maybe a reasonable balance is to take, 35 00:02:06,420 --> 00:02:11,810 I think N proportional to M is a pretty good balance. 36 00:02:11,810 --> 00:02:14,100 So I'd be very happy; I mean I'm very 37 00:02:14,100 --> 00:02:15,890 happy with whatever you do. 38 00:02:15,890 --> 00:02:19,320 But I'm really interested to know what happens 39 00:02:19,320 --> 00:02:22,100 as both of these increase. 40 00:02:22,100 --> 00:02:24,520 How close, how quickly do you approach 41 00:02:24,520 --> 00:02:26,930 the eigenvalues of a circle. 42 00:02:26,930 --> 00:02:29,410 And you might keep the two proportional 43 00:02:29,410 --> 00:02:31,580 as you increase them. 44 00:02:31,580 --> 00:02:34,850 So let me say more about that this afternoon, because it's 45 00:02:34,850 --> 00:02:37,790 a big day today, to start Fourier. 46 00:02:37,790 --> 00:02:41,450 Fourier series, the new chapter, the new topic. 47 00:02:41,450 --> 00:02:44,550 In fact, the final major topic of the course. 48 00:02:44,550 --> 00:02:51,810 So I tried to list here, so here I'm in Section 4.1, 49 00:02:51,810 --> 00:02:54,620 so I'm talking about Fourier series. 50 00:02:54,620 --> 00:02:59,990 So Fourier series is for functions that have period 2pi. 51 00:02:59,990 --> 00:03:05,440 It involves things like sin(x), like cos(x), like e^(ikx), 52 00:03:05,440 --> 00:03:11,110 all of those if I increase x by 2pi, I'm back where I started. 53 00:03:11,110 --> 00:03:15,390 So that's the sort of functions that have Fourier series. 54 00:03:15,390 --> 00:03:21,880 Then we'll go on to the other two big forms, crucial forms 55 00:03:21,880 --> 00:03:23,920 of the Fourier world. 56 00:03:23,920 --> 00:03:28,900 But 4.1 starts with the classical Fourier series. 57 00:03:28,900 --> 00:03:33,660 So I realize you will have seen, many of you 58 00:03:33,660 --> 00:03:36,610 will have seen Fourier series before. 59 00:03:36,610 --> 00:03:40,190 I hope you'll see some new aspects here. 60 00:03:40,190 --> 00:03:48,030 So, let me just get organized. 61 00:03:48,030 --> 00:03:53,140 It's nice to have some examples that just involve sine. 62 00:03:53,140 --> 00:03:56,680 And since the sine is an odd function, that 63 00:03:56,680 --> 00:04:00,500 means it's sort of anti-symmetric across zero, 64 00:04:00,500 --> 00:04:03,820 those are the functions that will have only sine, that 65 00:04:03,820 --> 00:04:05,960 will have a sine expansion. 66 00:04:05,960 --> 00:04:07,590 Cosines are the opposite. 67 00:04:07,590 --> 00:04:10,340 Cosines are symmetric across zero. 68 00:04:10,340 --> 00:04:12,800 Like a constant, or like cos(x). 69 00:04:12,800 --> 00:04:15,650 Zero comes right at the symmetric point. 70 00:04:15,650 --> 00:04:18,320 So those will have only cosines. 71 00:04:18,320 --> 00:04:22,660 And a lot of examples fit in one or the other of those, 72 00:04:22,660 --> 00:04:24,180 and it's easy to see them. 73 00:04:24,180 --> 00:04:30,050 The general function, of course, is a combination odd and even. 74 00:04:30,050 --> 00:04:32,870 It has cosines and it has sines, it's 75 00:04:32,870 --> 00:04:35,330 just the sum of the two pieces. 76 00:04:35,330 --> 00:04:40,160 So, this is the standard Fourier series, 77 00:04:40,160 --> 00:04:43,060 which I couldn't get onto one line, 78 00:04:43,060 --> 00:04:46,590 but it has all the cosines including 79 00:04:46,590 --> 00:04:51,740 this slightly different cos(0), and all the sines. 80 00:04:51,740 --> 00:04:57,640 But because this one has these three different pieces, 81 00:04:57,640 --> 00:05:01,970 the constant term, the other cosines, all the sines, 82 00:05:01,970 --> 00:05:04,590 three slightly different formulas, 83 00:05:04,590 --> 00:05:10,120 it's actually nicest of all, to use this final form. 84 00:05:10,120 --> 00:05:12,150 Because there's just one formula. 85 00:05:12,150 --> 00:05:13,520 There's just one kind. 86 00:05:13,520 --> 00:05:16,380 And I'll call its coefficient c_k, 87 00:05:16,380 --> 00:05:21,210 and now they multiply e^(ikx), so we have to get used 88 00:05:21,210 --> 00:05:24,770 to e^(ikx). 89 00:05:24,770 --> 00:05:29,430 We may be more familiar with sin(kx) and cos(kx), 90 00:05:29,430 --> 00:05:34,050 but everybody knows e^(ikx) is a combination of them. 91 00:05:34,050 --> 00:05:38,710 And if we let k go from minus infinity to infinity, 92 00:05:38,710 --> 00:05:43,410 so we've got all the terms, including e^(-i3x), 93 00:05:43,410 --> 00:05:49,840 and e^(+i3x), those would combine to give cosines 94 00:05:49,840 --> 00:05:52,480 and sines of 3x. 95 00:05:52,480 --> 00:05:54,800 We get one nice formula. 96 00:05:54,800 --> 00:05:57,350 There's just one formula for the c's. 97 00:05:57,350 --> 00:06:01,500 So that's one good reason to look at the complex form. 98 00:06:01,500 --> 00:06:05,110 Even if our function is actually real. 99 00:06:05,110 --> 00:06:08,980 That form is kind of neat, and the second good reason, 100 00:06:08,980 --> 00:06:12,380 the really important reason, is then 101 00:06:12,380 --> 00:06:15,630 when we go to the discrete Fourier transform, 102 00:06:15,630 --> 00:06:20,190 the DFT, everybody writes that with complex numbers. 103 00:06:20,190 --> 00:06:24,670 So it's good to see complex numbers first 104 00:06:24,670 --> 00:06:30,320 and then we can just translate the formulas from-- 105 00:06:30,320 --> 00:06:34,510 And these are also almost always written with complex numbers. 106 00:06:34,510 --> 00:06:39,850 So this is the way to see it. 107 00:06:39,850 --> 00:06:44,130 OK, so what do we do about Fourier series? 108 00:06:44,130 --> 00:06:46,080 What do we have to know how to do 109 00:06:46,080 --> 00:06:47,990 and what should we understand? 110 00:06:47,990 --> 00:06:52,040 Well, if you've met Fourier series 111 00:06:52,040 --> 00:06:56,800 you may have met the formula for these coefficients. 112 00:06:56,800 --> 00:06:58,140 That's sort of like step one. 113 00:06:58,140 --> 00:07:01,340 If I'm given the function, whatever the function might be, 114 00:07:01,340 --> 00:07:02,710 might be a delta function. 115 00:07:02,710 --> 00:07:04,240 Interesting case, always. 116 00:07:04,240 --> 00:07:07,340 Always interesting. 117 00:07:07,340 --> 00:07:08,970 Always crazy right? 118 00:07:08,970 --> 00:07:13,370 But it's always interesting, the delta function. 119 00:07:13,370 --> 00:07:16,320 The coefficients can be computed. 120 00:07:16,320 --> 00:07:21,470 The coefficients, you'll see, I'll repeat those formulas. 121 00:07:21,470 --> 00:07:26,110 They involve integrals. 122 00:07:26,110 --> 00:07:29,230 What I want to say right now is that this 123 00:07:29,230 --> 00:07:31,380 isn't a course in integration. 124 00:07:31,380 --> 00:07:35,770 So I'm not interested in doing more and more complicated 125 00:07:35,770 --> 00:07:39,030 integrals and finding Fourier coefficients 126 00:07:39,030 --> 00:07:40,850 of weird functions. 127 00:07:40,850 --> 00:07:41,760 No way. 128 00:07:41,760 --> 00:07:45,480 I want to understand the simple, straight, 129 00:07:45,480 --> 00:07:47,280 the important examples. 130 00:07:47,280 --> 00:07:52,970 And here's a point that's highly interesting. 131 00:07:52,970 --> 00:07:55,900 In practice, in computing practice, 132 00:07:55,900 --> 00:07:57,960 we're close to computing practice here. 133 00:07:57,960 --> 00:07:59,630 In everything we do. 134 00:07:59,630 --> 00:08:03,020 I mean, this is really constantly used. 135 00:08:03,020 --> 00:08:08,380 And one important question is, is the Fourier series quickly 136 00:08:08,380 --> 00:08:09,374 convergent? 137 00:08:09,374 --> 00:08:10,790 Because if we're going to compute, 138 00:08:10,790 --> 00:08:14,640 we don't want to compute a thousand terms. 139 00:08:14,640 --> 00:08:19,850 Hopefully ten terms, 20 terms would give us good accuracy. 140 00:08:19,850 --> 00:08:24,370 So that question comes down to how quickly does those a's 141 00:08:24,370 --> 00:08:27,320 and b's and c's go to zero? 142 00:08:27,320 --> 00:08:28,580 That's highly important. 143 00:08:28,580 --> 00:08:31,270 And you'll connect this decay rate, 144 00:08:31,270 --> 00:08:34,760 we'll connect this with the smoothness of the function. 145 00:08:34,760 --> 00:08:38,770 Oh, I can tell you even at a start. 146 00:08:38,770 --> 00:08:42,220 OK, so I just want to emphasize this point. 147 00:08:42,220 --> 00:08:50,060 We'll see it over and over that like for a delta function, 148 00:08:50,060 --> 00:08:56,140 which is not smooth at all, we'll see no decay at all. 149 00:08:56,140 --> 00:08:58,800 In the coefficients. 150 00:08:58,800 --> 00:09:03,110 They're constant. 151 00:09:03,110 --> 00:09:06,820 They don't decrease as we go to higher and higher frequencies. 152 00:09:06,820 --> 00:09:13,800 I think of k here, I'll use the word frequency for k. 153 00:09:13,800 --> 00:09:18,260 So high frequency means high k, far up the Fourier series, 154 00:09:18,260 --> 00:09:22,350 and the question is, are the coefficients staying up 155 00:09:22,350 --> 00:09:24,240 there big, and we have to worry about them? 156 00:09:24,240 --> 00:09:26,200 Or do they get very small? 157 00:09:26,200 --> 00:09:29,970 So a delta function is a key example and then 158 00:09:29,970 --> 00:09:32,170 a step function. 159 00:09:32,170 --> 00:09:34,590 So what will be the deal with those? 160 00:09:34,590 --> 00:09:37,330 If I have a function that's a step function, 161 00:09:37,330 --> 00:09:44,730 I'll have decay at rate is 1/k.. 162 00:09:44,730 --> 00:09:46,490 So they do go to zero. 163 00:09:46,490 --> 00:09:53,040 The thousandth coefficient will be roughly of size 1/1000. 164 00:09:53,040 --> 00:09:54,930 That's not fast. 165 00:09:54,930 --> 00:10:02,210 That's not really fast enough to compute with. 166 00:10:02,210 --> 00:10:08,430 Well, we meet step functions, I mean, functions with jumps. 167 00:10:08,430 --> 00:10:12,450 And we'll see that their Fourier series, the coefficients 168 00:10:12,450 --> 00:10:16,840 do go to zero but not very fast. 169 00:10:16,840 --> 00:10:19,590 And we get something highly interesting. 170 00:10:19,590 --> 00:10:22,850 So when we do these examples, so I've 171 00:10:22,850 --> 00:10:27,130 sort of moved on to examples, so these are two basic examples. 172 00:10:27,130 --> 00:10:30,160 What would be the next example? 173 00:10:30,160 --> 00:10:32,780 Step function. 174 00:10:32,780 --> 00:10:35,200 Well, yeah, or maybe a hat next. 175 00:10:35,200 --> 00:10:38,840 A hat function would be, you see what I'm doing at each step? 176 00:10:38,840 --> 00:10:40,140 I'm integrating. 177 00:10:40,140 --> 00:10:44,200 A hat function might be the next, yeah, a ramp, exactly. 178 00:10:44,200 --> 00:10:48,520 Hat function, which is a ramp with a corner. 179 00:10:48,520 --> 00:10:50,960 Now, so that's one integral better. 180 00:10:50,960 --> 00:10:55,740 You want to guess the decay rate on that one? k squared. 181 00:10:55,740 --> 00:10:58,220 Now we're getting better. 182 00:10:58,220 --> 00:11:00,080 That's a faster follow-up. 183 00:11:00,080 --> 00:11:02,310 One over k squared. 184 00:11:02,310 --> 00:11:06,220 And then we integrate again, we'd get one over k cubed. 185 00:11:06,220 --> 00:11:08,520 Then one more integral, one over k fourth 186 00:11:08,520 --> 00:11:11,080 would be a cubic spline. 187 00:11:11,080 --> 00:11:14,020 You remember the cubic spline is continuous. 188 00:11:14,020 --> 00:11:16,050 Its derivative is continuous, that 189 00:11:16,050 --> 00:11:17,950 gives us a one over k cubed. 190 00:11:17,950 --> 00:11:19,930 Its second derivative is continuous, 191 00:11:19,930 --> 00:11:22,320 that gives us a one over k to the fourth, 192 00:11:22,320 --> 00:11:25,060 and then you really can compute with that, 193 00:11:25,060 --> 00:11:27,270 if you have such a function. 194 00:11:27,270 --> 00:11:31,510 So, point: pay attention to decay rate. 195 00:11:31,510 --> 00:11:37,000 That, and the connection to smoothness. 196 00:11:37,000 --> 00:11:41,520 So examples, we'll start right off with these guys. 197 00:11:41,520 --> 00:11:44,560 And then we'll see the rules for the derivative. 198 00:11:44,560 --> 00:11:48,890 Oh yeah, rules for the derivative. 199 00:11:48,890 --> 00:11:53,200 The beauty of Fourier series is, well, actually you 200 00:11:53,200 --> 00:11:54,270 can see this. 201 00:11:54,270 --> 00:11:56,170 You can see the rule. 202 00:11:56,170 --> 00:11:58,630 Let me just show you the rule for this. 203 00:11:58,630 --> 00:12:04,200 So the rule for derivatives, the whole point about Fourier 204 00:12:04,200 --> 00:12:08,890 is, it connects perfectly with calculus. 205 00:12:08,890 --> 00:12:10,690 With taking derivatives. 206 00:12:10,690 --> 00:12:16,310 So suppose I have F(x) equals, I'll use this form, 207 00:12:16,310 --> 00:12:19,360 the sum of c_k e^(ikx). 208 00:12:19,360 --> 00:12:22,290 209 00:12:22,290 --> 00:12:24,230 And now I take its derivative. 210 00:12:24,230 --> 00:12:25,700 dF/dx. 211 00:12:25,700 --> 00:12:29,850 What do you think is the derivative, what's the Fourier 212 00:12:29,850 --> 00:12:33,500 series for the derivative? 213 00:12:33,500 --> 00:12:35,940 Suppose I have the Fourier series for some function, 214 00:12:35,940 --> 00:12:38,520 and then I take Fourier series for the derivative. 215 00:12:38,520 --> 00:12:42,000 So I'm kind of going the backwards way. 216 00:12:42,000 --> 00:12:43,520 Less smooth. 217 00:12:43,520 --> 00:12:48,020 I'm going from, the derivative of the step function 218 00:12:48,020 --> 00:12:53,400 involves delta functions, so I'm going less smooth 219 00:12:53,400 --> 00:12:57,720 as I take derivatives. 220 00:12:57,720 --> 00:13:00,520 It's so easy, it jumps at you. 221 00:13:00,520 --> 00:13:01,390 What's the rule? 222 00:13:01,390 --> 00:13:04,240 Just take the derivative of every term, 223 00:13:04,240 --> 00:13:07,850 so I'll have the sum of, now what happens 224 00:13:07,850 --> 00:13:10,700 when I take the derivative? 225 00:13:10,700 --> 00:13:12,290 Everybody see what happens when I 226 00:13:12,290 --> 00:13:16,250 take the derivative of that typical term in the Fourier 227 00:13:16,250 --> 00:13:17,070 series? 228 00:13:17,070 --> 00:13:19,050 What happens? 229 00:13:19,050 --> 00:13:23,450 The derivative brings down a factor ik. 230 00:13:23,450 --> 00:13:32,180 With k being the thing that-- So it's ik times what we have. 231 00:13:32,180 --> 00:13:38,200 So these are the Fourier coefficients of the derivative. 232 00:13:38,200 --> 00:13:43,260 And that again makes exactly the same point about the decay rate 233 00:13:43,260 --> 00:13:46,000 or the opposite, the non-decay rate. 234 00:13:46,000 --> 00:13:50,390 As I take the derivative you got a rougher function, right? 235 00:13:50,390 --> 00:13:55,430 Derivative of a step function is a delta, derivative of a hat 236 00:13:55,430 --> 00:13:57,250 would have some steps. 237 00:13:57,250 --> 00:14:02,580 We're going less smooth as we take more derivatives. 238 00:14:02,580 --> 00:14:05,430 And every time we do it, we see, you 239 00:14:05,430 --> 00:14:07,520 understand the decay rate now? 240 00:14:07,520 --> 00:14:12,510 Because the derivative just brings a factor ik, 241 00:14:12,510 --> 00:14:18,640 so its high frequencies are more present. 242 00:14:18,640 --> 00:14:20,900 Have larger coefficients. 243 00:14:20,900 --> 00:14:22,760 So and of course, the second derivative 244 00:14:22,760 --> 00:14:27,200 would bring down ik squared. 245 00:14:27,200 --> 00:14:35,080 So that our equations, for example, 246 00:14:35,080 --> 00:14:38,180 let me just do an application here. 247 00:14:38,180 --> 00:14:41,300 Without pushing it. 248 00:14:41,300 --> 00:14:46,220 Our application, we started this course with equations like 249 00:14:46,220 --> 00:14:51,750 -u''(x) = delta(x-a). 250 00:14:51,750 --> 00:14:52,770 Right? 251 00:14:52,770 --> 00:14:55,290 If we wanted to apply to a differential equation, 252 00:14:55,290 --> 00:14:56,890 how would I do it? 253 00:14:56,890 --> 00:15:00,560 I would take the Fourier series of both sides. 254 00:15:00,560 --> 00:15:03,750 I would look at, I'd jump into what people would 255 00:15:03,750 --> 00:15:05,880 call the frequency domain. 256 00:15:05,880 --> 00:15:10,980 So this is a differential equation written as usual 257 00:15:10,980 --> 00:15:13,850 in the physical domain. 258 00:15:13,850 --> 00:15:17,060 And with physical variable x, position. 259 00:15:17,060 --> 00:15:18,710 Or it could be time. 260 00:15:18,710 --> 00:15:22,100 And now let me take Fourier transforms. 261 00:15:22,100 --> 00:15:23,800 So what would happen here? 262 00:15:23,800 --> 00:15:26,870 If I take the Fourier transform of this, 263 00:15:26,870 --> 00:15:30,000 well, we'll soon see, right? 264 00:15:30,000 --> 00:15:33,100 We get Fourier coefficients of the deltas. 265 00:15:33,100 --> 00:15:34,800 Of the delta function. 266 00:15:34,800 --> 00:15:38,350 That's a key example, and you see why. 267 00:15:38,350 --> 00:15:40,970 Over here, what will we get? 268 00:15:40,970 --> 00:15:42,930 And now I'm taking two derivatives, 269 00:15:42,930 --> 00:15:45,560 so I bring down ik twice. 270 00:15:45,560 --> 00:15:46,820 So I'm looking. 271 00:15:46,820 --> 00:15:50,660 Here it would be the sum of whatever 272 00:15:50,660 --> 00:15:52,440 the delta's coefficients are. 273 00:15:52,440 --> 00:15:54,840 Shall we call those d? 274 00:15:54,840 --> 00:15:59,490 The alphabet's coming out right. d for delta. 275 00:15:59,490 --> 00:16:03,750 So the right side has coefficients, d_k. 276 00:16:03,750 --> 00:16:05,130 And what about the left side? 277 00:16:05,130 --> 00:16:08,700 What are the coefficients-- If the solution 278 00:16:08,700 --> 00:16:15,270 u has coefficients c_k, so let's call this u now. 279 00:16:15,270 --> 00:16:18,380 Has coefficients c_k, then what happens 280 00:16:18,380 --> 00:16:22,430 to the second derivative? ik, ik again, 281 00:16:22,430 --> 00:16:25,050 that's i squared k squared, the minus sign. 282 00:16:25,050 --> 00:16:33,270 So we would have the sum of k squared c_k e^(ikx). 283 00:16:33,270 --> 00:16:38,200 This is if u itself has coefficient c_k, then -u'' has 284 00:16:38,200 --> 00:16:39,750 these coefficients. 285 00:16:39,750 --> 00:16:41,140 So what's up? 286 00:16:41,140 --> 00:16:43,380 How would we use that? 287 00:16:43,380 --> 00:16:44,640 It's going to be easy. 288 00:16:44,640 --> 00:16:48,760 We'll just match terms. 289 00:16:48,760 --> 00:16:49,580 Right? 290 00:16:49,580 --> 00:16:52,690 I can see, what's my formula, what should c_k 291 00:16:52,690 --> 00:16:54,880 be if I know the d_k? 292 00:16:54,880 --> 00:16:58,440 I'm given the right-hand side. 293 00:16:58,440 --> 00:17:01,200 We're just doing what's constantly happening, 294 00:17:01,200 --> 00:17:03,090 this three step process. 295 00:17:03,090 --> 00:17:04,710 You're given the right side. 296 00:17:04,710 --> 00:17:09,820 Step one, expand it in Fourier series now. 297 00:17:09,820 --> 00:17:13,070 Step two, match the two sides. 298 00:17:13,070 --> 00:17:16,720 So what's the formula for c_k? 299 00:17:16,720 --> 00:17:19,120 In this application, which, by the way 300 00:17:19,120 --> 00:17:20,650 I had no intention to do this. 301 00:17:20,650 --> 00:17:24,520 But it jumped into my head and I thought why not just do it. 302 00:17:24,520 --> 00:17:30,670 What would be the formula for c_k? 303 00:17:30,670 --> 00:17:35,420 It'll be d_k divided by? k squared. 304 00:17:35,420 --> 00:17:37,680 You're just matching terms. 305 00:17:37,680 --> 00:17:42,960 Just the way, when we expanded things in eigenvectors, 306 00:17:42,960 --> 00:17:45,130 we'd match the coefficients of the eigenvectors, 307 00:17:45,130 --> 00:17:49,230 and that involved just the simple step, 308 00:17:49,230 --> 00:17:52,740 here it's d_k over k squared. 309 00:17:52,740 --> 00:17:53,500 Good. 310 00:17:53,500 --> 00:17:55,610 And then what's the final step? 311 00:17:55,610 --> 00:17:59,280 The final step is, now you know the right coefficients, 312 00:17:59,280 --> 00:18:01,150 add them back up. 313 00:18:01,150 --> 00:18:03,540 Add the thing back up, like here, 314 00:18:03,540 --> 00:18:10,701 only I'm temporarily calling it u, to find the solution. 315 00:18:10,701 --> 00:18:11,200 Right? 316 00:18:11,200 --> 00:18:13,930 Three steps. 317 00:18:13,930 --> 00:18:16,480 Go into the frequency domain. 318 00:18:16,480 --> 00:18:21,410 Write the right-hand side as a Fourier series. 319 00:18:21,410 --> 00:18:26,460 Second quick step is look at the equation 320 00:18:26,460 --> 00:18:30,600 for each separate Fourier coefficient. 321 00:18:30,600 --> 00:18:34,610 Match the coefficients of these eigenvectors. 322 00:18:34,610 --> 00:18:35,670 Eigenfunctions. 323 00:18:35,670 --> 00:18:38,790 And that's this quick middle step. 324 00:18:38,790 --> 00:18:41,600 And then you've got the answer, but you're still 325 00:18:41,600 --> 00:18:44,570 in Fourier space, you're still in frequency space. 326 00:18:44,570 --> 00:18:47,750 So you have to use these, put them back 327 00:18:47,750 --> 00:18:51,090 to get the answer in physical space. 328 00:18:51,090 --> 00:18:51,660 Right? 329 00:18:51,660 --> 00:18:53,180 That's the pattern. 330 00:18:53,180 --> 00:18:54,140 Over and over. 331 00:18:54,140 --> 00:18:59,280 So that's sort of the general plan of applying Fourier. 332 00:18:59,280 --> 00:19:02,290 And when does it work? 333 00:19:02,290 --> 00:19:03,710 When does it work? 334 00:19:03,710 --> 00:19:07,690 Because, I mean it's fantastic when it works. 335 00:19:07,690 --> 00:19:13,520 So what is it about this problem that made it work? 336 00:19:13,520 --> 00:19:15,920 When is Fourier happy? 337 00:19:15,920 --> 00:19:17,840 You know, when does he raise his hand, 338 00:19:17,840 --> 00:19:20,210 say yes I can solve that problem? 339 00:19:20,210 --> 00:19:26,200 OK, what do I need here for this plan to work? 340 00:19:26,200 --> 00:19:30,830 I certainly don't need always just -u'', Fourier could do 341 00:19:30,830 --> 00:19:31,750 better than that. 342 00:19:31,750 --> 00:19:37,340 But what's the requirement for Fourier to work perfectly? 343 00:19:37,340 --> 00:19:40,860 Well, linear equation, right? 344 00:19:40,860 --> 00:19:42,380 If we didn't have linear equations 345 00:19:42,380 --> 00:19:45,640 we couldn't do all this adding and matching and stuff. 346 00:19:45,640 --> 00:19:47,600 So linear equations. 347 00:19:47,600 --> 00:19:51,340 Well, OK. 348 00:19:51,340 --> 00:19:54,070 Now, what other linear equations? 349 00:19:54,070 --> 00:19:56,590 Could I have a c(x) in here? 350 00:19:56,590 --> 00:20:01,070 My familiar c(x), variable material property 351 00:20:01,070 --> 00:20:03,070 inside this equation? 352 00:20:03,070 --> 00:20:04,320 No. 353 00:20:04,320 --> 00:20:05,940 Well, not easily, anyway. 354 00:20:05,940 --> 00:20:08,930 That would really mess things up if there's 355 00:20:08,930 --> 00:20:13,580 a variable coefficient in here then 356 00:20:13,580 --> 00:20:15,760 it's going to have its own Fourier series. 357 00:20:15,760 --> 00:20:18,480 We're going to be multiplying Fourier series. 358 00:20:18,480 --> 00:20:22,380 That comes later and it's not so clean. 359 00:20:22,380 --> 00:20:25,500 So we want, it works perfectly when 360 00:20:25,500 --> 00:20:28,110 it's constant coefficients. 361 00:20:28,110 --> 00:20:33,220 Constant coefficients in the differential equations. 362 00:20:33,220 --> 00:20:36,090 And then one more thing. 363 00:20:36,090 --> 00:20:38,470 Very important other thing. 364 00:20:38,470 --> 00:20:39,710 The boundary conditions. 365 00:20:39,710 --> 00:20:41,850 Everybody remembers now, it's a part 366 00:20:41,850 --> 00:20:47,180 of the message of this course is that boundary conditions are 367 00:20:47,180 --> 00:20:48,980 often a source of trouble. 368 00:20:48,980 --> 00:20:51,800 They're part of the problem, you have to deal with them. 369 00:20:51,800 --> 00:20:56,030 Now, what boundary conditions do we think about here? 370 00:20:56,030 --> 00:21:02,070 Well, fixed-fixed was where we started. 371 00:21:02,070 --> 00:21:05,420 So if we had fixed-fixed boundary conditions what would 372 00:21:05,420 --> 00:21:06,390 I expect? 373 00:21:06,390 --> 00:21:12,450 Then things would give me a sine series, possibly. 374 00:21:12,450 --> 00:21:14,640 Because those are the eigenfunctions we're used to. 375 00:21:14,640 --> 00:21:19,800 Fixed-fixed, it's sines that go from zero back to zero. 376 00:21:19,800 --> 00:21:24,770 Fixed-free will have some sines or cosines. 377 00:21:24,770 --> 00:21:27,020 Periodic would be the best of all. 378 00:21:27,020 --> 00:21:32,040 Yeah, so we need nice boundary conditions. 379 00:21:32,040 --> 00:21:38,060 So the boundary conditions, let me just say, 380 00:21:38,060 --> 00:21:40,860 periodic would be great. 381 00:21:40,860 --> 00:21:47,200 Or sometimes fixed-free. 382 00:21:47,200 --> 00:21:53,430 Our familiar ones, at least in simple cases, 383 00:21:53,430 --> 00:21:55,890 can be dealt with. 384 00:21:55,890 --> 00:21:57,540 OK. 385 00:21:57,540 --> 00:22:04,790 So now, boy, that board is already full of formulas. 386 00:22:04,790 --> 00:22:09,640 But, let's go back to the start and say how 387 00:22:09,640 --> 00:22:13,290 do we find the coefficients? 388 00:22:13,290 --> 00:22:15,300 So because that was the first step. 389 00:22:15,300 --> 00:22:18,270 Take the right-hand side, find its coefficient. 390 00:22:18,270 --> 00:22:22,250 If we want to, just as applying eigenvalues, 391 00:22:22,250 --> 00:22:25,990 the first step is always find eigenvalues. 392 00:22:25,990 --> 00:22:28,440 Here, in applying Fourier, the first step 393 00:22:28,440 --> 00:22:31,380 is always find the coefficients. 394 00:22:31,380 --> 00:22:33,640 So, how do we do that? 395 00:22:33,640 --> 00:22:36,270 And at the beginning it doesn't look too easy, right? 396 00:22:36,270 --> 00:22:40,410 Because let me take the first guy, sin(x). 397 00:22:40,410 --> 00:22:43,390 Let me take an example. 398 00:22:43,390 --> 00:22:46,550 A particular S(x). 399 00:22:46,550 --> 00:22:49,360 The most important, interesting function. 400 00:22:49,360 --> 00:22:52,620 S(x), I want it to be an odd function, 401 00:22:52,620 --> 00:22:55,620 so that it will have only sines. 402 00:22:55,620 --> 00:22:58,500 And it should have period 2pi. 403 00:22:58,500 --> 00:23:01,480 So let me just graph it. 404 00:23:01,480 --> 00:23:06,910 So it's going to have coefficients, 405 00:23:06,910 --> 00:23:14,030 and I use b for sine, so it's going to have b_1*sin(x), 406 00:23:14,030 --> 00:23:18,310 and b_2*sin(2x), and so on. 407 00:23:18,310 --> 00:23:23,830 And so it's got a whole infinity of coefficients. 408 00:23:23,830 --> 00:23:24,330 Right? 409 00:23:24,330 --> 00:23:25,440 We're in function space. 410 00:23:25,440 --> 00:23:27,930 We're not dealing with vectors now. 411 00:23:27,930 --> 00:23:32,480 So how is it possible to find those coefficients? 412 00:23:32,480 --> 00:23:35,840 And let me chose a particular S(x). 413 00:23:35,840 --> 00:23:40,250 So I'll put, since it's 2pi periodic, 414 00:23:40,250 --> 00:23:45,100 if I tell you what it is over a 2pi interval, 415 00:23:45,100 --> 00:23:47,260 just repeat, repeat, repeat. 416 00:23:47,260 --> 00:23:52,300 So I'll pick the 2pi interval to be minus pi to pi here. 417 00:23:52,300 --> 00:23:57,670 Just because it's a nice way, and so that's a 2pi length. 418 00:23:57,670 --> 00:24:02,200 There's zero, I want to function to be odd across zero. 419 00:24:02,200 --> 00:24:04,060 And I want it to be simple, because it's 420 00:24:04,060 --> 00:24:07,240 going to be an important example that I can actually compute. 421 00:24:07,240 --> 00:24:09,480 So I'm going to make it a one. 422 00:24:09,480 --> 00:24:13,640 And a minus one there. 423 00:24:13,640 --> 00:24:15,380 So, a step function. 424 00:24:15,380 --> 00:24:21,030 A step function, a square-- And if I repeat it, of course, 425 00:24:21,030 --> 00:24:25,540 it would go down, up, down, up, so on. 426 00:24:25,540 --> 00:24:30,590 But we only have to look over this part. 427 00:24:30,590 --> 00:24:33,020 OK. 428 00:24:33,020 --> 00:24:37,060 Now, well, you might say wait a minute 429 00:24:37,060 --> 00:24:41,690 how are we going to expand this function in sines. 430 00:24:41,690 --> 00:24:46,010 Well, sines are odd functions. 431 00:24:46,010 --> 00:24:48,260 Everybody knows what odd means? 432 00:24:48,260 --> 00:24:56,000 Odd means that S(-x) is -S(x). 433 00:24:56,000 --> 00:25:01,690 So that's the anti-symmetric that we see in that graph. 434 00:25:01,690 --> 00:25:04,960 We also see a few problems in this graph. 435 00:25:04,960 --> 00:25:11,710 At x=0, what is our sine series going to give us? 436 00:25:11,710 --> 00:25:16,110 If I plug in x=0 on the right-hand side I get zero, 437 00:25:16,110 --> 00:25:16,790 certainly. 438 00:25:16,790 --> 00:25:21,220 So this sine series is going to do that. 439 00:25:21,220 --> 00:25:24,040 And actually Fourier series tend to do this. 440 00:25:24,040 --> 00:25:25,790 In the middle of a jump it'll pick 441 00:25:25,790 --> 00:25:27,130 the middle point of a jump. 442 00:25:27,130 --> 00:25:31,310 Fourier series generally, it's the best possible, 443 00:25:31,310 --> 00:25:33,390 will pick the middle point of the jump. 444 00:25:33,390 --> 00:25:36,540 And what about at x=pi? 445 00:25:36,540 --> 00:25:39,070 At the end of the interval? 446 00:25:39,070 --> 00:25:42,910 What does my series add up at x=pi? 447 00:25:42,910 --> 00:25:47,710 Zero again, because sin(pi), sin(2pi), all zero. 448 00:25:47,710 --> 00:25:49,560 And that'll be in the middle of that jump. 449 00:25:49,560 --> 00:25:52,500 So it's pretty good. 450 00:25:52,500 --> 00:25:56,720 But now what I'm hoping is that my sine series 451 00:25:56,720 --> 00:26:02,520 is going to somehow get real fast up to one, 452 00:26:02,520 --> 00:26:04,100 and level out at one. 453 00:26:04,100 --> 00:26:06,370 We're asking a lot. 454 00:26:06,370 --> 00:26:12,440 In fact, when Fourier proposed this idea, Fourier series, 455 00:26:12,440 --> 00:26:17,400 there was a lot of doubters. 456 00:26:17,400 --> 00:26:23,740 Was it really possible to represent other functions, 457 00:26:23,740 --> 00:26:26,470 maybe even including a step function, 458 00:26:26,470 --> 00:26:31,390 in terms of sines or maybe cosines? 459 00:26:31,390 --> 00:26:33,640 And Fourier said yes, go with it. 460 00:26:33,640 --> 00:26:34,570 So let's do it. 461 00:26:34,570 --> 00:26:42,510 OK, so and he turned out to be incredibly right. 462 00:26:42,510 --> 00:26:44,880 How do I find b_2? 463 00:26:44,880 --> 00:26:48,640 Do you remember how to-- I don't want to know the formula. 464 00:26:48,640 --> 00:26:50,230 I want to know why. 465 00:26:50,230 --> 00:26:56,440 What's the step to find the coefficient b_2? 466 00:26:56,440 --> 00:27:02,400 Well, the step is-- The key point. 467 00:27:02,400 --> 00:27:03,950 Which makes everything possible. 468 00:27:03,950 --> 00:27:07,770 Why don't I identify the key point 469 00:27:07,770 --> 00:27:11,130 without which we would be in real trouble. 470 00:27:11,130 --> 00:27:17,010 The key point is that all these sine functions, 471 00:27:17,010 --> 00:27:22,720 sin(2x), sin(3x), sin(4x), are orthogonal. 472 00:27:22,720 --> 00:27:27,340 Now, what do I mean by two functions being orthogonal? 473 00:27:27,340 --> 00:27:30,440 Somehow my picture in function space, 474 00:27:30,440 --> 00:27:33,695 so my picture in function space is 475 00:27:33,695 --> 00:27:38,030 that here is, this is the sine x coordinate. 476 00:27:38,030 --> 00:27:41,600 And somewhere there's a sin(2x) coordinate and it's 90 degrees 477 00:27:41,600 --> 00:27:44,160 and then there's a sin(3x) coordinate, 478 00:27:44,160 --> 00:27:47,510 and then there's a sine, I don't know where to point now. 479 00:27:47,510 --> 00:27:51,340 But there is a sin(4x), we're in infinite dimensions. 480 00:27:51,340 --> 00:27:56,990 And the sine vectors are an orthogonal basis. 481 00:27:56,990 --> 00:27:58,730 They're orthogonal to each other. 482 00:27:58,730 --> 00:28:00,640 What does that mean? 483 00:28:00,640 --> 00:28:03,800 Vectors, we take the dot product. 484 00:28:03,800 --> 00:28:07,610 Functions, we take, we don't use the word dot product as much 485 00:28:07,610 --> 00:28:09,020 as inner product. 486 00:28:09,020 --> 00:28:12,510 So let me take the inner product of-- The whole point 487 00:28:12,510 --> 00:28:13,460 is orthogonality. 488 00:28:13,460 --> 00:28:15,250 Let me write that word down. 489 00:28:15,250 --> 00:28:17,040 Orthogonal. 490 00:28:17,040 --> 00:28:19,990 The sines are orthogonal. 491 00:28:19,990 --> 00:28:21,450 And what does that mean? 492 00:28:21,450 --> 00:28:27,280 That means that the integral over our 2pi interval, 493 00:28:27,280 --> 00:28:32,320 or any 2pi interval, of one sine, sin(kx), 494 00:28:32,320 --> 00:28:37,810 let's say, multiplied by another sine, sin(lx), 495 00:28:37,810 --> 00:28:42,600 dx is, you can guess the answer. 496 00:28:42,600 --> 00:28:47,880 And everything is depending on this answer. 497 00:28:47,880 --> 00:28:49,610 And it is? 498 00:28:49,610 --> 00:28:51,060 Zero. 499 00:28:51,060 --> 00:28:53,400 It's just terrific. 500 00:28:53,400 --> 00:28:55,840 If k is different from l, of course. 501 00:28:55,840 --> 00:29:00,310 If k is equal to l then I have to figure that one out. 502 00:29:00,310 --> 00:29:01,310 I'll need that one. 503 00:29:01,310 --> 00:29:09,380 What is it if sine, if k=l so I'm integrating sine squared 504 00:29:09,380 --> 00:29:12,770 of kx, then it's certainly not zero. 505 00:29:12,770 --> 00:29:16,600 I getting like, the length squared 506 00:29:16,600 --> 00:29:18,820 of the sin(kx) function. 507 00:29:18,820 --> 00:29:25,100 If k=l, what is it? 508 00:29:25,100 --> 00:29:27,490 It has some nice formula. 509 00:29:27,490 --> 00:29:28,210 Very nice. 510 00:29:28,210 --> 00:29:28,880 Let's see. 511 00:29:28,880 --> 00:29:33,710 Sine squared, do I need to think about sine squared kx? 512 00:29:33,710 --> 00:29:37,150 Sine squared kx, what does it do? 513 00:29:37,150 --> 00:29:39,640 Well, just graph sine squared x. 514 00:29:39,640 --> 00:29:41,370 What would the graph of sine squared x 515 00:29:41,370 --> 00:29:48,020 look like, from minus pi to pi? 516 00:29:48,020 --> 00:29:51,110 So it goes up, right? 517 00:29:51,110 --> 00:29:52,960 Doesn't it go up? 518 00:29:52,960 --> 00:29:54,350 And then it goes back down. 519 00:29:54,350 --> 00:29:55,890 OK. 520 00:29:55,890 --> 00:30:00,270 Sorry, I made that a little hard. 521 00:30:00,270 --> 00:30:03,410 Is that right? 522 00:30:03,410 --> 00:30:05,850 And then it keeps it up. 523 00:30:05,850 --> 00:30:06,350 Right. 524 00:30:06,350 --> 00:30:08,660 So, what's the integral of that? 525 00:30:08,660 --> 00:30:12,020 I'm not seeing quite why. 526 00:30:12,020 --> 00:30:16,410 The answer is its average value is 1/2. 527 00:30:16,410 --> 00:30:23,170 The integral of sine squared is half of the length. 528 00:30:23,170 --> 00:30:28,000 The whole interval is of length 2pi, 529 00:30:28,000 --> 00:30:31,390 and we're taking the area under sine squared. 530 00:30:31,390 --> 00:30:33,540 I may have to come back to it, but the answer 531 00:30:33,540 --> 00:30:36,690 would be half of 2pi, which is pi. 532 00:30:36,690 --> 00:30:37,690 Yeah, yeah. 533 00:30:37,690 --> 00:30:41,830 So you could say the length of the sine function 534 00:30:41,830 --> 00:30:46,000 is square root of pi. 535 00:30:46,000 --> 00:30:48,010 So these are integrals. 536 00:30:48,010 --> 00:30:51,830 You told me the answer was zero. 537 00:30:51,830 --> 00:30:55,610 And I agreed with you, but we haven't computed it. 538 00:30:55,610 --> 00:30:57,900 And nor have we really got that. 539 00:30:57,900 --> 00:31:00,020 So a little bit to fix, still. 540 00:31:00,020 --> 00:31:08,190 But the crucial fact, I mean, those 541 00:31:08,190 --> 00:31:12,920 are highly important integrals that just come out beautifully. 542 00:31:12,920 --> 00:31:16,600 And beautifully really means zero. 543 00:31:16,600 --> 00:31:19,610 I mean, that's the beautiful number, right, for an integral. 544 00:31:19,610 --> 00:31:23,440 OK, so now how do I use that? 545 00:31:23,440 --> 00:31:26,550 Again, I'm looking for b_2. 546 00:31:26,550 --> 00:31:29,950 How do I pick off b_2, using the fact 547 00:31:29,950 --> 00:31:37,370 that sin(2x) times any other sine integrates to zero. 548 00:31:37,370 --> 00:31:38,360 Ready for the moment? 549 00:31:38,360 --> 00:31:40,520 To find the coefficient b_2? 550 00:31:40,520 --> 00:31:44,690 I should, let me start this sentence and if you finish it. 551 00:31:44,690 --> 00:31:51,940 I'll multiply both sides of this equation by sin(2x). 552 00:31:51,940 --> 00:31:56,990 And then I will integrate. 553 00:31:56,990 --> 00:31:59,680 I'll multiply both sides by sin(2x), 554 00:31:59,680 --> 00:32:04,890 so I take S(x) sin(2x). 555 00:32:04,890 --> 00:32:12,350 And on the right hand, I have b_1 sin(x) sin(2x). 556 00:32:12,350 --> 00:32:15,380 And then I have b_2-- Now, here's 557 00:32:15,380 --> 00:32:17,960 the one that's going to live through the integration. 558 00:32:17,960 --> 00:32:22,300 It's going to survive, because it's the sin(2x) times sin(2x), 559 00:32:22,300 --> 00:32:26,290 sin(2x) squared. 560 00:32:26,290 --> 00:32:34,650 And then comes the b_3 guy, would be b_3 sin(3x) sin(2x). 561 00:32:34,650 --> 00:32:37,850 562 00:32:37,850 --> 00:32:40,320 Everybody sees what I'm doing? 563 00:32:40,320 --> 00:32:44,090 As we did with the weak form in differential equations, 564 00:32:44,090 --> 00:32:47,130 I'm multiplying through by these guys. 565 00:32:47,130 --> 00:32:51,560 And then I'm integrating over the interval. 566 00:32:51,560 --> 00:32:55,750 And what do I get? 567 00:32:55,750 --> 00:32:59,170 Integrate everyone dx. 568 00:32:59,170 --> 00:33:02,060 And what's the result? 569 00:33:02,060 --> 00:33:06,760 What is that integral? 570 00:33:06,760 --> 00:33:08,270 Zero. 571 00:33:08,270 --> 00:33:09,530 It's gone. 572 00:33:09,530 --> 00:33:11,280 What is this integral, the integral 573 00:33:11,280 --> 00:33:14,630 of sin(3x) times sin(2x)? 574 00:33:14,630 --> 00:33:15,570 Zero. 575 00:33:15,570 --> 00:33:18,580 All those sines integrate to zero, 576 00:33:18,580 --> 00:33:25,250 and I have to come back and see it's a simple trig identity 577 00:33:25,250 --> 00:33:27,350 to do it. 578 00:33:27,350 --> 00:33:29,140 To see why that's zero. 579 00:33:29,140 --> 00:33:33,770 Do you see that everything is disappearing, except b_2. 580 00:33:33,770 --> 00:33:36,050 So we finally have the formula that we want. 581 00:33:36,050 --> 00:33:42,070 Let me just with put these formulas down. 582 00:33:42,070 --> 00:33:47,680 So b_k, b_2 or b_k, yeah tell me the formula for b_k. 583 00:33:47,680 --> 00:33:50,490 Let me go back, here. 584 00:33:50,490 --> 00:33:53,590 What did b_2 come out to be? 585 00:33:53,590 --> 00:33:56,620 So I have b_2, that's a number. 586 00:33:56,620 --> 00:33:59,230 It's got this right-hand side. 587 00:33:59,230 --> 00:34:01,760 That's the integral that I mentioned. 588 00:34:01,760 --> 00:34:04,230 You'd have to compute that integral. 589 00:34:04,230 --> 00:34:07,750 And then what about this stuff? 590 00:34:07,750 --> 00:34:10,850 This sin(2x) squared? 591 00:34:10,850 --> 00:34:13,160 I've integrated that. 592 00:34:13,160 --> 00:34:16,930 And what did I get for that? 593 00:34:16,930 --> 00:34:20,310 This is b_2, and then this is some number. 594 00:34:20,310 --> 00:34:22,400 And it's pi. 595 00:34:22,400 --> 00:34:26,010 So this is b_2, and multiplying, right? 596 00:34:26,010 --> 00:34:28,750 That b_2 comes out, and then I have 597 00:34:28,750 --> 00:34:32,860 the integral of sine squared 2x, and that's what's pi. 598 00:34:32,860 --> 00:34:37,210 So that's b_2 times pi here, and I just divide by the pi. 599 00:34:37,210 --> 00:34:41,400 So I divide by pi and I get the integral 600 00:34:41,400 --> 00:34:52,440 from minus pi to pi of my function times my sine. 601 00:34:52,440 --> 00:34:58,250 That's the model for all the coefficients 602 00:34:58,250 --> 00:35:02,850 of orthogonal series. 603 00:35:02,850 --> 00:35:04,490 That's the model. 604 00:35:04,490 --> 00:35:11,000 Cosines, the complete ones, the complex coefficients. 605 00:35:11,000 --> 00:35:14,210 The Legendre series, the Bessel series, 606 00:35:14,210 --> 00:35:18,440 everybody's series will follow this same model. 607 00:35:18,440 --> 00:35:23,750 Because all those series are series of orthogonal functions. 608 00:35:23,750 --> 00:35:26,910 Everything is hinging on this orthogonality. 609 00:35:26,910 --> 00:35:31,340 The fact that one term times another gives zero. 610 00:35:31,340 --> 00:35:34,250 What that means, really. 611 00:35:34,250 --> 00:35:41,970 I want to say it with a picture, too. 612 00:35:41,970 --> 00:35:46,540 So let me draw two orthogonal directions. 613 00:35:46,540 --> 00:35:53,700 I intentionally didn't make them just x and y axes. 614 00:35:53,700 --> 00:35:57,350 This might be the direction of sin(x), 615 00:35:57,350 --> 00:36:00,440 and this might be the direction of sin(2x). 616 00:36:00,440 --> 00:36:05,090 And then I have a function. 617 00:36:05,090 --> 00:36:08,060 And I'm trying to find out how much of sin(2x) 618 00:36:08,060 --> 00:36:09,160 has it got in it? 619 00:36:09,160 --> 00:36:11,090 How much of sin(x) has it got in it, 620 00:36:11,090 --> 00:36:15,750 and then of course there's also a sin(3x) and all the other 621 00:36:15,750 --> 00:36:17,550 sin(kx)'s. 622 00:36:17,550 --> 00:36:22,870 The point is, the point of this 90 degree angle 623 00:36:22,870 --> 00:36:34,160 there is, that I can split this S(x), whatever it might be, 624 00:36:34,160 --> 00:36:39,000 I can find its sin(x) piece directly. 625 00:36:39,000 --> 00:36:43,840 By just projecting it, it's the projection 626 00:36:43,840 --> 00:36:48,090 of my function on that coordinate. 627 00:36:48,090 --> 00:36:51,060 If you don't like sin(x), sin(2x), S(x), 628 00:36:51,060 --> 00:36:54,630 write v_1, v_2, whatever. 629 00:36:54,630 --> 00:36:56,180 To think of it as vectors. 630 00:36:56,180 --> 00:37:01,580 What's the sin two-- So that is b_1*sin(x). 631 00:37:01,580 --> 00:37:04,730 That's the right amount of sin(x). 632 00:37:04,730 --> 00:37:12,590 And the whole point is that that calculation didn't involve b_2 633 00:37:12,590 --> 00:37:14,590 and b_3 and all the other b's. 634 00:37:14,590 --> 00:37:19,310 When I'm projecting onto orthogonal directions, 635 00:37:19,310 --> 00:37:22,070 I can do them one at a time. 636 00:37:22,070 --> 00:37:25,920 I can do one one-dimensional projection at a time. 637 00:37:25,920 --> 00:37:35,360 This b_k*sin(kx) is the, so I'm just saying this in words, 638 00:37:35,360 --> 00:37:44,820 is the projection of my function onto sin(kx). 639 00:37:44,820 --> 00:37:49,610 And the point is, I could do this and get 640 00:37:49,610 --> 00:37:52,290 this answer because of that 90 degree angle. 641 00:37:52,290 --> 00:37:54,220 If I didn't have 90 degrees, do you 642 00:37:54,220 --> 00:37:55,890 see that this wouldn't work? 643 00:37:55,890 --> 00:38:02,700 Suppose my two basis functions are at some 40 degree angle. 644 00:38:02,700 --> 00:38:05,150 Then I take my function. 645 00:38:05,150 --> 00:38:08,270 Can I project that onto this guy? 646 00:38:08,270 --> 00:38:13,510 And project that onto this guy, so the projections are there? 647 00:38:13,510 --> 00:38:14,790 And there? 648 00:38:14,790 --> 00:38:20,680 Do they add back to the function that I started with? 649 00:38:20,680 --> 00:38:22,190 The given function? 650 00:38:22,190 --> 00:38:23,310 No way. 651 00:38:23,310 --> 00:38:26,080 I mean, these are much too big, right? 652 00:38:26,080 --> 00:38:30,140 If I add that one to this one I'm way out here somewhere. 653 00:38:30,140 --> 00:38:33,290 But over here, with 90 degrees, these 654 00:38:33,290 --> 00:38:36,950 are the two projections, project there. 655 00:38:36,950 --> 00:38:37,900 Project there. 656 00:38:37,900 --> 00:38:42,260 Add those two pieces and I got back exactly. 657 00:38:42,260 --> 00:38:48,080 I just want to emphasize the importance of orthogonality. 658 00:38:48,080 --> 00:38:52,780 It breaks the problem down into one-dimensional projections. 659 00:38:52,780 --> 00:38:56,020 So here we go with b_k*sin(kx). 660 00:38:56,020 --> 00:38:59,910 OK, let me do the key example now. 661 00:38:59,910 --> 00:39:01,800 This example. 662 00:39:01,800 --> 00:39:08,030 Let me find the coefficients of that particular function S(x). 663 00:39:08,030 --> 00:39:13,140 This is the step function, the square wave, S(x), 664 00:39:13,140 --> 00:39:15,190 let's find its coefficients. 665 00:39:15,190 --> 00:39:17,390 I'll just use this formula. 666 00:39:17,390 --> 00:39:22,190 OK, maybe I'll erase so that I can write the integration 667 00:39:22,190 --> 00:39:23,480 right underneath. 668 00:39:23,480 --> 00:39:24,030 OK. 669 00:39:24,030 --> 00:39:26,650 Oh, one little point here. 670 00:39:26,650 --> 00:39:30,320 Well, not so little, but it's a saving. 671 00:39:30,320 --> 00:39:35,520 It's worth noticing. 672 00:39:35,520 --> 00:39:40,050 The reward for picking off the odd function 673 00:39:40,050 --> 00:39:45,380 is, I think that this integral is the same from minus 674 00:39:45,380 --> 00:39:48,350 pi to zero as zero to pi. 675 00:39:48,350 --> 00:39:51,340 In other words, I think that for an odd function, 676 00:39:51,340 --> 00:39:57,260 I get the same answer if I just do the integral from zero 677 00:39:57,260 --> 00:40:03,280 to pi, that I have to do. 678 00:40:03,280 --> 00:40:05,510 And double it. 679 00:40:05,510 --> 00:40:10,790 So I think if I just double it, I 680 00:40:10,790 --> 00:40:14,820 don't know if you regard that as a saving. 681 00:40:14,820 --> 00:40:18,560 In some way, the work is only half as much. 682 00:40:18,560 --> 00:40:21,080 It'll make this particular example easy, 683 00:40:21,080 --> 00:40:23,560 so let me do this example. 684 00:40:23,560 --> 00:40:26,230 What are the Fourier coefficients 685 00:40:26,230 --> 00:40:29,430 of the square wave? 686 00:40:29,430 --> 00:40:34,730 OK, so I'll do this integral. 687 00:40:34,730 --> 00:40:39,580 So from zero to pi, what is my function? 688 00:40:39,580 --> 00:40:42,710 My N from the graph? 689 00:40:42,710 --> 00:40:44,630 Just one. 690 00:40:44,630 --> 00:40:47,230 This is going to be a picnic, right? 691 00:40:47,230 --> 00:40:50,700 The function is one here. 692 00:40:50,700 --> 00:40:58,960 So S(x) is one, so I want 2/pi, the integral from zero to pi 693 00:40:58,960 --> 00:41:03,240 of just sin(kx) dx, right? 694 00:41:03,240 --> 00:41:09,790 Which is, so I've got 2/pi, now I integrate sin(kx), 695 00:41:09,790 --> 00:41:15,070 I get minus cos(kx), right? 696 00:41:15,070 --> 00:41:18,900 Between zero and pi. 697 00:41:18,900 --> 00:41:20,190 And what else? 698 00:41:20,190 --> 00:41:21,200 What have I forgotten? 699 00:41:21,200 --> 00:41:23,460 The most important point. 700 00:41:23,460 --> 00:41:28,390 The integral of sin(kx) is not minus cos(kx). 701 00:41:28,390 --> 00:41:34,070 I have to divide by k. 702 00:41:34,070 --> 00:41:36,760 It's the division by k that's going to give me 703 00:41:36,760 --> 00:41:41,530 the correct decay rate. 704 00:41:41,530 --> 00:41:42,920 2/(pi*k). 705 00:41:42,920 --> 00:41:45,460 Alright, now I've got a little calculation to do. 706 00:41:45,460 --> 00:41:50,070 I have to figure out what is cos(kx) at zero, no problem, 707 00:41:50,070 --> 00:41:51,310 it's one. 708 00:41:51,310 --> 00:41:55,840 And at the other point, at x=pi. 709 00:41:55,840 --> 00:41:57,060 So what am I getting, then? 710 00:41:57,060 --> 00:42:01,620 I'm getting 2/pi-- no, 2/(pi*k). 711 00:42:01,620 --> 00:42:09,860 712 00:42:09,860 --> 00:42:13,200 With that minus sign, I'll evaluate it at x=0, 713 00:42:13,200 --> 00:42:18,550 I have one minus whatever I get at the top. 714 00:42:18,550 --> 00:42:21,440 cos(k*pi). 715 00:42:21,440 --> 00:42:22,090 That's b_k. 716 00:42:22,090 --> 00:42:24,820 717 00:42:24,820 --> 00:42:32,970 So there's a typical, well not typical but very nice, answer. 718 00:42:32,970 --> 00:42:35,350 Now let's see what these numbers are. 719 00:42:35,350 --> 00:42:39,930 So let me take a 2/pi out here. 720 00:42:39,930 --> 00:42:44,060 And then just list these numbers. 721 00:42:44,060 --> 00:42:47,090 So k is one, two, three, four, five, right? 722 00:42:47,090 --> 00:42:50,450 Tell me what these numbers are for-- Let me 723 00:42:50,450 --> 00:42:55,490 put the k in here because that's part of it. 724 00:42:55,490 --> 00:42:59,520 So it's a constant, 2/pi. 725 00:42:59,520 --> 00:43:03,200 At k=1, what do I get? 726 00:43:03,200 --> 00:43:04,850 At k=1? 727 00:43:04,850 --> 00:43:09,970 This is the little bit that needs the patience. 728 00:43:09,970 --> 00:43:15,190 At k=1, the cosine of pi is? 729 00:43:15,190 --> 00:43:16,850 Negative one. 730 00:43:16,850 --> 00:43:20,270 So I have net minus minus one, I get a two. 731 00:43:20,270 --> 00:43:25,590 I get a two over a one. k is one. 732 00:43:25,590 --> 00:43:30,740 Alright, that is the coefficient for k=1. 733 00:43:30,740 --> 00:43:33,980 Now, what's b_2, the coefficient for k=2? 734 00:43:33,980 --> 00:43:39,140 I have 1-cos(2pi), what's cos(2pi)? 735 00:43:39,140 --> 00:43:40,060 One. 736 00:43:40,060 --> 00:43:43,060 So they cancel, so I get a zero. 737 00:43:43,060 --> 00:43:45,210 There is no b_2. 738 00:43:45,210 --> 00:43:47,130 What about b_3? 739 00:43:47,130 --> 00:43:51,870 So now b_3, I have 1-cos(3pi). 740 00:43:51,870 --> 00:43:54,780 What's the cosine of 3pi? 741 00:43:54,780 --> 00:43:56,490 It's negative one again. 742 00:43:56,490 --> 00:43:58,680 Right, same as the cosine of pi. 743 00:43:58,680 --> 00:44:02,300 So that gives me a two, and now I'm dividing by three. 744 00:44:02,300 --> 00:44:03,670 2/3. 745 00:44:03,670 --> 00:44:08,400 Alright, let's do two more. k=4, what do I get? 746 00:44:08,400 --> 00:44:12,570 Zero, because the cosine of 4pi has come back to one. 747 00:44:12,570 --> 00:44:13,780 So I get a zero. 748 00:44:13,780 --> 00:44:15,520 And what do I get from k=5? 749 00:44:15,520 --> 00:44:18,280 750 00:44:18,280 --> 00:44:26,190 1-cos(5pi), which is? cos(5pi) is back to negative one, 751 00:44:26,190 --> 00:44:29,170 so one minus negative one is a two. 752 00:44:29,170 --> 00:44:31,610 You see the pattern. 753 00:44:31,610 --> 00:44:40,930 And so let me just copy the famous series for this S(x). 754 00:44:40,930 --> 00:44:44,910 This S(x) is, let's see. 755 00:44:44,910 --> 00:44:48,100 The twos, I'll make that 4/pi, right? 756 00:44:48,100 --> 00:44:50,090 I'll take out all those twos. 757 00:44:50,090 --> 00:44:58,640 So I have 4/pi 1-cos(5pi), I have no sin(2x), forget that. 758 00:44:58,640 --> 00:45:02,750 Now I do have some sin(3x)'s, how much do I have? 759 00:45:02,750 --> 00:45:04,930 4/pi sin(3x)'s. 760 00:45:04,930 --> 00:45:09,170 761 00:45:09,170 --> 00:45:12,110 But divide by three, right? 762 00:45:12,110 --> 00:45:16,000 And then there's no 4x's, no sin(4x)'s. 763 00:45:16,000 --> 00:45:22,030 But then there will be a 4/pi sine, what's the next term now? 764 00:45:22,030 --> 00:45:23,360 Are you with me? 765 00:45:23,360 --> 00:45:27,450 So this is a typical nice example, an important example. 766 00:45:27,450 --> 00:45:29,750 Sine of what? 767 00:45:29,750 --> 00:45:33,960 5x, divided by five. 768 00:45:33,960 --> 00:45:35,120 OK. 769 00:45:35,120 --> 00:45:37,850 That's a great example, it's worth remembering. 770 00:45:37,850 --> 00:45:40,490 Factor the 4/pi out if you want to. 771 00:45:40,490 --> 00:45:46,110 4/pi times sin(x), sine(3x)/3, sin(5x)/5, 772 00:45:46,110 --> 00:45:49,790 it's a beautiful example of an odd function. 773 00:45:49,790 --> 00:45:53,820 OK, and let's see. 774 00:45:53,820 --> 00:46:00,930 So what do you think, MATLAB can draw this graph 775 00:46:00,930 --> 00:46:02,640 far better than we can. 776 00:46:02,640 --> 00:46:06,170 But let me draw enough so you see 777 00:46:06,170 --> 00:46:09,790 what's really interesting here. 778 00:46:09,790 --> 00:46:12,290 Interesting and famous. 779 00:46:12,290 --> 00:46:15,810 So the leading term is 4/pi sin(x), that 780 00:46:15,810 --> 00:46:18,250 would be something like that. 781 00:46:18,250 --> 00:46:20,860 That's as close as sin(x) can get, 782 00:46:20,860 --> 00:46:23,320 4/pi is the optimal number. 783 00:46:23,320 --> 00:46:24,980 The optimal coefficient. 784 00:46:24,980 --> 00:46:26,230 The projection. 785 00:46:26,230 --> 00:46:32,150 This 4/pi*sin(x) is the best, the closest I can get to one. 786 00:46:32,150 --> 00:46:34,760 On that interval. 787 00:46:34,760 --> 00:46:36,010 With just sin(x). 788 00:46:36,010 --> 00:46:38,950 But now when I put in sin(3x), I think 789 00:46:38,950 --> 00:46:44,440 it'll do something more like this. 790 00:46:44,440 --> 00:46:46,860 Do you see what's happening there? 791 00:46:46,860 --> 00:46:49,130 That's what I've got with sin(3x), and of course 792 00:46:49,130 --> 00:46:50,670 odd on the other side. 793 00:46:50,670 --> 00:46:54,790 What do you think it looks like with sin(5x)? 794 00:46:54,790 --> 00:46:59,540 It's just so great you have to let the computer draw 795 00:46:59,540 --> 00:47:00,720 it a couple of times. 796 00:47:00,720 --> 00:47:04,310 You see, it goes up here. 797 00:47:04,310 --> 00:47:08,000 And then it's sort of, you know, it's getting closer. 798 00:47:08,000 --> 00:47:13,460 It's going to stay closer to that. 799 00:47:13,460 --> 00:47:16,420 But I don't know if you can see from my picture, 800 00:47:16,420 --> 00:47:19,730 I'm actually proud of that picture. 801 00:47:19,730 --> 00:47:22,100 It's not as bad as usual. 802 00:47:22,100 --> 00:47:27,190 And it makes the crucial point, two crucial points. 803 00:47:27,190 --> 00:47:31,090 One is, I am going to get closer and closer to one. 804 00:47:31,090 --> 00:47:38,510 These oscillations, these ripples, will be smaller. 805 00:47:38,510 --> 00:47:41,300 But here is the great fact and it's 806 00:47:41,300 --> 00:47:45,040 a big headache in calculation. 807 00:47:45,040 --> 00:47:51,950 At the jump, the first ripple doesn't get smaller. 808 00:47:51,950 --> 00:47:57,150 The first ripple gets thinner, the first ripple gets thinner. 809 00:47:57,150 --> 00:47:59,340 You see the ripples moving over there, 810 00:47:59,340 --> 00:48:01,950 but their height doesn't change. 811 00:48:01,950 --> 00:48:04,200 Do you know whose name is associated with that, 812 00:48:04,200 --> 00:48:06,980 in that phenomenon? 813 00:48:06,980 --> 00:48:07,900 Gibbs. 814 00:48:07,900 --> 00:48:14,950 Gibbs noticed that the ripple height as you 815 00:48:14,950 --> 00:48:18,030 add more and more terms, you're closer and closer 816 00:48:18,030 --> 00:48:23,430 to the function over more and more of the interval. 817 00:48:23,430 --> 00:48:25,950 So the ripples get squeezed to the left. 818 00:48:25,950 --> 00:48:29,560 The area under the ripples goes to zero, certainly. 819 00:48:29,560 --> 00:48:32,450 But the height of the ripples doesn't. 820 00:48:32,450 --> 00:48:36,015 And it doesn't stay constant, but nearly constant. 821 00:48:36,015 --> 00:48:39,560 It approaches a famous number. 822 00:48:39,560 --> 00:48:43,980 And of course we'll have the same odd picture down here. 823 00:48:43,980 --> 00:48:47,400 And it'll bump up again, the same thing 824 00:48:47,400 --> 00:48:49,810 is happening at every jump. 825 00:48:49,810 --> 00:48:52,200 In other words, if you're computing shock. 826 00:48:52,200 --> 00:48:54,950 If you're computing air flow around shocks, 827 00:48:54,950 --> 00:49:00,190 with Fourier-type methods, Gibbs is going to get you. 828 00:49:00,190 --> 00:49:02,300 You'll have to deal with Gibbs. 829 00:49:02,300 --> 00:49:09,060 Because the shock has that extra ripple. 830 00:49:09,060 --> 00:49:12,980 OK, that's a lot of Section 4.1. 831 00:49:12,980 --> 00:49:15,010 Energy, we didn't get to, so that'll 832 00:49:15,010 --> 00:49:17,440 be the first point on Friday. 833 00:49:17,440 --> 00:49:20,430 And I'll see you this afternoon and talk about the MATLAB 834 00:49:20,430 --> 00:49:21,610 or anything else. 835 00:49:21,610 --> 00:49:22,860 OK.