 Welcome back, everyone, to part 38 of our lecture series entitled Math 1210, Calculus I for students at Southern Utah University. As usual, I'm your professor, Dr. Andrew Misledine. It's great to have you all here today. This lecture 38 here is entitled Autobots Rollout. I know it's a horrible pun here, but I'm going with it anyways. Today, we're going to talk about optimization problems. Optimization represents one of the capstone topics when studying derivatives. In the previous lectures, we had talked about curve sketching on how the shape of the function is determined by the derivative and second derivative, which really brings all of these ideas that we've learned about derivatives together. Optimization is very similar in that nature, that it brings in together all of what we've learned about derivatives, but also some other cool aspects from pre-calculus type problems. The methods we've learned for finding extreme values have practical applications in many areas of life. A business person, for example, might want to minimize cost and maximize profit. A traveler who wants to minimize transportation time, will try to find the path of shortest distance. As another example, Fermat's principle in optics states that light follows the path that takes the least amount of time. Optimization problems, I'm just from these examples, just trying to say that they're everywhere. In this section, that is, this lecture is based upon section 4.7, optimization problems from James Stewart's calculus textbook. In this section, we're going to be looking at lots of problems about maximizing area, maximizing volume, maximizing profits. Sometimes we want to minimize though, minimize distance, minimize time, minimize cost. And so we often use this gender neutral term of optimization. What is the optimal answer? What's the best answer? Well, sometimes that means maximizing. Sometimes it means minimizing. But whether we're trying to minimize our answers, it turns out that we have the following basic strategy that we're going to go, well, let's talk about this real quick. So what are the ingredients? Well, not the ingredients. What is the instructions for an optimization problem? We'll think of it as like a recipe that we want to bake in our kitchen here. What are the step-by-step things that we need to do? Well, it probably goes without saying, but I'm going to say it anyways, because whenever someone says it goes without saying, they end up saying whatever it is that goes without saying. But when it comes to any story problems, optimization problems included, the very first thing you need to do is read the question. I can't emphasize enough how important that is because sometimes we're just so used to problems falling in various templates. We just jump in without even knowing what's going on here. And so in particular, we need to read the problem. And we need to read the problem carefully. Reading a math problem is not the same way as reading Harry Potter. You might need to take your time to make sure we understand exactly what's going on here. Particularly, the story problem is going to be expressing quantities that are related to each other. Some of them will be known quantities they're given to you. Some of them are going to be unknown. It's helpful to figure out what is it that we want to figure out and what is given. So determine what those things are. The next step, it's sort of an optional step, but I really, I recommend it highly here. If that is all possible, draw a picture of what it is you're trying to solve the problem. Especially for this section in the textbook, all of the examples are very much geometric in nature. So they lead themselves very naturally to drawing pictures. Then this can be difficult in other situations, but feel free to draw a picture to help you understand what's going on. And in particular, one of the advantages of the picture is that we can label it. Specify what things are. Are these dimensions of a triangle, of a cube, of a rectangle, what have you. And so our ultimate goal though is we're trying to optimize a variable. So we have to decide which variable. And sometimes when I say decide, sometimes it means we have to determine what variable needs to be optimized. Whether that's a max or a min, it doesn't matter, it depends on the context. We have to figure out which variable. When I say decide, it's because we get to pick the variable's names. So if we came up with a bunch of variables X, Y and Z, which one are we trying to optimize? Like, oh yeah, we're giving information about X and giving some information about Y. We want to optimize Y, okay, we'll do that. And for these situations, for this section, 4.7, each of these can be written, I'm sorry, we can come up with an optimizing function. An optimizing function. This is our function, F of equals, well, there could be lots of variables X, Y, Z, et cetera. We're trying to optimize this guy right here, F of this. Now, this is single variable calculus. We're not gonna be having a lot of variables floating around here. In particular, can we write this optimizing function as a function of one variable? And sometimes that's not gonna be exactly obvious how to do that. The way that we're gonna be able to do that is we're gonna have something called a constraint. We don't need that article there, but constraints are gonna help us out here a lot. Constraints are a big part of optimization problems because we can't just type in our favorite cheat code like show me the money or glittering treasures or whatever other video games you like to play, right? We don't just have infinite resources. There's some type of constraints and restriction on what has to happen. We don't just have infinite money, therefore we can't just produce infinite many commodities and sell them all to make infinite profit. There's a limitation, whether that's time or money or other constraints. Those constraints will help us relate variables together. And so we'll mostly be using constraints to help us get a single variable function that we wanna optimize here. Once we have our function in hand, it is important to recognize the domain of the function. Again, this has to do with things like constraint and other realistic situations. Does negative even make sense for this situation? Like can our input variables be negative? If that's time, maybe, because it means that something happened be prior to the start of the experiment, but typically that means a no. And so you determine what type of things are acceptable. Are the answers real numbers? Are they rational numbers? Are they integers? Integer optimization becomes a very fundamentally different problem than real optimization, the type of things we're gonna see here. That is, we'll allow for decimals and our answers. Right, so once we've identified the domain, then we're gonna be looking for the critical numbers of the function, which means we're gonna have to be looking for f prime of x when it's equal to zero or when it's undefined, D and E. Again, typically though, the D and E doesn't really apply to an optimization problem because we have to choose input that are realistic. And so if the function's undefined for certain values, it doesn't matter if that's optimal, we can't pick something for which makes our function undefined. So we're typically gonna be looking for what makes our optimizing derivative go to zero, find those critical numbers. And then because this, most of the time, this is gonna be a closed interval problem, the type of examples we're gonna see. Because of the domain, there's some fixed values, A, B, like we can't get less than A or bigger than B in this situation. And so because of that, we have these extreme value problems we've seen before where we look at A, we look at B, we look at any critical number that's in the between them. And so we might get something like the following, it's like, okay, the maximum happens right here. And so we're looking for those things as well. Now, if the domain is open, it is possible to still find an optimal solution because after all, if you have a cost function, we're trying to minimize cost. Well, admittedly, there's nothing that stops us from just producing more and more and more and more and more commodities in our factory, which would increase the cost. And admittedly, we're not gonna be able to produce infinitely in an infinite amount in a day. But if we sort of idealize, well, is there any restriction? No, not really. We can still find optimal solutions. It should be the case that a cost function has a minimum. It should be that a profit function has a maximum and things like that. And so a lot of this will make much more sense in context. So I wanted to spend the rest of our video here is actually going through some specific examples. And like I said, most of these examples are either directly from James Stewart's calculus textbook or modifications of those. And so imagine as our first one, this is like the classic example. One cannot learn optimization without figuring out how to make build a fence for which one side is missing. So what do we mean by that? So imagine we have a farmer and the farmer has 2,400 feet of fencing and wants to fence off a rectangular field that borders a straight river. So let's kind of draw the picture right here. We have our river going on right here. Rivers are typically blue. So I'm the color I'm gonna do it. And so we're gonna make a rectangular fence that is next to the river like this. And so the farmer doesn't have to put any fencing along the river because the river acts as a natural barrier between his property and the neighboring property. And also if we're gonna like maybe keep some animals inside of the fenced area, then well, maybe we don't wanna fence by the river so that they can go get a drink or whatever. Whatever the reasons doesn't matter. The point here is that we have a rectangle that we're trying to build and it has a natural barrier already built into it. And therefore we only have to put three sides of the rectangle. And so what dimensions of the field have the largest area? So this is the key word right here, largest. That word right there is an optimal type of word. We are trying to maximize the area, trying to maximize the area of this field. All right, so how does one maximize the area of any field? Or in this case, how do we optimize the area of this field? Well, it is a rectangle. And so the area of a rectangle is gonna equal length times width. Let's say that the short side here, we're gonna call that x and x. And then the long side, we're gonna call it y. In the middle, I shouldn't call them long or short because we don't know which side is gonna be bigger. I just drew a picture of what it could look like. But we'll say that the side that runs parallel to the river has length y and the two other sides that run perpendicular to the river have width x. And so in that situation, the area is gonna equal x times y. And so our optimizing function here, because every optimization problem has an optimizing function. This is the thing we're trying to optimize. Our function is this a equals x times y, all right? But like I warned you about before, this is a very, our function a actually is a very, it has two variables, x and y. How do we deal with these two variables? How do we work in the presence of two variables? Well, that's where this 2,400 feet comes into play right here. This 2,400 feet of fencing is our constraint. Every optimization problem has a constraint. We don't just have infinite resources because if the farmer had an infinite amount of fencing, he can make a field that's infinite in size. But the fact that our farmer is stuck with the 2,400 feet, that constraint helps us in this situation. So what does that mean? So what we have is that the perimeter of this rectangle is gonna be the 2,400 feet. But how does this perimeter relate to the variables present? Well, if you think about our rectangle, we have one x, we have a y, and then we have another x. We don't have a second y because of the river there. And the perimeter is then gonna equal 2x plus y. The perimeter of a usual rectangle will be 2x plus 2y equals the perimeter, but because of the river, we only get 2x plus y. And so if we use this constraint, we can solve for one of the variables. Let's say we try to solve for y right here. y would then equal 2,400 minus 2x for which we can then plug that into the optimizing function for the variable y here. And if we do that, then our optimizing function turns into the following. A equals x times 2,400 minus 2x. And I'm gonna distribute this thing through because my ultimate goal is to be taking a derivative. And although I could use the product rule, it's gonna be a little bit cleaner if you distribute the x. So we get 2,400x minus 2x squared. This is our optimizing function. So now some things we could think about now is that in terms of domain, what are the acceptable values of domain right here? And so thinking of our river one more time here, we have our river right here. What can we have for our x's and y's? Well, in terms of x, the smallest x could be would be like zero. If your x was zero, then your river, or not your river, your fence would just be all the y. That would be like y equals 2,400 feet. And it would be like we built a wall next to the river. Clearly this is not gonna be a good choice, at least from a geometric point of view. It seems ridiculous. But if we were trying to build a sign chart, not a sign chart, a t chart, where we have x and a right here, if you set x to be zero, your area is gonna be zero as well. That's gonna be ridiculous. Clearly that's not gonna be the maximum area, but it is part of the domain. So it is worth considering. Sometimes the optimal solution does happen at the boundary. On the other extreme, what if we put all of the fencing into the x and not into the y whatsoever? If we did that, we'd have a fence that goes down and then we have a fence that comes back where the thickness between them is nothing. In that situation, we would have the 2,400 equals 2x, because y is zero in that situation. So x equals 1,200. Again, that kind of seems silly, but again, that's the situation we have right here. We put everything into the x. You're likewise gonna get zero area. This gives us the domain of the function zero to 1,200. And even if these are absurd answers, it is important we know the domain because as we go searching for critical numbers, we have to disregard any critical limits outside of this domain. All right, so let's find the critical numbers. We're gonna take the derivative of the area with respect to x. By the usual derivative rules, a prime will equal 2,400 minus 4x. And we want this to equal zero. Adding 4x to both sides, we get 2,400 equals 4x. And divide both sides by four. We get x equals 2,400 over four. Four of course goes into 2,400 six times. And so we end up with 600 feet as this single critical number. And so this is our only critical number. Given the other two were zero, I have high hopes that this number will hopefully be something better. And so if we go back to the original function, a equals x times y. If you want to, you could plug the 600 in to this equation right here. And so you get something like 2,400 times 600 minus two times 600 squared. That's gonna be nice and dandy. The arithmetic takes a little bit more complicated here. Not too much though. On the other hand though, if we just think of the x and y situation right here, if x is 600, what is y gonna be? Well, like we saw before, y was equal to 2,400 minus 2x. And so you're gonna get the 2,400 minus 2x, which is 1,200. You end up with 600 times the 1,200. And so whichever one you do, these are gonna be the same thing. You're gonna end up with 7,720,000 square feet. I never mentioned this here, but we were looking for areas. So these are gonna be square feet. And so by the extreme value theorem we've seen before, there has to be an optimal solution in this closed interval. And it's gonna either be at the boundary or a critical number. And so we see right here that the optimal solution is gonna be right here. And so if we record what we find here, the maximum area, well, it's gonna be 720,000 square feet. Now remember, the original question didn't actually ask what was the maximum area. What it asked is what dimensions will give us the maximum area. So make sure we actually answer the question it's given. And so the maximum area is gonna be 720,000. And it's obtained. It's obtained at a 600 by 1200 feet. 600 feet by 1200 feet rectangle.