1 00:00:04,392 --> 00:00:06,070 PROFESSOR: Hi, everyone. 2 00:00:06,070 --> 00:00:07,560 Welcome back. 3 00:00:07,560 --> 00:00:11,100 So today we'd like to tackle a problem in Fourier series. 4 00:00:11,100 --> 00:00:13,610 And specifically, we're just going to compute the Fourier 5 00:00:13,610 --> 00:00:16,510 series for a simple function. 6 00:00:16,510 --> 00:00:20,670 So the function we're interested in is f of t, which we're told 7 00:00:20,670 --> 00:00:27,290 is periodic with period 2pi-- f of t is 1 from minus pi to 0, 8 00:00:27,290 --> 00:00:32,880 and then it's minus 1 from 0 to pi. 9 00:00:32,880 --> 00:00:36,160 So first off, we're interested in sketching f of t. 10 00:00:36,160 --> 00:00:40,890 Secondly, we'd like to compute the Fourier series for f of t. 11 00:00:40,890 --> 00:00:43,980 And then thirdly, we'd like to sketch the first non-zero term 12 00:00:43,980 --> 00:00:45,640 of the Fourier series. 13 00:00:45,640 --> 00:00:50,590 And we can specifically sketch this single term 14 00:00:50,590 --> 00:00:53,299 on top of f of t. 15 00:00:53,299 --> 00:00:55,340 So I'll let you think about this problem for now, 16 00:00:55,340 --> 00:00:56,548 and I'll be back in a moment. 17 00:01:08,690 --> 00:01:09,900 Hi, everyone. 18 00:01:09,900 --> 00:01:11,632 Welcome back. 19 00:01:11,632 --> 00:01:13,340 So let's take a look at sketching f of t. 20 00:01:23,140 --> 00:01:28,560 So for part a, we have our axes, t. 21 00:01:28,560 --> 00:01:32,500 And we're told f of t within some interval. 22 00:01:32,500 --> 00:01:36,280 So we might as well plot f of t on that interval. 23 00:01:36,280 --> 00:01:42,910 So minus pi, pi and 0, we know that f of t 24 00:01:42,910 --> 00:01:49,820 is 1 from minus pi to 0. 25 00:01:49,820 --> 00:01:54,080 We're also told that it's minus 1 from 0 to pi. 26 00:01:59,110 --> 00:02:03,780 And now to fill in the blanks or to complete the picture of f, 27 00:02:03,780 --> 00:02:06,125 we're told that it has a period of 2pi. 28 00:02:06,125 --> 00:02:07,500 So note that they've told us what 29 00:02:07,500 --> 00:02:11,020 f looks like over the range of minus pi 30 00:02:11,020 --> 00:02:13,560 to pi, which is the length of 2pi. 31 00:02:13,560 --> 00:02:16,110 So basically what we can do is we can use this as a stamp 32 00:02:16,110 --> 00:02:18,160 and just pick up this entire picture, 33 00:02:18,160 --> 00:02:22,040 shift it over one period 2pi, and just 34 00:02:22,040 --> 00:02:26,690 thinking of this picture in stamping it in multiple places. 35 00:02:26,690 --> 00:02:37,150 So just filling this in it's going 36 00:02:37,150 --> 00:02:46,530 to look like a square wave, which jumps between minus 1 37 00:02:46,530 --> 00:02:50,640 and 1 at every multiple of pi. 38 00:02:50,640 --> 00:02:52,890 So this concludes part a. 39 00:02:52,890 --> 00:02:56,780 For part b, which is the real meat of the problem, 40 00:02:56,780 --> 00:03:01,010 we're interested in computing a Fourier series for f of t. 41 00:03:01,010 --> 00:03:02,950 Now, we can always write down a Fourier series 42 00:03:02,950 --> 00:03:05,530 for any periodic function. 43 00:03:05,530 --> 00:03:10,890 And specifically in this case, for part b, 44 00:03:10,890 --> 00:03:14,810 the periodic function we're interested in has period 2pi. 45 00:03:14,810 --> 00:03:20,240 So for the class notes, we've identified 46 00:03:20,240 --> 00:03:22,230 L with half the period. 47 00:03:22,230 --> 00:03:25,360 So in this case, L is 2pi divided 48 00:03:25,360 --> 00:03:30,190 by 2, which gives us pi. 49 00:03:30,190 --> 00:03:33,200 And just to recall what a Fourier series is, what we do 50 00:03:33,200 --> 00:03:37,100 is we try and take our function f of t 51 00:03:37,100 --> 00:03:41,730 and write it down as a summation of sines and cosines. 52 00:03:41,730 --> 00:03:45,565 So in this case for function f of t, which is 2pi periodic, 53 00:03:45,565 --> 00:03:47,190 it's going to look something like this. 54 00:03:47,190 --> 00:03:54,155 It's going to a of 0 plus sum from n equals 1-- 55 00:03:54,155 --> 00:03:56,430 and there's going to be infinitely many terms, 56 00:03:56,430 --> 00:04:03,130 but in this case we have a of n times cosine of n*t. 57 00:04:03,130 --> 00:04:07,280 And it's n*t here because we have period 2pi. 58 00:04:07,280 --> 00:04:10,635 Plus b_n sine n_t. 59 00:04:13,440 --> 00:04:16,589 So this is the general form. 60 00:04:16,589 --> 00:04:20,269 And when asked to compute the Fourier series of a function, 61 00:04:20,269 --> 00:04:23,240 the main difficulty is to compute these coefficients a_n 62 00:04:23,240 --> 00:04:25,320 and b_n. 63 00:04:25,320 --> 00:04:27,400 However, that essentially boils down 64 00:04:27,400 --> 00:04:28,740 to working out some integrals. 65 00:04:34,790 --> 00:04:37,120 So let's take a look at what a of 0 is. 66 00:04:40,140 --> 00:04:45,380 So the formula for a_0 is 1 over 2L-- so in this case, 67 00:04:45,380 --> 00:04:49,310 it's 1 over 2pi-- times the integral 68 00:04:49,310 --> 00:04:52,785 over 1 period of the function, from minus pi to pi, 69 00:04:52,785 --> 00:04:53,410 of just f of t. 70 00:04:56,600 --> 00:05:00,100 So notice how a_0 is just the average of the function. 71 00:05:00,100 --> 00:05:03,400 So if we take a look at the function f of t, f of t 72 00:05:03,400 --> 00:05:07,370 spends exactly half of its time at 1 and half of its time 73 00:05:07,370 --> 00:05:08,570 at minus 1. 74 00:05:08,570 --> 00:05:11,730 So immediately we could guess that the average value 75 00:05:11,730 --> 00:05:13,170 of f of t is going to be 0. 76 00:05:16,730 --> 00:05:21,310 If you wanted to work it out specifically, 77 00:05:21,310 --> 00:05:27,700 we would have 1 over 2pi minus pi to 0, f of t 78 00:05:27,700 --> 00:05:29,180 takes on the value of plus 1. 79 00:05:32,340 --> 00:05:37,900 And then from 0 to pi, f of t takes on the value of minus 1. 80 00:05:40,460 --> 00:05:44,380 So we would end up getting pi minus pi, which is 0. 81 00:05:49,160 --> 00:05:56,810 For a_n, the formula is 1 over half the period. 82 00:05:56,810 --> 00:06:00,320 So note how a of 0 is just a special case. 83 00:06:00,320 --> 00:06:05,980 We always have the full period in a_0, but in a_n and b_n, 84 00:06:05,980 --> 00:06:08,550 the factor that divides the integral is always going to be 85 00:06:08,550 --> 00:06:23,090 half the period times minus pi to pi, f of t cosine n*t dt. 86 00:06:23,090 --> 00:06:25,790 And I should point out that, in general, we only 87 00:06:25,790 --> 00:06:28,520 need to integrate over one period of the function. 88 00:06:28,520 --> 00:06:31,860 So in some sense there's nothing special about minus pi and pi. 89 00:06:31,860 --> 00:06:35,310 It's just very often these are the easiest 90 00:06:35,310 --> 00:06:37,790 bounds of integration to integrate over. 91 00:06:41,230 --> 00:06:43,220 But in practice, we could have used 0 92 00:06:43,220 --> 00:06:47,265 to 2pi or any other interval, as long as it's exactly 93 00:06:47,265 --> 00:06:48,390 one period of the function. 94 00:06:52,100 --> 00:06:55,080 So in this case, I'd just like to take a look 95 00:06:55,080 --> 00:06:57,320 at the symmetry of f of t. 96 00:06:57,320 --> 00:06:59,580 And we note that the function f of t 97 00:06:59,580 --> 00:07:03,410 is actually odd about the origin. 98 00:07:03,410 --> 00:07:08,890 So if f of t is odd and cosine t is an even function, then 99 00:07:08,890 --> 00:07:12,420 an odd times an even function is going to be an odd function. 100 00:07:12,420 --> 00:07:16,650 And when you integrate an odd function from minus any value 101 00:07:16,650 --> 00:07:20,520 to the same positive value, so in this case minus pi to pi, 102 00:07:20,520 --> 00:07:23,810 we always get 0. 103 00:07:23,810 --> 00:07:26,450 So this is actually 0, because we're 104 00:07:26,450 --> 00:07:31,030 integrating an odd function over a symmetric interval. 105 00:07:40,760 --> 00:07:48,730 So lastly, we have the values of b_n, which are 1 over pi, 106 00:07:48,730 --> 00:07:59,200 minus pi to pi, f of t of sine n*t dt. 107 00:07:59,200 --> 00:08:02,140 And if we were to look at just the symmetry argument again, 108 00:08:02,140 --> 00:08:04,590 f of t is an odd function, sine t 109 00:08:04,590 --> 00:08:07,330 is an odd function, an odd times an odd function is 110 00:08:07,330 --> 00:08:08,560 an even function. 111 00:08:08,560 --> 00:08:10,360 When you integrate an even function 112 00:08:10,360 --> 00:08:13,770 over a symmetric bound, you will essentially 113 00:08:13,770 --> 00:08:15,340 get twice the value of the integral 114 00:08:15,340 --> 00:08:18,200 from 0 to one of the bounds. 115 00:08:18,200 --> 00:08:20,155 So b of n in this case doesn't vanish, 116 00:08:20,155 --> 00:08:22,030 which means we actually have to do some work. 117 00:08:26,160 --> 00:08:28,020 So what we do? 118 00:08:28,020 --> 00:08:30,860 Well, we know the value of f of t on two intervals, 119 00:08:30,860 --> 00:08:34,909 so we're just going to have to work out each interval. 120 00:08:34,909 --> 00:08:38,330 Minus pi to 0, it takes on the value of 1. 121 00:08:38,330 --> 00:08:39,480 So we have sine n*t. 122 00:08:45,290 --> 00:08:51,790 And then from 0 to pi, f of t takes on the value of minus 1, 123 00:08:51,790 --> 00:08:57,459 sine n*t dt. 124 00:08:57,459 --> 00:08:59,500 And you'll note that these integrals are actually 125 00:08:59,500 --> 00:09:00,000 the same. 126 00:09:03,300 --> 00:09:15,730 So this is negative 2 over pi, zero to pi, sine n*t dt, 127 00:09:15,730 --> 00:09:26,470 which if we integrate is negative 1 over n cosine n*t 128 00:09:26,470 --> 00:09:28,130 evaluated between 0 and pi. 129 00:09:32,620 --> 00:09:41,040 So if I work this out, we get minus and a minus, 130 00:09:41,040 --> 00:09:51,360 minus 1 over n cosine n*pi plus 1 over n. 131 00:09:51,360 --> 00:09:53,170 So note that cosine of 0 is just 1. 132 00:09:56,950 --> 00:09:59,310 And now if we take a look at cosine n*pi, 133 00:09:59,310 --> 00:10:01,660 we see that cosine n*pi oscillates between minus 1 134 00:10:01,660 --> 00:10:02,600 and 1. 135 00:10:02,600 --> 00:10:06,070 So cosine of pi is negative 1, cosine of 2pi is 1, 136 00:10:06,070 --> 00:10:07,365 cosine of 3pi is minus 1. 137 00:10:07,365 --> 00:10:09,180 Dot, dot, dot. 138 00:10:09,180 --> 00:10:12,160 So this term right here is actually negative 1 to the n. 139 00:10:18,240 --> 00:10:26,861 So we have 2 over n*pi 1 minus negative 1 to the n. 140 00:10:32,990 --> 00:10:37,320 And now if we just plug in some values of b of 1, b of 2, 141 00:10:37,320 --> 00:10:43,520 b of 3, b of 4, we can see what pattern emerges in the b's. 142 00:10:43,520 --> 00:10:49,930 So b of 1, if I plug in 1, I get 1 minus negative 1. 143 00:10:49,930 --> 00:10:51,570 It's going to be 2. 144 00:10:51,570 --> 00:10:56,490 So I get minus 4 over pi. 145 00:10:56,490 --> 00:11:04,252 b of 2 is going to be 1 minus minus 1 squared is just 1. 146 00:11:04,252 --> 00:11:04,960 So this vanishes. 147 00:11:08,360 --> 00:11:11,980 b of 3 is going to be 1 minus minus 1 148 00:11:11,980 --> 00:11:13,360 cubed, which is negative 1. 149 00:11:13,360 --> 00:11:18,460 So again, we get negative 4 over 3pi. 150 00:11:22,330 --> 00:11:23,650 b of 4 is going to be 0. 151 00:11:29,280 --> 00:11:32,470 So it's sometimes useful the write out 152 00:11:32,470 --> 00:11:34,890 what the Fourier series looks like. 153 00:11:34,890 --> 00:11:39,040 So I'll just write it out right here. 154 00:11:39,040 --> 00:11:47,710 So we have f of t is going to be negative 4 over pi times 155 00:11:47,710 --> 00:12:02,815 sine of t plus 1/3 sine of 3t plus 1/5 sine of 5t plus dot, 156 00:12:02,815 --> 00:12:03,320 dot, dot. 157 00:12:06,960 --> 00:12:15,050 So this concludes part b. 158 00:12:15,050 --> 00:12:16,710 And now lastly, for part c, we're 159 00:12:16,710 --> 00:12:22,270 asked to sketch what does the first Fourier term look like. 160 00:12:22,270 --> 00:12:24,540 So in this case, the first Fourier term 161 00:12:24,540 --> 00:12:30,350 is going to be negative 4 over pi times sine t. 162 00:12:30,350 --> 00:12:33,520 So I'm going to go back to our diagram from part a. 163 00:12:33,520 --> 00:12:37,180 So let's go back to our diagram from part a. 164 00:12:37,180 --> 00:12:40,530 Now what is minus 4 over pi sine t look like? 165 00:12:40,530 --> 00:12:45,730 Well, it's a sine wave that has exactly period 2pi, 166 00:12:45,730 --> 00:12:50,130 and it's going to line up exactly with this square wave. 167 00:12:50,130 --> 00:12:55,740 In addition, minus 4 over pi is just slightly larger than 1. 168 00:12:55,740 --> 00:12:57,230 So we're going to end up with sin, 169 00:12:57,230 --> 00:13:03,560 which peaks just slightly above 1 and slightly below 1. 170 00:13:03,560 --> 00:13:05,610 It's going to go through 0, and it's 171 00:13:05,610 --> 00:13:11,859 going to go through each multiple of pi. 172 00:13:11,859 --> 00:13:13,400 So it might look something like this. 173 00:13:28,590 --> 00:13:36,285 So this is the first Fourier term in the series. 174 00:13:38,980 --> 00:13:43,000 And notice how this first Fourier term is actually 175 00:13:43,000 --> 00:13:46,290 pretty good approximation to the square wave, considering it's 176 00:13:46,290 --> 00:13:48,860 just one term in a series. 177 00:13:48,860 --> 00:13:51,610 As we add more terms in the series, 178 00:13:51,610 --> 00:13:54,370 we're going to get something which looks closer and closer 179 00:13:54,370 --> 00:13:55,650 to a square wave function. 180 00:13:58,500 --> 00:14:00,740 So I'd just like to quickly recap. 181 00:14:00,740 --> 00:14:04,380 When computing the Fourier series for a periodic function, 182 00:14:04,380 --> 00:14:06,410 the first useful thing to do is just write down 183 00:14:06,410 --> 00:14:08,922 the formula for a Fourier series, 184 00:14:08,922 --> 00:14:11,130 and then write down the formulas for the coefficients 185 00:14:11,130 --> 00:14:12,046 of the Fourier series. 186 00:14:12,046 --> 00:14:16,260 So write down the formulas for a_0, a_n, b_n. 187 00:14:16,260 --> 00:14:18,110 When computing a_0, you can often just 188 00:14:18,110 --> 00:14:20,740 look at the average of the function. 189 00:14:20,740 --> 00:14:23,290 When computing a_n and b_n, it's also useful 190 00:14:23,290 --> 00:14:24,910 look at the symmetry of your function. 191 00:14:24,910 --> 00:14:27,830 And if it's either even or odd symmetric 192 00:14:27,830 --> 00:14:30,940 then typically, either all the a_n's or all the b_n's will 193 00:14:30,940 --> 00:14:32,380 vanish. 194 00:14:32,380 --> 00:14:34,550 And then when you work out the integrals, 195 00:14:34,550 --> 00:14:37,700 you can then reconstruct the Fourier series. 196 00:14:37,700 --> 00:14:39,200 So I would like to conclude here, 197 00:14:39,200 --> 00:14:41,356 and I'll see you next time.