Transcript for:
Video 4.5.2: Applied Optimization

In this video, we'll cover a few more examples of optimization problems. So in our first example, a small paper container is constructed in the following manner. So squares of length x are cut from the corners of a 12 cm by 12 cm piece of cardstock. The remaining sides are then folded up and taped together. So the question is, what are the dimensions of the square cutouts which maximize the volume of the container? So we're going to take our piece of paper and cut squares out of the corners. We're going to fold the sides up, tape everything together to make a container. The question is, what is the dimension of this square? In other words, what's the length of the square that I should cut into the corner in order to maximize our volume? So the volume of a container of this form is going to be length times width times height. So looking at our diagram here, Well, we're going to be cutting x centimeters into the paper this direction and x centimeters into the paper in this direction. So we're going to be removing 2x centimeters from the piece of paper on this side. So what's going to be left over here is going to be 12 take away 2x. And that's going to be true on all four sides here. So what we have is that the length and the width of our rectangle, or excuse me, of our container is going to be 12 minus 2x. Now the height of the container when we fold up is just going to be x. So the height here, these pieces are going to give me my height. And that's just going to be the dimension, that's going to be the length that we cut in for the square. So our height is going to be x. And our length and width are going to be 12 minus 2x. So our equation for the volume in terms of x is going to be 12 minus 2x times 12 minus 2x. That's length times width and then times height. So let's think about our domain for this function. So the domain for this function, obviously x has to be larger than 0. Otherwise, we're not cutting anything. We're not cutting any corners of this piece of paper. Also, we'll have to make sure that 12 minus 2x... stays greater than 0, right? Because we can't have a negative length or a 0 length here. Solving this inequality, that means 12 has to be larger than 2x, or 2x is less than 12. And dividing by 2, x will have to be less than 6. So our domain is x greater than 0, x less than 6. So in interval notation, that's the interval 0, 6. So we have our function in terms of one variable, and we have the domain of that function, so let's find its derivative. So rather than expanding this 12 minus 2x squared, I'm just going to apply the chain rule and the product rule. So our derivative, v prime of x, is going to come out to this expression. So first we'll take the derivative of 12 minus 2x squared. The 2 comes down, so we'll have 2 times 12 minus 2x. Take 1 away. multiplied by the derivative of the inside, which is going to be negative 2, and then times x, so that's the f prime g, and then we'll add f times g prime, so we'll have 12 minus 2 x squared, and then times the derivative of x, which is just going to be 1. So this expression is our derivative. So what I want to do here is I want to factor to clean this expression up a little bit. So notice that I can factor out a 12 minus two x from each term. So here's a 12 minus two x we'll factor out and we'll factor out one of these 12 minus two x's. Now on the inside what's gonna be left over will have two times negative two times x so that's gonna be a minus four x and then we'll have this second 12 minus two x left over. So taking one more step, the derivative is going to be this expression. We're going to have 12 minus 2x. Now on the inside, this is going to be negative 6x plus 12. We now want to find our critical points. So for the critical points, we want to look where the derivative is 0 or undefined. Now notice, if you were to FOIL this out, this is just going to be a quadratic. So our derivative is always defined. The only case I'm interested in. is the derivative equal to zero. So we'll set our derivative equal to zero. It's already very nicely factored for us. So we have two factors, 12 minus two x equals zero. And of course that's gonna mean x equals six. On the other hand, Hand will have negative 6x plus 12 equals 0. That's the same as 12 equal to 6x. And so x is going to be equal to 2. Now you'll notice here that this 6 is not in the domain. So we're going to throw this out. This is not going to be a critical point. So the only critical point that we have on our domain is going to be x equals 2. So we now want to classify our critical point to make sure that we are getting the result that we want to see. Again, we're trying to maximize the volume. So looking at our derivative around this critical point of 2, let's take a test point of 3 and maybe a test point of 1. So we'll take the derivative with 3 plugged in. So here's our derivative again. So this is going to be 12 minus 2 times 3. So we're going to have 12 minus 6 and then times negative 6 times 3 which is going to be negative 18 plus 12. So this is going to be 6 times negative 6 which is of course going to be negative. On the other hand we'll find the derivative at the test point of 1. So that's going to be 12 minus 2 times 1 and then times negative 6 plus 12. And that's going to be 10 times 6 which is of course positive. And so we do see that we have the transition from positive to negative around the critical point of 2. So our conclusion is that we have a local maximum at this critical point. This was the only critical point in the domain, so this is also a global maximum. So in order to maximize volume, our square cutouts should have the dimension 2 centimeters by 2 centimeters. Our next examples are going to require the distance formula. So first, let's derive the distance formula so that it makes a little bit more sense rather than just presenting it. So how do we find the distance between two points, x1, y1 and x2, y2? So what we're going to do here is we're effectively going to draw a right triangle. So in our coordinate space, this is the point x1, y1, and this is the point x2, y2. So I want to measure the length of this segment connecting the two points. So what I'm going to do is I'm going to form a right triangle. So forming a right triangle, this third point where we have the right angle, this would be the point x2, y1. So we can now calculate the length of this segment of the triangle or this leg. This is going to be the vertical distance which is y2 minus y1. And here we're going to have the horizontal distance which is going to be x2 minus x1. Now by the Pythagorean theorem This, let's call our distance here d. We know that our distance squared is going to be equal to x2 minus x1 squared plus y2 minus y1 squared. And so for the distance, we're going to take the root here. We'll take the positive root. The distance is going to be this equation. It's going to be the difference in the x values squared plus the difference in the y values squared all under the square root. So as a consequence of the Pythagorean theorem, we have our distance formula. The distance between two points is just the root of the distance between the two x values squared plus the distance between the two y values squared. So in certain optimization problems, it may be easier to work with the square of the objective function versus the objective function by itself. So we have the following theorem here. If f is a non-negative function, in other words the y values are greater than or equal to 0 for all x in the domain, then we have the following connection. So if x0 minimizes or maximizes f squared, then x0 minimizes or maximizes f. So the point that minimizes or maximizes the square of the objective function will be the same as the point that minimizes or maximizes the objective function. by itself. So we can only do this when our function is non-negative. In other words, the y values are greater than or equal to 0 on the domain. So here's how this relates to the distance function. The distance function involves the square root. And so we know that the square root function is always non-negative. on its domain. So if my function is called g of x, and it's equal to the root of f of x, well, then I know the y values of this function are greater than or equal to 0 for all x in the domain. So if I wanted to find the optimizer of g, then it's good enough to find the optimizer of g squared. And notice by squaring, I'll remove the root, and I really only have to focus on the inside of the root. So this can simplify things because I won't have to find the derivative with the root involved as I'm solving my problem. I can just square our distance function. That'll eliminate the radical and all I'm working on is that function on the inside, which you notice is fairly simple. It's going to be a function that has some quadratic flavor to it and so that will make our life a little bit easier as it pertains to finding the derivative. So we have to be careful though. We can only apply this result when we have a non-negative function as our objective function. And that is going to be the case when our objective function involves a square root by itself. So let's apply that here. In this example, we're going to start at the point. And we're going to draw a line segment to the curve or the line y equals 2x. And so what I want to do is I want to find where I'm going to connect this line segment to this line of y equals 2x in order to yield the line segment of minimum distance. So what we're going to do is we're going to take our point 1, 1, and we're going to connect to the line somewhere. And I want to know where this second point has to go to give me the shortest line segment. So I'm going to call this point just a general point on the line xy. So the distance between these two points is going to be the square root of the difference in the x values, so 1 minus x squared, plus the difference in the y values squared, that'll be 1 minus y squared. So this will be the distance between these two points, the point on the line and the point. Now notice that we have that y is equal to 2x. So in order to get my distance formula in terms of one variable, I'm going to make that substitution. So the distance is going to be 1 minus x squared plus 1 minus 2x squared all under the square root. So let's define our objective function. We're going to let our objective function be the square of the distance which is going to eliminate the radical. So we're going to let our objective function be f of x equals 1 minus x squared plus 1 minus 2x squared. So this will make life a little bit easier because our derivative is going to be a little bit more easier to work with because I'm just going to have to apply the power rule and the chain rule. Now as far as the domain for this function goes, the domain of this function is going to be all real numbers because in theory this point that I'm drawing to the line could really be anywhere. Obviously, it's going to be in some window close by, as logic would dictate. So it's hard to pin down a nice domain for this function. So we're going to ignore the domain of this function and just approach the derivative now. So our derivative is going to be calculated this way. You could certainly FOIL out these two binomials. But I'm just going to approach this through... The chain rule. So for the first term I'll bring the 2 down, keep the inside, take one away, multiply by the derivative of the inside. Same for the second term. The 2 comes down, take one away, multiply by the derivative, negative 2. So we'll clean this up a little bit. Our derivative is going to be negative 2 times 1 minus x and then minus 4 times 1 minus 2x. And I'm gonna go one step further. This is gonna be negative two plus two x by distributing the negative two and then minus four plus eight x. So what we're gonna have here is that the derivative f prime of x is going to be equal to two x and eight x is gonna give us 10 x, negative two and negative four is gonna give us minus six. So we have a very nice derivative now. The derivative is just 10x minus six. So we want to find our critical points. Again, our critical. Points are going to come from the derivative being 0 or undefined. This is a linear derivative, so we are not going to have the case where we're undefined. So the only critical point will come from the derivative equal to 0. So that means 10x has to be 6. Dividing by 10, x is going to be 6 tenths, or 3 over 5. So in order to minimize it seems that our x coordinate should be 3 5ths but we want to verify. So we'll verify with a sign chart. Our critical point here is at 3 5ths. So we'll take a point above let's say 1 and a point below let's say 0. So the first derivative at 1 is going to be 10 minus 6 which is going to be 4. Clearly positive. And the first derivative at 0 is going to be 0 minus 6, which is negative 6. Clearly negative. So we are indeed seeing this transition from negative to positive. This is showing us that we have a local minimum at this point. And that was our only critical point, so this is also our global minimum. So now we know that y was 2x. So x being 3 fifths, y is going to be 2 times 3 fifths, which is going to be 6 fifths. So we've answered our question now. So the point 1, 1 to the point 3 fifths, 6 fifths, where that second point is lying on the graph of y equals 2x. gives us the minimum distance.