1 00:00:01,240 --> 00:00:05,800 This video is to give you more examples of Fourier series. 2 00:00:05,800 --> 00:00:08,510 I'll start with a function that's odd. 3 00:00:08,510 --> 00:00:14,080 My odd function means that on the left side of 0, 4 00:00:14,080 --> 00:00:19,410 I get the negative of what I have on the right side of 0. 5 00:00:19,410 --> 00:00:22,900 F at minus x is minus f of x. 6 00:00:22,900 --> 00:00:26,610 And it's the sine function that's odd. 7 00:00:26,610 --> 00:00:31,140 The cosine function is even, and we will have no cosines here. 8 00:00:31,140 --> 00:00:33,250 All the integrals that involve cosines 9 00:00:33,250 --> 00:00:38,260 will tell us 0 for the coefficients AN. 10 00:00:38,260 --> 00:00:41,200 What we'll get is the B coefficients, 11 00:00:41,200 --> 00:00:44,340 the sine functions. 12 00:00:44,340 --> 00:00:49,930 So you see that I chose a simple odd function, minus 1 or 1, 13 00:00:49,930 --> 00:00:55,000 which would give a square wave if I continue it on. 14 00:00:55,000 --> 00:01:00,710 It will go down, up, down, up in a square wave pattern. 15 00:01:00,710 --> 00:01:04,530 And I'm going to express that as a combination 16 00:01:04,530 --> 00:01:07,810 of sine functions, smooth waves. 17 00:01:07,810 --> 00:01:10,460 And here was the formula from last time 18 00:01:10,460 --> 00:01:14,780 for the coefficients bk, except now I'm 19 00:01:14,780 --> 00:01:18,890 only integrating over half, over the zero 20 00:01:18,890 --> 00:01:22,920 to pi part of the interval, so I double it. 21 00:01:26,180 --> 00:01:29,550 So that's an odd function, that's an odd function. 22 00:01:29,550 --> 00:01:32,330 When I multiply them, I have an even function. 23 00:01:32,330 --> 00:01:35,180 And the integral from minus pi to 0 24 00:01:35,180 --> 00:01:38,260 is just the same as the integral from 0 to pi. 25 00:01:38,260 --> 00:01:44,000 So I'll do only 0 to pi and multiply by 2. 26 00:01:44,000 --> 00:01:49,560 But my function on 0 to pi is 1. 27 00:01:49,560 --> 00:01:53,910 My nice square wave is just plus 1 there, 28 00:01:53,910 --> 00:01:56,400 so I'm just integrating sine kx dx. 29 00:01:56,400 --> 00:01:59,200 We can do this. 30 00:01:59,200 --> 00:02:02,610 It's minus cosine kx divided by k, right? 31 00:02:02,610 --> 00:02:05,750 That's the integral with the 2 over pi factor. 32 00:02:05,750 --> 00:02:13,660 Now I have to put in pi and 0 and put 33 00:02:13,660 --> 00:02:16,890 in the limits of integration and get the answer. 34 00:02:16,890 --> 00:02:18,460 So what do I get? 35 00:02:18,460 --> 00:02:19,670 I get 2 over pi. 36 00:02:26,610 --> 00:02:33,450 For k equal 1, I think I get-- so k is 1, 37 00:02:33,450 --> 00:02:38,620 the denominator will be 1, and I think the numerator is 2. 38 00:02:38,620 --> 00:02:42,740 Yes, when k is 0, I get yeah. 39 00:02:42,740 --> 00:02:45,380 When k is 1, I get 2. 40 00:02:45,380 --> 00:02:49,960 When k is 2, so this is 4 over pi, 41 00:02:49,960 --> 00:02:52,900 I figured out as the first coefficient. 42 00:02:52,900 --> 00:02:56,960 The coefficient b1 is 4 over pi. 43 00:02:56,960 --> 00:03:02,220 The coefficient b2, now if I take k equal to 2, I have a 2 44 00:03:02,220 --> 00:03:03,520 down below. 45 00:03:03,520 --> 00:03:09,380 But above, I have a 0 because the cosine of 2 pi 46 00:03:09,380 --> 00:03:12,810 is the same as the cosine of 0. 47 00:03:12,810 --> 00:03:17,370 When I subtract I get nothing, so that's 0. 48 00:03:17,370 --> 00:03:20,420 Now I go to k equals 3. 49 00:03:20,420 --> 00:03:23,790 So the k equals 3 will come down here. 50 00:03:23,790 --> 00:03:30,000 And now when k is 3, it turns out I get-- they don't cancel, 51 00:03:30,000 --> 00:03:31,140 they reinforce. 52 00:03:31,140 --> 00:03:32,870 I get another 2. 53 00:03:32,870 --> 00:03:34,400 Good if you do these. 54 00:03:34,400 --> 00:03:37,220 And when k is 4, I get a 0 again. 55 00:03:37,220 --> 00:03:38,210 You see the pattern? 56 00:03:42,380 --> 00:03:50,030 The pattern for the integrals is the k is going 1, 2, 3, 4, 5. 57 00:03:50,030 --> 00:03:54,900 This part gives me a 2 or a 0 or a 2 or a 0 in order. 58 00:03:54,900 --> 00:03:57,530 If you check that, you'll get it. 59 00:03:57,530 --> 00:04:02,220 So I see that now for this function, which is better 60 00:04:02,220 --> 00:04:03,830 than the delta function also. 61 00:04:03,830 --> 00:04:05,600 It's not very smooth. 62 00:04:05,600 --> 00:04:07,000 It has jumps. 63 00:04:07,000 --> 00:04:10,110 It's a jump function, a step function. 64 00:04:10,110 --> 00:04:14,319 I see some decay, some slow decay, 65 00:04:14,319 --> 00:04:15,485 in the Fourier coefficients. 66 00:04:18,959 --> 00:04:24,540 This factor k is growing so the numbers are going to 0, 67 00:04:24,540 --> 00:04:26,110 but not very fast. 68 00:04:26,110 --> 00:04:27,460 Not very fast. 69 00:04:27,460 --> 00:04:31,580 Because my function is not very smooth. 70 00:04:31,580 --> 00:04:37,520 So now you see-- so if I use those numbers, 71 00:04:37,520 --> 00:04:45,360 I'm saying that the square wave, this function, the minus 1 to 1 72 00:04:45,360 --> 00:04:49,950 function, is equal to, let's see. 73 00:04:49,950 --> 00:04:57,000 I might as well take that 4 over pi times 1. 74 00:04:57,000 --> 00:05:08,890 So that's 1 sine x, 0, sine 2x's then 4 over pi sine 3x's, but 75 00:05:08,890 --> 00:05:14,750 with this guy there's a 3, 0 sine 4x's, 76 00:05:14,750 --> 00:05:23,840 sine 5x comes in over 5, and so on. 77 00:05:23,840 --> 00:05:26,480 That's a kind of nice example. 78 00:05:26,480 --> 00:05:31,930 It turns out that we have just the odd frequencies 1, 3, 79 00:05:31,930 --> 00:05:38,380 5 in the square wave and they're multiplied by 4 over pi 80 00:05:38,380 --> 00:05:43,230 and they're divided by the frequency, so that's the decay. 81 00:05:43,230 --> 00:05:46,020 There is an odd function. 82 00:05:46,020 --> 00:05:49,180 Why don't I integrate that function? 83 00:05:49,180 --> 00:05:51,140 If I want to get an even function 84 00:05:51,140 --> 00:05:53,740 to show you an even example, I'll just 85 00:05:53,740 --> 00:05:55,910 integrate that square wave. 86 00:05:55,910 --> 00:05:58,840 When I integrate it square wave, it'll be even. 87 00:05:58,840 --> 00:06:03,025 Maybe I'll start the integral at 0, then it goes up at 1. 88 00:06:05,960 --> 00:06:12,300 And here the integral is negative, so it's coming down. 89 00:06:12,300 --> 00:06:20,910 So you see it's a-- what am I going to call this function? 90 00:06:20,910 --> 00:06:23,990 Sort of a repeating ramp function. 91 00:06:23,990 --> 00:06:27,410 It's a ramp down and then up, down and then up. 92 00:06:27,410 --> 00:06:31,770 But of course from minus pi to pi, that's where I'm looking. 93 00:06:31,770 --> 00:06:35,360 I'm looking between minus pi and pi. 94 00:06:35,360 --> 00:06:39,770 And I see that function is even. 95 00:06:39,770 --> 00:06:41,320 And what does even mean? 96 00:06:41,320 --> 00:06:45,780 That means that my function at minus-- 97 00:06:45,780 --> 00:06:48,745 there is minus x-- is the same as the value at x. 98 00:06:51,920 --> 00:06:56,420 And what that means for a Fourier series is cosine. 99 00:06:56,420 --> 00:06:59,370 Even functions only have cosine terms. 100 00:06:59,370 --> 00:07:01,940 And of course, since I've just integrated, 101 00:07:01,940 --> 00:07:04,570 I might as well just integrate that series. 102 00:07:04,570 --> 00:07:09,340 So this is this ramp, this repeating ramp function, 103 00:07:09,340 --> 00:07:13,150 is going to be 4 over pi. 104 00:07:13,150 --> 00:07:15,760 I could figure out the cosine coefficients, 105 00:07:15,760 --> 00:07:18,700 the a's, patiently. 106 00:07:18,700 --> 00:07:21,530 But why should I do that when I can just integrate? 107 00:07:24,890 --> 00:07:28,260 So the integral of sine x will be minus 108 00:07:28,260 --> 00:07:31,590 is the integral of sine x, is minus cosine 109 00:07:31,590 --> 00:07:38,590 x, so I'll put the minus there, cosine x over 1 I guess. 110 00:07:38,590 --> 00:07:40,130 Now what's the integral of this? 111 00:07:40,130 --> 00:07:46,510 The integral of sine 3x is a cosine 3x over 3. 112 00:07:46,510 --> 00:07:48,750 And there's another 3 and there's 113 00:07:48,750 --> 00:07:51,560 a minus sign, which I've got. 114 00:07:51,560 --> 00:07:57,540 So I think it's cosine of 3x over 3 squared, 115 00:07:57,540 --> 00:08:00,580 because I have one 3 there and I get another 3 116 00:08:00,580 --> 00:08:01,810 from the integration. 117 00:08:01,810 --> 00:08:05,540 And similarly here, when I integrate sine 5x 118 00:08:05,540 --> 00:08:09,930 I get cos 5x with a 5. 119 00:08:09,930 --> 00:08:13,570 And then I already had one 5, so 5 squared. 120 00:08:13,570 --> 00:08:16,260 So there you go. 121 00:08:16,260 --> 00:08:17,700 [LAUGHTER] 122 00:08:17,700 --> 00:08:20,330 There's something in freshman calculus which I totally 123 00:08:20,330 --> 00:08:22,930 forgot, the constant term. 124 00:08:22,930 --> 00:08:27,000 So there is a constant term, the average value, that a0. 125 00:08:27,000 --> 00:08:30,570 I've only found the a1, 2, 3, 4, 5. 126 00:08:30,570 --> 00:08:35,110 I haven't found the a0, and that would be the average of that. 127 00:08:35,110 --> 00:08:38,070 I don't know, what's the average of this function? 128 00:08:38,070 --> 00:08:40,919 Its goes from 0 up to pi and it seems 129 00:08:40,919 --> 00:08:45,410 like it's pretty-- I didn't draw it well, but half way. 130 00:08:45,410 --> 00:08:51,060 I think probably its average is about pi over 2, right? 131 00:08:51,060 --> 00:08:52,940 Let's hope that's right. 132 00:08:52,940 --> 00:08:56,240 So let me sneak in the constant term here. 133 00:08:56,240 --> 00:09:02,710 The ramp is, I think I have a constant term is pi over 2. 134 00:09:02,710 --> 00:09:04,120 That's the average value. 135 00:09:04,120 --> 00:09:07,550 It would come from the formula and those-- well, 136 00:09:07,550 --> 00:09:09,870 what do you see now? 137 00:09:09,870 --> 00:09:12,660 That's the other example I wanted you to see. 138 00:09:12,660 --> 00:09:15,180 You see a faster drop off. 139 00:09:15,180 --> 00:09:20,630 1, 9, 25, 49, whatever. 140 00:09:20,630 --> 00:09:24,820 It's dropping off with k squared. 141 00:09:24,820 --> 00:09:28,930 And the reason it drops off faster than this one 142 00:09:28,930 --> 00:09:32,820 is that it's smoother. 143 00:09:32,820 --> 00:09:35,210 This function has corners. 144 00:09:35,210 --> 00:09:37,890 This function has jumps. 145 00:09:37,890 --> 00:09:43,650 So a jump is one level more rough, more word 146 00:09:43,650 --> 00:09:47,340 noisy than a ramp function. 147 00:09:47,340 --> 00:09:50,670 The smoother function has faster decay. 148 00:09:50,670 --> 00:09:53,060 Smooth-- let me write those words-- 149 00:09:53,060 --> 00:10:04,680 smooth function connects with faster decay. 150 00:10:04,680 --> 00:10:08,160 Faster drop off of the Fourier coefficient. 151 00:10:08,160 --> 00:10:11,100 It means that the Fourier series is much more useful. 152 00:10:11,100 --> 00:10:14,900 Fourier series is really terrific for functions 153 00:10:14,900 --> 00:10:20,760 that are smooth because then you only need to keep a few terms. 154 00:10:20,760 --> 00:10:26,550 For functions that have jumps or delta functions, 155 00:10:26,550 --> 00:10:28,880 you have to keep many, many terms 156 00:10:28,880 --> 00:10:31,380 and the Fourier series calculation 157 00:10:31,380 --> 00:10:33,620 is much more difficult. 158 00:10:33,620 --> 00:10:38,530 So that's the second example. 159 00:10:38,530 --> 00:10:42,660 Let's see, what more shall I say? 160 00:10:42,660 --> 00:10:44,940 We learned something about integrating 161 00:10:44,940 --> 00:10:47,010 and taking the derivative so let me 162 00:10:47,010 --> 00:10:49,950 end with just two basic rules. 163 00:10:49,950 --> 00:10:53,340 Two basic rules. 164 00:10:53,340 --> 00:10:57,940 So the rule for derivatives. 165 00:11:02,460 --> 00:11:05,380 What's the Fourier series of df dx? 166 00:11:09,180 --> 00:11:13,005 And the second will be the rule for shift. 167 00:11:16,650 --> 00:11:23,130 What's the Fourier series for f of x minus a shift? 168 00:11:23,130 --> 00:11:26,940 You know that when I change x to x minus d, all that does 169 00:11:26,940 --> 00:11:30,550 is shift the graph by a distance d. 170 00:11:30,550 --> 00:11:34,250 That should do something nice to its Fourier coefficient. 171 00:11:34,250 --> 00:11:37,230 So I'm starting with-- oh, I haven't given you 172 00:11:37,230 --> 00:11:40,140 any practice with a complex case. 173 00:11:40,140 --> 00:11:41,690 This would be a good time. 174 00:11:41,690 --> 00:11:52,390 Suppose start is f of x equals the sum of ck, 175 00:11:52,390 --> 00:11:58,140 a complex coefficient e to the ikx, the complex exponential. 176 00:11:58,140 --> 00:12:01,860 And you'll remember that sum went from minus infinity 177 00:12:01,860 --> 00:12:02,360 to infinity. 178 00:12:06,330 --> 00:12:08,260 So I have a Fourier series. 179 00:12:08,260 --> 00:12:12,510 I'm imagining I know the coefficients and I want to say, 180 00:12:12,510 --> 00:12:14,490 what happens if I take the derivative? 181 00:12:14,490 --> 00:12:16,740 Well, just take the derivative. 182 00:12:16,740 --> 00:12:26,640 You'll have a sum of the derivative brings down 183 00:12:26,640 --> 00:12:30,000 a factor ik. 184 00:12:30,000 --> 00:12:31,860 So that's the rule. 185 00:12:31,860 --> 00:12:33,500 Simple, but important. 186 00:12:33,500 --> 00:12:37,390 That's why Fourier series is so great because you 187 00:12:37,390 --> 00:12:40,450 have orthogonality and then you have this simple rule 188 00:12:40,450 --> 00:12:43,340 with derivatives. 189 00:12:43,340 --> 00:12:46,910 it just brings a factor ik so the derivative 190 00:12:46,910 --> 00:12:52,890 make sure function noisier and you have larger coefficients. 191 00:12:52,890 --> 00:12:55,730 And if I do f of x minus d, so I'll 192 00:12:55,730 --> 00:13:04,120 change x to x minus d, so I'll see the sum of ck e to the ikx, 193 00:13:04,120 --> 00:13:08,950 e to the minus ikd, right? 194 00:13:08,950 --> 00:13:13,290 I've put in x minus d instead of x. 195 00:13:13,290 --> 00:13:17,690 And here I see that the Fourier coefficient for a shifted 196 00:13:17,690 --> 00:13:23,636 function-- so the ck was a Fourier coefficient for f. 197 00:13:23,636 --> 00:13:28,070 When I shift f, it multiplies that coefficient 198 00:13:28,070 --> 00:13:31,650 by a phase change. 199 00:13:31,650 --> 00:13:34,310 The magnitude stayed the same because that's 200 00:13:34,310 --> 00:13:39,730 a number-- everybody recognizes that as a number of magnitude 1 201 00:13:39,730 --> 00:13:43,700 and just has a phase shift. 202 00:13:43,700 --> 00:13:46,050 Those are two would rules that show 203 00:13:46,050 --> 00:13:51,220 why you can use Fourier series in differential equations 204 00:13:51,220 --> 00:13:54,400 and in difference equations. 205 00:13:54,400 --> 00:13:56,120 Thank you.