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