1 00:00:06,975 --> 00:00:07,600 JOEL LEWIS: Hi. 2 00:00:07,600 --> 00:00:09,200 Welcome back to recitation. 3 00:00:09,200 --> 00:00:11,570 One of the things you've been learning about in lecture 4 00:00:11,570 --> 00:00:13,830 is how to solve some max-min problems. 5 00:00:13,830 --> 00:00:16,950 How to find the maximum or minimum of a given 6 00:00:16,950 --> 00:00:21,300 function given some constraints and figure out where it reaches 7 00:00:21,300 --> 00:00:22,990 its largest or smallest value. 8 00:00:22,990 --> 00:00:26,760 So here I have a particular example of such a problem. 9 00:00:26,760 --> 00:00:30,400 So we're going to build a cardboard box. 10 00:00:30,400 --> 00:00:33,910 And our cardboard box has to meet the following criteria. 11 00:00:33,910 --> 00:00:38,190 So its volume has to be 3 units. 12 00:00:38,190 --> 00:00:42,960 The front and back of the cardboard box 13 00:00:42,960 --> 00:00:46,260 are going to be made just of single-thickness cardboard. 14 00:00:46,260 --> 00:00:48,370 But the two sides, the left and right, 15 00:00:48,370 --> 00:00:50,290 are going to be made double-thick. 16 00:00:50,290 --> 00:00:53,162 And the bottom is going to be made triple-thick. 17 00:00:53,162 --> 00:00:54,620 We're not going to have a top, it's 18 00:00:54,620 --> 00:00:55,828 just going to be an open box. 19 00:00:55,828 --> 00:00:59,700 So it's going to have five sides: two of single thickness, 20 00:00:59,700 --> 00:01:01,590 two of double thickness, and with the bottom 21 00:01:01,590 --> 00:01:02,815 of triple thickness. 22 00:01:04,760 --> 00:01:06,510 So, the question is-- there are, you know, 23 00:01:06,510 --> 00:01:11,205 a lot of different shapes of box with total volume 3 units. 24 00:01:11,205 --> 00:01:14,140 So the question is what dimensions should this box 25 00:01:14,140 --> 00:01:18,530 have so that we use the minimum amount of cardboard possible? 26 00:01:18,530 --> 00:01:19,030 All right? 27 00:01:19,030 --> 00:01:21,190 So we want the dimensions of the box 28 00:01:21,190 --> 00:01:23,670 that use the least total amount cardboard. 29 00:01:23,670 --> 00:01:26,380 So why don't you pause the video, work on that for awhile, 30 00:01:26,380 --> 00:01:36,870 come back, and we can work on it together 31 00:01:36,870 --> 00:01:39,290 I hope you had some fun puzzling this one out. 32 00:01:39,290 --> 00:01:41,190 Let's have a go at it. 33 00:01:41,190 --> 00:01:42,970 So to start, I think I'd just like to draw 34 00:01:42,970 --> 00:01:45,630 a little picture of a box. 35 00:01:45,630 --> 00:01:53,980 So here's my cardboard box. 36 00:01:53,980 --> 00:01:55,750 Its top is going to be open, say. 37 00:01:55,750 --> 00:01:58,250 So let's give it-- we want to figure out 38 00:01:58,250 --> 00:02:01,200 what its dimensions should be in order 39 00:02:01,200 --> 00:02:05,051 to minimize some expression, so let's give them names. 40 00:02:05,051 --> 00:02:05,550 Right? 41 00:02:05,550 --> 00:02:07,730 So I think a natural thing to call 42 00:02:07,730 --> 00:02:11,520 them is we can call one of them x and one 43 00:02:11,520 --> 00:02:14,940 of them y and the height z. 44 00:02:14,940 --> 00:02:16,300 There. 45 00:02:16,300 --> 00:02:21,330 So if we give the box these dimensions, x, y, and z, 46 00:02:21,330 --> 00:02:24,320 we need to ask, well first of all, what is its volume? 47 00:02:24,320 --> 00:02:26,580 And second of all, how much cardboard is used? 48 00:02:26,580 --> 00:02:28,170 And as long as we can keep the volume 49 00:02:28,170 --> 00:02:30,960 equal to 3, what's the least amount of cardboard we can use? 50 00:02:30,960 --> 00:02:34,610 So the volume of this box is just x*y*z and that has to be 51 00:02:34,610 --> 00:02:35,170 3. 52 00:02:35,170 --> 00:02:43,790 So we know x*y*z is equal to the volume, which is equal to 3. 53 00:02:43,790 --> 00:02:47,720 So we have a constraint on x, y, and z here. 54 00:02:47,720 --> 00:02:50,980 And the thing that we want to optimize-- 55 00:02:50,980 --> 00:02:55,360 that we want to find a minimum for-- 56 00:02:55,360 --> 00:02:57,860 is the total amount of cardboard used. 57 00:03:04,830 --> 00:03:07,500 So let's talk about how much cardboard is used. 58 00:03:07,500 --> 00:03:11,800 So the bottom of the box is triple-thick. 59 00:03:11,800 --> 00:03:15,230 So its area is x times y. 60 00:03:15,230 --> 00:03:18,345 So the total amount of cardboard used is 3x*y. 61 00:03:21,150 --> 00:03:27,220 Now, the front and back of the box are single thickness. 62 00:03:27,220 --> 00:03:31,190 And they have area x*y, but there-- sorry, not x*y, x*z, 63 00:03:31,190 --> 00:03:32,280 right? 64 00:03:32,280 --> 00:03:35,270 This height is z, so it's x times z-- 65 00:03:35,270 --> 00:03:36,420 and there are two of them. 66 00:03:36,420 --> 00:03:41,180 So we have x*z total cardboard in front and x*z total 67 00:03:41,180 --> 00:03:41,950 cardboard in back. 68 00:03:41,950 --> 00:03:45,820 Oh, I guess this has another segment there in back 69 00:03:45,820 --> 00:03:47,580 because it's an open box. 70 00:03:47,580 --> 00:03:49,590 So x*z and x*z. 71 00:03:49,590 --> 00:03:54,280 So that's 2x*z coming from the front and back. 72 00:03:54,280 --> 00:03:59,380 And from the two sides, well each side has area y*z. 73 00:03:59,380 --> 00:04:01,470 There are two of them and they're double-thick. 74 00:04:01,470 --> 00:04:08,760 So that contributes 4y*z to the total amount of cardboard used. 75 00:04:08,760 --> 00:04:11,270 So this is the total amount of cardboard used. 76 00:04:11,270 --> 00:04:14,590 And we know x*y*z is equal to 3. 77 00:04:14,590 --> 00:04:17,820 So we want to minimize this, but we 78 00:04:17,820 --> 00:04:20,352 want to minimize this taking this 79 00:04:20,352 --> 00:04:22,850 into account, taking this restriction on the volume 80 00:04:22,850 --> 00:04:23,550 into account. 81 00:04:23,550 --> 00:04:25,680 So what we can do is you can realize 82 00:04:25,680 --> 00:04:28,650 that we can just eliminate one of these variables. 83 00:04:28,650 --> 00:04:29,210 Right? 84 00:04:29,210 --> 00:04:31,760 We can say z is equal to 3 over x*y. 85 00:04:31,760 --> 00:04:33,490 That always has to be true. 86 00:04:33,490 --> 00:04:36,360 And if we make that substitution in here, 87 00:04:36,360 --> 00:04:39,940 then we'll be able to minimize this expression without regard 88 00:04:39,940 --> 00:04:41,700 to any constraint anymore. 89 00:04:41,700 --> 00:04:53,440 So from x*y*z equals 3, we have z equals 3 over x*y. 90 00:04:53,440 --> 00:05:07,100 So we want to minimize what we get when we plug z equals 3 91 00:05:07,100 --> 00:05:08,310 over x*y into here. 92 00:05:08,310 --> 00:05:19,810 So that's 3x*y, plus-- well, 2x times 3 over x*y is 6-- over y, 93 00:05:19,810 --> 00:05:26,900 plus-- and 4y times 3 over x*y is 12-- over x. 94 00:05:26,900 --> 00:05:30,820 And one other thing I guess we haven't mentioned explicitly 95 00:05:30,820 --> 00:05:33,420 is that this is a physical box. 96 00:05:33,420 --> 00:05:37,540 It has actual dimensions, so its dimensions have 97 00:05:37,540 --> 00:05:39,490 to be, you know-- they're lengths, 98 00:05:39,490 --> 00:05:43,050 they have to be positive numbers. 99 00:05:43,050 --> 00:05:50,570 So we want for x to be positive and we want for y 100 00:05:50,570 --> 00:05:52,320 to be positive numbers. 101 00:05:52,320 --> 00:05:53,250 OK. 102 00:05:53,250 --> 00:05:55,540 So now we've got this function. 103 00:05:55,540 --> 00:05:57,920 And there aren't-- x and y can be anything, 104 00:05:57,920 --> 00:05:59,800 any value of x and y we choose. 105 00:05:59,800 --> 00:06:01,960 This describes the amount of cardboard 106 00:06:01,960 --> 00:06:04,420 used in a box with those dimensions 107 00:06:04,420 --> 00:06:07,390 on its base that has volume 3. 108 00:06:07,390 --> 00:06:07,970 All right? 109 00:06:07,970 --> 00:06:09,770 So we want to minimize that. 110 00:06:09,770 --> 00:06:13,990 So now we've finally got to the point of our calculus. 111 00:06:13,990 --> 00:06:17,260 Let's call this function-- let's give it a name 112 00:06:17,260 --> 00:06:22,800 like, I don't know-- f of x, y. 113 00:06:22,800 --> 00:06:25,980 So we want to find the global minimum of f. 114 00:06:25,980 --> 00:06:28,330 We want to find the absolute least amount of cardboard 115 00:06:28,330 --> 00:06:30,110 that we can use. 116 00:06:30,110 --> 00:06:32,340 So there are several possibilities 117 00:06:32,340 --> 00:06:34,570 for where a global minimum can occur. 118 00:06:34,570 --> 00:06:40,990 It can occur on some critical point of the function, 119 00:06:40,990 --> 00:06:43,720 or it can occur on the boundary of the region 120 00:06:43,720 --> 00:06:45,400 where the function is defined. 121 00:06:45,400 --> 00:06:47,930 And in this case, that includes the possibility 122 00:06:47,930 --> 00:06:52,790 that it can occur as x or y or both go off to infinity. 123 00:06:52,790 --> 00:06:53,350 All right? 124 00:06:53,350 --> 00:06:57,290 So we have to look at those possibilities. 125 00:06:57,290 --> 00:07:00,040 In particular, we have to look at the critical points. 126 00:07:00,040 --> 00:07:02,010 That's one of the possibilities. 127 00:07:02,010 --> 00:07:03,880 So the critical points of f. 128 00:07:03,880 --> 00:07:07,680 So we need to find out what those points are. 129 00:07:10,990 --> 00:07:13,490 So in order to find the critical points, well what do we do? 130 00:07:13,490 --> 00:07:14,840 We do the usual thing. 131 00:07:14,840 --> 00:07:16,550 We look at its partial derivatives. 132 00:07:16,550 --> 00:07:20,230 So we need the first and second-- or sorry-- 133 00:07:20,230 --> 00:07:23,230 the first partial derivatives with respect to x and y, 134 00:07:23,230 --> 00:07:26,030 we need both of them to be equal to 0. 135 00:07:26,030 --> 00:07:34,520 So we need f_x equals 0, and f_y equals 0. 136 00:07:34,520 --> 00:07:38,880 OK, so let's write down what that means over here. 137 00:07:38,880 --> 00:07:40,330 So what is f_x? 138 00:07:40,330 --> 00:07:42,760 Well, we just take the partials. 139 00:07:42,760 --> 00:07:47,270 So it's 3y-- plus we take the partial of 6y with respect 140 00:07:47,270 --> 00:07:50,540 to x and we get 0, and we take the partial of 12 over x 141 00:07:50,540 --> 00:07:55,030 with respect to x-- and we get minus 12 over x squared. 142 00:07:55,030 --> 00:08:01,550 So that's f_x, and we need that to be equal to 0. 143 00:08:01,550 --> 00:08:09,490 And f_y is equal to 3x minus 6 over y squared, 144 00:08:09,490 --> 00:08:13,030 and we also need that to be equal to 0. 145 00:08:13,030 --> 00:08:15,340 So if we solve this first equation, for example, 146 00:08:15,340 --> 00:08:17,820 we can solve it for y in terms of x. 147 00:08:17,820 --> 00:08:22,490 And that tells me that y is equal to-- 148 00:08:22,490 --> 00:08:25,270 I need-- let's see-- 12 over x squared divided by 3, 149 00:08:25,270 --> 00:08:29,880 so that's 4 over x squared. 150 00:08:29,880 --> 00:08:33,370 Now I can plug this 4 over x squared in down here, 151 00:08:33,370 --> 00:08:38,630 and so I get 3x minus 6. 152 00:08:38,630 --> 00:08:42,580 Well, 6 divided by 4 divided by x squared quantity 153 00:08:42,580 --> 00:08:50,510 squared is 6 times x squared over 4 squared. 154 00:08:50,510 --> 00:08:52,080 That has to be equal to 0. 155 00:08:52,080 --> 00:08:54,710 And I can-- let's see-- I can rewrite this. 156 00:08:54,710 --> 00:08:57,265 Maybe I'll divide through by 3 as 157 00:08:57,265 --> 00:08:58,690 that 3 isn't going to matter. 158 00:08:58,690 --> 00:09:03,540 So it's x minus-- so then I'll be left with 2 times x 159 00:09:03,540 --> 00:09:13,250 to the fourth over 16, so that's-- x to the fourth over 8 160 00:09:13,250 --> 00:09:14,170 equals 0. 161 00:09:14,170 --> 00:09:19,360 And you can see in this equation that either x is equal to 0, 162 00:09:19,360 --> 00:09:23,140 or we can divide by x and then we get x cubed equals 8. 163 00:09:23,140 --> 00:09:28,120 So x equals 0 or x cubed equals 8. 164 00:09:28,120 --> 00:09:32,160 The only solution is x equals 2. 165 00:09:32,160 --> 00:09:34,320 Now, it's easy to see that we can't have 166 00:09:34,320 --> 00:09:37,770 a box with x equal to 0, right? 167 00:09:37,770 --> 00:09:42,520 Our function is not actually defined at x equals 0 over 168 00:09:42,520 --> 00:09:43,610 here, you'll see, right. 169 00:09:43,610 --> 00:09:47,480 Our function had a 12 over x in it, 170 00:09:47,480 --> 00:09:48,880 so we can't have x equal to 0. 171 00:09:48,880 --> 00:09:50,630 So that's not going to be a critical point 172 00:09:50,630 --> 00:09:52,250 of this function. x equals 0 isn't 173 00:09:52,250 --> 00:09:54,000 going to lead to a critical point, so, OK, 174 00:09:54,000 --> 00:09:56,645 so our only critical points are going 175 00:09:56,645 --> 00:09:59,000 to happen when x is equal to 2. 176 00:09:59,000 --> 00:10:01,200 And when x is equal to 2, we can go back up here 177 00:10:01,200 --> 00:10:04,240 and we see that y was equal to 4 over x 178 00:10:04,240 --> 00:10:05,780 squared at our critical points. 179 00:10:05,780 --> 00:10:21,370 So the only critical point is (2, 1). 180 00:10:21,370 --> 00:10:22,210 OK. 181 00:10:22,210 --> 00:10:23,700 So that's our critical point. 182 00:10:23,700 --> 00:10:26,310 So now, we want to think about is 183 00:10:26,310 --> 00:10:31,730 this point going to be a maximum or a minimum or what? 184 00:10:31,730 --> 00:10:36,010 And where is the global minimum of this function 185 00:10:36,010 --> 00:10:37,300 going to occur? 186 00:10:37,300 --> 00:10:39,900 So remember that the global minimum of this function 187 00:10:39,900 --> 00:10:44,170 can occur either on the critical points or on the boundary 188 00:10:44,170 --> 00:10:49,790 or at a point where x or y is going to infinity-- 189 00:10:49,790 --> 00:10:51,470 in the limit, I guess I mean. 190 00:10:51,470 --> 00:10:55,300 So lets go back here and take a look at our function here. 191 00:10:55,300 --> 00:10:59,590 So we can see from the expression for this function 192 00:10:59,590 --> 00:11:03,270 that if x and y are going to infinity, this is no good. 193 00:11:03,270 --> 00:11:05,030 This part is going to go to infinity. 194 00:11:05,030 --> 00:11:07,446 3x*y is going to go to infinity, and these are going to be 195 00:11:07,446 --> 00:11:10,160 positive, so f is going to go to infinity. 196 00:11:10,160 --> 00:11:14,980 OK, so as the dimensions of our box get very, very large, 197 00:11:14,980 --> 00:11:19,010 the total amount of cardboard used becomes infinite. 198 00:11:19,010 --> 00:11:22,140 Also, if x or y gets closer and closer 199 00:11:22,140 --> 00:11:25,230 to 0-- that's at the boundary-- well, 200 00:11:25,230 --> 00:11:27,020 if x gets closer and closer to 0, 201 00:11:27,020 --> 00:11:31,240 than 12 over x gets closer and closer to infinity. 202 00:11:31,240 --> 00:11:35,020 And if y gets closer and closer to 0, then 6 over y 203 00:11:35,020 --> 00:11:36,530 gets closer and closer to infinity. 204 00:11:36,530 --> 00:11:38,030 And again, all these terms are going 205 00:11:38,030 --> 00:11:40,210 to be positive because x and y have to be positive. 206 00:11:40,210 --> 00:11:45,180 So in those limiting cases, the function f of x, y 207 00:11:45,180 --> 00:11:46,890 gets infinitely large. 208 00:11:46,890 --> 00:11:49,635 So along the boundary and as x and y go to infinity, 209 00:11:49,635 --> 00:11:50,940 this function blows up. 210 00:11:50,940 --> 00:11:52,160 It gets very, very big. 211 00:11:52,160 --> 00:11:55,010 So that means the only place it could have a global-- so it 212 00:11:55,010 --> 00:11:58,850 has a global minimum-- the only place that global minimum can 213 00:11:58,850 --> 00:12:01,080 be is at a critical point. 214 00:12:01,080 --> 00:12:03,190 And we saw, if we walk back over here 215 00:12:03,190 --> 00:12:07,240 again, that the only critical point is the point (2, 1). 216 00:12:07,240 --> 00:12:07,740 All right? 217 00:12:07,740 --> 00:12:09,870 So that means this point has to be a global minimum 218 00:12:09,870 --> 00:12:10,910 for the function. 219 00:12:10,910 --> 00:12:12,617 Now, you might, out of curiosity, 220 00:12:12,617 --> 00:12:14,950 you might ask how much cardboard are we actually talking 221 00:12:14,950 --> 00:12:17,170 about in that case? 222 00:12:17,170 --> 00:12:19,901 Since that's really the one part-- 223 00:12:19,901 --> 00:12:22,710 I guess it wasn't really part of the question, 224 00:12:22,710 --> 00:12:25,310 but it's an interesting thing to ask. 225 00:12:25,310 --> 00:12:35,560 So in this case, we use f of 2, 1 equals-- well, 226 00:12:35,560 --> 00:12:44,180 let's see-- so that's 6 plus 6 plus 6 equals 18 units squared 227 00:12:44,180 --> 00:12:46,560 of cardboard. 228 00:12:46,560 --> 00:12:49,910 Now, I guess one thing you might notice 229 00:12:49,910 --> 00:12:52,400 is we didn't use the second derivative test here. 230 00:12:52,400 --> 00:12:54,760 And the question is why-- I mean, 231 00:12:54,760 --> 00:12:58,490 we concluded it was a global maximum without ever using 232 00:12:58,490 --> 00:13:01,200 the second derivative test. 233 00:13:01,200 --> 00:13:02,250 Sorry, global minimum. 234 00:13:02,250 --> 00:13:03,269 Pardon me. 235 00:13:03,269 --> 00:13:05,060 And the second derivative test is the thing 236 00:13:05,060 --> 00:13:06,870 that tells us whether things are minimum 237 00:13:06,870 --> 00:13:08,036 or maximum or saddle points. 238 00:13:08,036 --> 00:13:09,260 So why didn't we use it? 239 00:13:09,260 --> 00:13:11,200 Well, the answer is the second derivative test 240 00:13:11,200 --> 00:13:15,630 tells you whether something is a local minimum or maximum 241 00:13:15,630 --> 00:13:18,220 or whether it's a saddle point. 242 00:13:18,220 --> 00:13:20,440 So if we had applied the second derivative test 243 00:13:20,440 --> 00:13:22,610 at this critical point, what we would have learned 244 00:13:22,610 --> 00:13:25,480 is that this critical point is a local minimum. 245 00:13:25,480 --> 00:13:28,486 But being a local minimum isn't enough to guarantee 246 00:13:28,486 --> 00:13:29,610 that it's a global minimum. 247 00:13:29,610 --> 00:13:31,600 Because we could have on the boundary-- 248 00:13:31,600 --> 00:13:33,544 or as x or y goes to infinity-- we 249 00:13:33,544 --> 00:13:35,960 could have that the function value get smaller and smaller 250 00:13:35,960 --> 00:13:36,830 without bound. 251 00:13:36,830 --> 00:13:39,720 Now in this case, we showed that the function doesn't do that. 252 00:13:39,720 --> 00:13:41,660 It gets larger and larger without bound. 253 00:13:41,660 --> 00:13:45,170 And so that meant that that minimum point really 254 00:13:45,170 --> 00:13:47,430 is the global minimum. 255 00:13:47,430 --> 00:13:49,300 But the second derivative test isn't 256 00:13:49,300 --> 00:13:51,690 enough to conclude that something 257 00:13:51,690 --> 00:13:53,030 is a global minimum on its own. 258 00:13:53,030 --> 00:13:56,600 You really do need that extra analysis that we did. 259 00:13:56,600 --> 00:13:57,872 I'll end there.