1 00:00:00,000 --> 00:00:08,890 CHRISTINE BREINER: Welcome back to recitation. 2 00:00:08,890 --> 00:00:11,560 Today we're going to work on an optimization problem. 3 00:00:11,560 --> 00:00:13,630 So the question I want us to answer 4 00:00:13,630 --> 00:00:17,100 is, what point on the curve y equals square root of x plus 4 5 00:00:17,100 --> 00:00:19,150 comes closest to the origin? 6 00:00:19,150 --> 00:00:21,380 I've drawn a sketch of this curve. 7 00:00:21,380 --> 00:00:24,510 The scale in this direction-- each hash mark 8 00:00:24,510 --> 00:00:26,975 is one unit in the x direction, each hash mark here 9 00:00:26,975 --> 00:00:28,960 is one unit in the y direction. 10 00:00:28,960 --> 00:00:31,090 Just want to point out two easy places 11 00:00:31,090 --> 00:00:33,470 to figure out the distance to the origin. 12 00:00:33,470 --> 00:00:36,520 Over here, where the curve starts at negative 4, 0, 13 00:00:36,520 --> 00:00:39,170 the distance to the origin is 4 units. 14 00:00:39,170 --> 00:00:43,340 And here at (0, 2) the distance to the origin is two units. 15 00:00:43,340 --> 00:00:45,610 It's probably, we could safely say, further away here. 16 00:00:45,610 --> 00:00:47,710 So we're anticipating that somewhere 17 00:00:47,710 --> 00:00:49,440 along the curve in this region is 18 00:00:49,440 --> 00:00:53,282 where we should find our place that's closest to the origin. 19 00:00:53,282 --> 00:00:54,990 The only reason I point that out is that, 20 00:00:54,990 --> 00:00:57,740 when you're doing these problems on your own you should always 21 00:00:57,740 --> 00:01:00,642 try and anticipate roughly where things should happen, 22 00:01:00,642 --> 00:01:03,100 in what kind of region, so that you don't-- you don't start 23 00:01:03,100 --> 00:01:06,175 thinking, if you do something wrong and you get x equals 100 24 00:01:06,175 --> 00:01:08,050 and then you come back and look at the curve, 25 00:01:08,050 --> 00:01:10,510 you realize right away, well, that doesn't make any sense. 26 00:01:10,510 --> 00:01:13,135 So we want to always be thinking as we're solving the problems, 27 00:01:13,135 --> 00:01:14,219 does my answer make sense? 28 00:01:14,219 --> 00:01:16,468 So I'm actually going to give you a little bit of time 29 00:01:16,468 --> 00:01:18,820 to work on this yourself and then I'll come back 30 00:01:18,820 --> 00:01:20,070 and I'll work on it as well. 31 00:01:29,620 --> 00:01:30,780 Welcome back. 32 00:01:30,780 --> 00:01:33,620 Hopefully you were able to get pretty far into this problem. 33 00:01:33,620 --> 00:01:37,180 And so I will start working on it now. 34 00:01:37,180 --> 00:01:38,750 So again, the question is that we 35 00:01:38,750 --> 00:01:43,240 want to optimize-- in this case, minimize-- the distance 36 00:01:43,240 --> 00:01:45,620 to the origin from this curve. 37 00:01:45,620 --> 00:01:49,440 And so what we're really trying to do is we have a constraint, 38 00:01:49,440 --> 00:01:51,690 the constraint is we have to be on the curve, 39 00:01:51,690 --> 00:01:55,660 and then we also have something we're trying to minimize. 40 00:01:55,660 --> 00:01:57,980 And the thing we're trying to minimize is distance. 41 00:01:57,980 --> 00:02:02,380 And so we have to make sure that we understand the two equations 42 00:02:02,380 --> 00:02:05,150 that we need-- the optimization, or the constraint equation, 43 00:02:05,150 --> 00:02:06,760 and the optimizing equation. 44 00:02:06,760 --> 00:02:10,180 So to optimize we need to know how to measure distance 45 00:02:10,180 --> 00:02:11,760 in two-dimensional space. 46 00:02:11,760 --> 00:02:13,830 And one point I want to make is that if you 47 00:02:13,830 --> 00:02:16,050 want to optimize distance you might as well 48 00:02:16,050 --> 00:02:18,800 optimize the square of distance because it's much easier. 49 00:02:18,800 --> 00:02:21,820 So let me justify that briefly and then we'll go on. 50 00:02:21,820 --> 00:02:27,244 So I want to optimize the distance squared to the origin. 51 00:02:27,244 --> 00:02:29,410 It's, well distance, you remember, first in general, 52 00:02:29,410 --> 00:02:33,650 between two points (x, y) and (a, b) 53 00:02:33,650 --> 00:02:37,260 is something in this form. 54 00:02:37,260 --> 00:02:39,352 Distance squared is the difference 55 00:02:39,352 --> 00:02:41,310 between the x-value squared plus the difference 56 00:02:41,310 --> 00:02:42,660 between the y-value squared. 57 00:02:42,660 --> 00:02:45,100 This is, should remind you of the Pythagorean theorem, 58 00:02:45,100 --> 00:02:46,430 ultimately. 59 00:02:46,430 --> 00:02:51,740 So in this case, in our case, distance to the origin 60 00:02:51,740 --> 00:02:53,480 is x squared plus y squared. 61 00:02:53,480 --> 00:02:56,120 The distance squared is x squared plus y squared. 62 00:02:56,120 --> 00:02:59,060 I just told you that instead of trying to optimize distance, 63 00:02:59,060 --> 00:03:01,080 we can optimize distance squared. 64 00:03:01,080 --> 00:03:02,340 Why is that? 65 00:03:02,340 --> 00:03:04,274 Well, remember that when you optimize, 66 00:03:04,274 --> 00:03:05,940 what you're looking for is a place where 67 00:03:05,940 --> 00:03:09,610 the derivative of the function of interest is equal to 0. 68 00:03:09,610 --> 00:03:11,502 So what I want to point out is that when 69 00:03:11,502 --> 00:03:12,960 you take the derivative of distance 70 00:03:12,960 --> 00:03:16,070 squared and find where that's 0, it's 71 00:03:16,070 --> 00:03:18,430 going to be the same as the place 72 00:03:18,430 --> 00:03:20,780 where the derivative of distance is equal to 0. 73 00:03:20,780 --> 00:03:21,790 So let's notice that. 74 00:03:21,790 --> 00:03:25,520 So this is a little sidebar justification. 75 00:03:29,190 --> 00:03:34,000 Notice d squared prime is equal to 2d d prime. 76 00:03:34,000 --> 00:03:35,676 Where did that come from? 77 00:03:35,676 --> 00:03:37,300 That's this is implicit differentiation 78 00:03:37,300 --> 00:03:39,880 with respect to x and this is the chain rule. 79 00:03:39,880 --> 00:03:43,980 So if I want d prime to equal 0, I 80 00:03:43,980 --> 00:03:46,670 can also find where d squared prime equals 0. 81 00:03:46,670 --> 00:03:48,590 I'm assuming-- notice the distance is never 82 00:03:48,590 --> 00:03:51,111 at the origin-- so distance is never 0. 83 00:03:51,111 --> 00:03:52,610 So I don't have to worry about that. 84 00:03:52,610 --> 00:03:54,110 So that's a small sidebar, but just 85 00:03:54,110 --> 00:03:56,820 to justify why we can do that. 86 00:03:56,820 --> 00:03:59,870 Now let's come back into the problem at hand. 87 00:03:59,870 --> 00:04:04,330 What is our optimization problem, equation 88 00:04:04,330 --> 00:04:05,610 that we want to minimize? 89 00:04:05,610 --> 00:04:08,840 We want to minimize this equation with respect 90 00:04:08,840 --> 00:04:09,840 to a certain constraint. 91 00:04:09,840 --> 00:04:10,756 What's the constraint? 92 00:04:10,756 --> 00:04:12,455 The constraint is what y is. 93 00:04:12,455 --> 00:04:15,140 y depends on x. 94 00:04:15,140 --> 00:04:17,930 And so when I solve these problems 95 00:04:17,930 --> 00:04:21,550 I'm going to have to substitute in my constraint. 96 00:04:21,550 --> 00:04:25,980 So y squared is the square root of x plus 4 quantity squared, 97 00:04:25,980 --> 00:04:27,390 so I just get x plus 4. 98 00:04:31,080 --> 00:04:34,940 So now I have my optimization equation. 99 00:04:34,940 --> 00:04:37,040 How do I find a minimum or a maximum? 100 00:04:37,040 --> 00:04:40,350 I take the derivative and set it equal to 0. 101 00:04:40,350 --> 00:04:42,770 So let me come give myself a little more room 102 00:04:42,770 --> 00:04:45,630 and do that over here. 103 00:04:45,630 --> 00:04:52,090 So d squared prime, now I get derivative of x squared is 2x. 104 00:04:52,090 --> 00:04:57,070 The derivative of x is 1, and the derivative of 4 is 0. 105 00:04:57,070 --> 00:05:00,320 This will be optimized when this is equal to 0. 106 00:05:00,320 --> 00:05:03,500 So 0 equals 2x plus 1. 107 00:05:03,500 --> 00:05:05,440 So x is equal to minus 1/2. 108 00:05:08,110 --> 00:05:11,520 Does this pass, as we would say maybe, the smell test? 109 00:05:11,520 --> 00:05:12,750 Does it smell OK to us? 110 00:05:12,750 --> 00:05:14,800 The answer will be yes. 111 00:05:14,800 --> 00:05:17,860 Because remember, we said somewhere in this x region 112 00:05:17,860 --> 00:05:21,570 is where we expect that we will have a distance closest, 113 00:05:21,570 --> 00:05:23,080 point closest to the origin. 114 00:05:23,080 --> 00:05:25,260 And so we're right here on the x value. 115 00:05:25,260 --> 00:05:27,970 Now we have to find what the y value is to finish the problem. 116 00:05:27,970 --> 00:05:30,450 But this is not, so far, very surprising. 117 00:05:30,450 --> 00:05:32,990 It seems like maybe the right thing. 118 00:05:32,990 --> 00:05:33,850 Now we have x. 119 00:05:33,850 --> 00:05:35,160 So now how do we find y? 120 00:05:35,160 --> 00:05:36,470 Well, we know what y is. 121 00:05:36,470 --> 00:05:39,600 y is equal to the square root of x plus 4, 122 00:05:39,600 --> 00:05:43,820 so it's equal to the square root of negative 1/2 plus 4, 123 00:05:43,820 --> 00:05:50,270 which simplified is 3 and 1/2, which I think is 7/2. 124 00:05:50,270 --> 00:05:57,610 So the point is negative 1/2 comma square root of 7/2. 125 00:05:57,610 --> 00:05:59,910 And then you just want to double check and make sure, 126 00:05:59,910 --> 00:06:02,530 did I ask for the distance or did I ask for the point? 127 00:06:02,530 --> 00:06:05,020 And right now we have the point, so let's come over 128 00:06:05,020 --> 00:06:07,430 and make sure what point on the curve 129 00:06:07,430 --> 00:06:08,740 comes closest to the origin. 130 00:06:08,740 --> 00:06:12,550 So now we know that we've answered the correct question. 131 00:06:12,550 --> 00:06:15,154 So again, it was a maximize-- sorry, 132 00:06:15,154 --> 00:06:16,320 it was a minimizing problem. 133 00:06:16,320 --> 00:06:17,820 It was an optimization problem where 134 00:06:17,820 --> 00:06:19,430 we wanted to minimize distance. 135 00:06:19,430 --> 00:06:21,060 We had a constraint equation. 136 00:06:21,060 --> 00:06:23,449 We had the thing we wanted to minimize. 137 00:06:23,449 --> 00:06:25,490 And then we took the derivative of the minimizer, 138 00:06:25,490 --> 00:06:29,620 set it-- of the optimizing equation, set it equal to 0, 139 00:06:29,620 --> 00:06:34,750 solved for x, and then found the answer to the specific question 140 00:06:34,750 --> 00:06:37,040 by then finding the y-value. 141 00:06:37,040 --> 00:06:38,632 And I think I'll stop there.