1 00:00:00,000 --> 00:00:09,222 PROFESSOR: Welcome back to recitation. 2 00:00:09,222 --> 00:00:10,680 In this video I want us to practice 3 00:00:10,680 --> 00:00:14,540 using Newton's Method to find the solution to an equation. 4 00:00:14,540 --> 00:00:16,589 So what we're going to do in particular 5 00:00:16,589 --> 00:00:18,130 is we're going to use Newton's Method 6 00:00:18,130 --> 00:00:21,360 to approximate a solution to the following equation, 7 00:00:21,360 --> 00:00:23,730 2 cosine x equals 3x. 8 00:00:23,730 --> 00:00:25,970 And I'm going to tell you where to start. 9 00:00:25,970 --> 00:00:28,770 We're going to the have our initial value, x_0, be 10 00:00:28,770 --> 00:00:29,980 pi over 6. 11 00:00:29,980 --> 00:00:32,150 And I want you to find x_2. 12 00:00:32,150 --> 00:00:34,500 So why don't you pause the video, take a little time 13 00:00:34,500 --> 00:00:36,470 to work on that, and then I'll come back 14 00:00:36,470 --> 00:00:38,270 and I will show you how I did it. 15 00:00:46,420 --> 00:00:46,920 OK. 16 00:00:46,920 --> 00:00:47,750 Welcome back. 17 00:00:47,750 --> 00:00:50,190 Again, what we're going to do is use Newton's Method 18 00:00:50,190 --> 00:00:52,900 to approximate a solution to this equation. 19 00:00:52,900 --> 00:00:54,860 And so what I want to point out first is, 20 00:00:54,860 --> 00:00:56,620 I want to point out why pi over 6 21 00:00:56,620 --> 00:00:59,680 is a reasonable first value to choose, 22 00:00:59,680 --> 00:01:02,750 and I want to point out that this, in fact, has only one 23 00:01:02,750 --> 00:01:03,640 solution. 24 00:01:03,640 --> 00:01:07,290 So what I'm going to do, to give us a reason for that, 25 00:01:07,290 --> 00:01:10,200 is I'm going to draw a rough sketch of two curves 26 00:01:10,200 --> 00:01:11,990 and show where they intersect. 27 00:01:11,990 --> 00:01:15,440 And so I want us to notice that if I were to look at the two 28 00:01:15,440 --> 00:01:19,660 curves, y equals cosine x and y equals 3/2 x 29 00:01:19,660 --> 00:01:22,960 and I draw them on the same xy-plane, 30 00:01:22,960 --> 00:01:25,630 that where they intersect will be where I have solutions 31 00:01:25,630 --> 00:01:26,870 to this equation. 32 00:01:26,870 --> 00:01:29,410 And that's because I just divide both sides by 2. 33 00:01:29,410 --> 00:01:32,860 Whatever solves this equation solves the equation, cosine x 34 00:01:32,860 --> 00:01:34,300 equals 3/2 x. 35 00:01:34,300 --> 00:01:36,860 So let me give you a rough sketch of those two curves 36 00:01:36,860 --> 00:01:39,290 and we'll see what the intersections look like. 37 00:01:39,290 --> 00:01:41,540 So I'm going to do that right down here. 38 00:01:41,540 --> 00:01:42,870 OK. 39 00:01:42,870 --> 00:01:49,210 So let me, let me first draw-- make this y equals 1. 40 00:01:49,210 --> 00:01:52,700 Make this y equals minus 1. 41 00:01:52,700 --> 00:01:55,301 And I'm going to draw cosine x first, y equals cosine x first, 42 00:01:55,301 --> 00:01:57,550 because I'm most likely to have a hard time with that, 43 00:01:57,550 --> 00:02:00,070 and I'll do my x scale once I'm done. 44 00:02:00,070 --> 00:02:03,740 And so cosine x, y equals cosine x, looks something like this. 45 00:02:06,630 --> 00:02:09,480 Maybe not the most perfect, but again, 46 00:02:09,480 --> 00:02:12,150 it's kind of a rough sketch. 47 00:02:12,150 --> 00:02:14,680 That's pretty good. 48 00:02:14,680 --> 00:02:15,860 Something like this. 49 00:02:15,860 --> 00:02:17,550 So this is y equals cosine x. 50 00:02:20,630 --> 00:02:24,970 And now I want to graph y equals 3x over 2. 51 00:02:24,970 --> 00:02:26,940 And that goes through the point (0, 0). 52 00:02:26,940 --> 00:02:30,130 It also goes through the point one comma three halves. 53 00:02:30,130 --> 00:02:33,270 Well, this is pi over 2 right here. 54 00:02:33,270 --> 00:02:37,730 So 1 is about here, we'll say. 55 00:02:37,730 --> 00:02:42,740 Because pi over 2 is a little bigger than one and a half. 56 00:02:42,740 --> 00:02:46,410 So the 1 is about here, One and a half is about here. 57 00:02:46,410 --> 00:02:49,480 Or 3/2, if you need to remind yourself. 58 00:02:49,480 --> 00:02:53,658 So the line y equals 3/2 x looks something like this. 59 00:02:56,730 --> 00:02:59,160 So it's fairly straightforward to see 60 00:02:59,160 --> 00:03:02,830 that these two curves intersect at one spot, whatever 61 00:03:02,830 --> 00:03:03,460 this spot is. 62 00:03:03,460 --> 00:03:05,350 OK? 63 00:03:05,350 --> 00:03:07,850 And notice, to the left they don't intersect. 64 00:03:07,850 --> 00:03:10,267 So we are just looking for a single solution. 65 00:03:10,267 --> 00:03:12,100 And then the other thing I want to point out 66 00:03:12,100 --> 00:03:14,100 is, why is pi over six potentially 67 00:03:14,100 --> 00:03:15,680 a good guess to start with? 68 00:03:15,680 --> 00:03:19,530 Well, the value, this is the x-value 1, 69 00:03:19,530 --> 00:03:21,040 and this is the x-value 0. 70 00:03:21,040 --> 00:03:23,050 We know for a fact that we have to have 71 00:03:23,050 --> 00:03:25,970 this x-value line between 0 and 1 72 00:03:25,970 --> 00:03:31,520 because of where my point is at the time that x equal 1, 73 00:03:31,520 --> 00:03:34,960 I'm all the way up at y equals 3/2 up here. 74 00:03:34,960 --> 00:03:37,664 So at least we know we're between 0 and 1. 75 00:03:37,664 --> 00:03:39,080 And then from there you could even 76 00:03:39,080 --> 00:03:41,820 try some other values like pi over 3 and pi over 4 77 00:03:41,820 --> 00:03:43,890 and put those in and see how they compared. 78 00:03:43,890 --> 00:03:46,240 But at least, we'll just say, at least we 79 00:03:46,240 --> 00:03:48,420 know x is between 0 and 1, and pi over 6 80 00:03:48,420 --> 00:03:49,730 is certainly in that region. 81 00:03:49,730 --> 00:03:51,554 So that's a good first starting point. 82 00:03:51,554 --> 00:03:53,970 Now I'm going to come over here and start to do some work. 83 00:03:56,540 --> 00:03:59,570 If we want to solve the equation, 84 00:03:59,570 --> 00:04:02,540 2 cosine x equals 3x, what we're really doing 85 00:04:02,540 --> 00:04:04,480 is we're looking for zeros of this function. 86 00:04:10,910 --> 00:04:13,590 So we find the zeros of this function, which we 87 00:04:13,590 --> 00:04:14,840 know there's only one of them. 88 00:04:14,840 --> 00:04:17,160 We find the zero of this function, 89 00:04:17,160 --> 00:04:21,430 then we actually have solved 2 cosine x equals 3x. 90 00:04:21,430 --> 00:04:23,030 So hopefully that makes sense to you 91 00:04:23,030 --> 00:04:25,113 that we're actually going to apply Newton's Method 92 00:04:25,113 --> 00:04:25,860 to this function. 93 00:04:25,860 --> 00:04:28,318 And so when we apply Newton's Method, we need the function. 94 00:04:28,318 --> 00:04:29,696 We also need to the derivative. 95 00:04:29,696 --> 00:04:31,740 So let me remind you, to derivative 96 00:04:31,740 --> 00:04:36,790 of this is going to be negative 2 sine x minus 3. 97 00:04:36,790 --> 00:04:37,290 Right? 98 00:04:37,290 --> 00:04:39,430 The derivative of cosine x is negative sine x. 99 00:04:39,430 --> 00:04:41,810 And so this is exactly the derivative. 100 00:04:41,810 --> 00:04:45,870 And then let me remind you what Newton's Method says. 101 00:04:45,870 --> 00:04:49,860 It says the next x-value is equal to the previous x-value 102 00:04:49,860 --> 00:04:52,770 minus the fraction of the function evaluated 103 00:04:52,770 --> 00:04:55,810 at the previous value divided by the derivative evaluated 104 00:04:55,810 --> 00:04:56,830 at the previous value. 105 00:04:56,830 --> 00:04:58,920 Right? 106 00:04:58,920 --> 00:05:01,200 So this is the formula you have for Newton's Method. 107 00:05:01,200 --> 00:05:05,530 So let's see if we can get from x_0 to x_1 and then x_1 to x_2. 108 00:05:05,530 --> 00:05:12,490 So in our case, we have x_1 equals, well, x_0 is pi over 6. 109 00:05:12,490 --> 00:05:14,690 And then we have minus the function 110 00:05:14,690 --> 00:05:16,770 evaluated at pi over 6, and then the derivative 111 00:05:16,770 --> 00:05:18,750 evaluated at pi over 6. 112 00:05:18,750 --> 00:05:22,000 So the function evaluated at pi over 6-- cosine of pi over 6 113 00:05:22,000 --> 00:05:23,660 is root 3 over 2. 114 00:05:23,660 --> 00:05:25,940 So root 3 over 2 times 2-- we get a root 3. 115 00:05:29,170 --> 00:05:30,570 Separate that out. 116 00:05:30,570 --> 00:05:34,470 And then here, pi over 6 times 3 is pi over 2. 117 00:05:34,470 --> 00:05:38,400 So we get a minus pi over 2. 118 00:05:38,400 --> 00:05:40,630 Sine pi over 6 is 1/2. 119 00:05:40,630 --> 00:05:42,510 So we get negative 2 times 1/2-- we 120 00:05:42,510 --> 00:05:48,660 get negative 1 and then a negative 3. 121 00:05:48,660 --> 00:05:50,660 And if you simplify this, you get 122 00:05:50,660 --> 00:05:56,080 that this is approximately 0.564, or around that. 123 00:05:56,080 --> 00:05:57,970 OK? 124 00:05:57,970 --> 00:06:02,970 And now from here, you would then, for x_2, 125 00:06:02,970 --> 00:06:07,990 you're going to take 0.564 minus these things evaluated 126 00:06:07,990 --> 00:06:09,600 at 0.564. 127 00:06:09,600 --> 00:06:14,400 This ratio, f of 0.564 divided by f prime at 0.564. 128 00:06:14,400 --> 00:06:16,480 But I'm not going to do that because you should 129 00:06:16,480 --> 00:06:19,890 get somewhere around, depending on how many decimal places 130 00:06:19,890 --> 00:06:22,630 you kept, you should get something 131 00:06:22,630 --> 00:06:26,220 around one of these two values. 132 00:06:26,220 --> 00:06:30,300 So you actually get, after x_0, by x_1, 133 00:06:30,300 --> 00:06:32,770 you have something that is at least fixed to the first two 134 00:06:32,770 --> 00:06:35,900 decimal places. 135 00:06:35,900 --> 00:06:38,980 And then this third decimal place, maybe it's 136 00:06:38,980 --> 00:06:40,929 going to be a 4 or a 3 in the end. 137 00:06:40,929 --> 00:06:42,720 But depending on what value we choose here, 138 00:06:42,720 --> 00:06:44,850 we might get slightly different values here based 139 00:06:44,850 --> 00:06:45,830 on the rounding. 140 00:06:45,830 --> 00:06:48,750 So just suffice it to say, I got x_1. 141 00:06:48,750 --> 00:06:50,320 Your x_2 should be about the same. 142 00:06:50,320 --> 00:06:51,911 It should be one of these two. 143 00:06:51,911 --> 00:06:52,410 OK. 144 00:06:52,410 --> 00:06:54,749 So let me just remind you what we were doing here. 145 00:06:54,749 --> 00:06:56,290 We were trying to use Newton's Method 146 00:06:56,290 --> 00:06:57,830 to find a solution to an equation 147 00:06:57,830 --> 00:07:02,414 that I had written up here, this 2 cosine x equals 3x, 148 00:07:02,414 --> 00:07:03,830 and I pointed out a couple things. 149 00:07:03,830 --> 00:07:06,820 I pointed out that finding a solution to this equation 150 00:07:06,820 --> 00:07:09,140 is the same as finding a solution to the equation 151 00:07:09,140 --> 00:07:11,640 cosine x equals 3/2 x. 152 00:07:11,640 --> 00:07:14,780 And so I did that as a graph to sort of see 153 00:07:14,780 --> 00:07:18,510 if I could get an initial idea of what kind of solution 154 00:07:18,510 --> 00:07:20,410 I was looking for. 155 00:07:20,410 --> 00:07:23,380 And then we just started using Newton's Method 156 00:07:23,380 --> 00:07:24,580 on a particular function. 157 00:07:24,580 --> 00:07:27,500 And that function was this side of the equation 158 00:07:27,500 --> 00:07:28,290 minus this side. 159 00:07:28,290 --> 00:07:31,970 Because if 2 cosine x minus 3x equals 0, 160 00:07:31,970 --> 00:07:33,670 then 2 cosine x equals 3x. 161 00:07:33,670 --> 00:07:37,700 So we had this function over here, 2 cosine x minus 3x, 162 00:07:37,700 --> 00:07:40,220 and I said I was looking for zeros of that function. 163 00:07:40,220 --> 00:07:42,500 And that's where Newton's Method comes in. 164 00:07:42,500 --> 00:07:45,070 So I think that is where I will stop.