[0:00]All right, in this video, we're going to go through a bread and butter optimization problem, but as we go through it, I want you guys to keep in mind that, uh, all optimization problems can be solved using the same steps.
[0:11]Um, the same solution methodology. So, while the story of the problem might be different, you can use the same steps that we're going to use to solve this problem to solve any optimization problem.
[0:22]So, you can read this black text if you want, but the the idea is we're trying to optimize the area enclosed by a rectangular fence.
[0:32]So, we have, it says 40 feet of fencing, um, and we want to find the maximum area and also the minimum area, assuming that we use all 40 feet of fencing.
[0:41]And then there's some constraints to it. It says that in order for this fencing is for a play area for like Sarah's new puppy.
[0:49]And it says there's some constraints, so like it's got to be at least 5 ft long and at least 5 ft wide, and another interesting aspect of this problem is that one side length of the fenced in area is going to be part of the house.
[0:59]And we can assume that the house will have a sufficiently long side, so no matter how long we pick L, we can assume that the siding of the building is going to be long enough to accommodate it.
[1:13]So, the first step in any optimization problem, I've already written it out is you want to identify specifically what you're trying to optimize.
[1:20]Um, so in this problem, we want to maximize and then also as kind of like a part B to the problem, we want to minimize the area enclosed by the fence.
[1:29]Okay, so once we've identified what we're trying to optimize, the next step is, draw a quick picture.
[1:33]Draw a little sketch and in that sketch, identify your unknown variables. So, in this case, our unknown variables would be W and L for the width and length.
[1:42]So then after that, we can move on to step three.
[1:46]Step three is where you write the thing from step one, that is, the thing that you're trying to optimize as a function of the unknown variables that you've identified in your picture.
[1:57]So, in this case, we're trying to optimize area, so we'll say area equals, in this case, what's the area of the enclosed region?
[2:06]It would just be the width times the length, right?
[2:09]Okay, so at this point, we have a function of area, and then you guys know that whenever you want to optimize some function, find the max or min, you just take the derivative, set it equal to zero, find the critical points, right?
[2:20]So, is that what we can do right now? Can we just take the derivative of area?
[2:25]So, I ask you this, because that's a common mistake, because what we have to do before that is we have to get our area or our function that we're trying to optimize in terms of just one unknown variable.
[2:35]Right now we have W and L. So if we took the derivative, what would we take it with respect to?
[2:40]Right? We're not yet in multivariable calculus.
[2:44]We have to get this area function in terms of just W or in terms of just L.
[2:48]Okay, so to do that, we're going to go back to the problem and we're going to use the constraint that was given to us.
[2:53]The constraint was that we have only 40 feet of fencing.
[2:57]So, what can we say about that? We could say that this side length plus this side length plus this side length has to equal 40 or be less than or equal to 40, but we're trying to maximize area, so we're going to use all of the fencing.
[3:09]So, we can say W, 2 * W + L, that's the amount of fencing that we have in total, so that has to be equal to 40.
[3:17]So, this is our constraint. So, the problem is always going to give you this constraint if it happens that your function is going to originally be in terms of two unknowns.
[3:25]So, we use our constraint to get our function in terms of just one unknown variable.
[3:32]So, let's see, what did I do in my work?
[3:37]Okay, we're going to isolate, um, W. You could pick anyone, it's going to work, but in this case, I'm going to pick W. So, solving for W, we get that it equals, we subtract L over and we divide by two. So, this is going to be 40 - L, all divided by two.
[3:51]And we can take this expression for W and substitute it back into our function for area.
[3:56]So, this is going to be equal to, substituting this in for W, we get 40 - L over 2 * L.
[4:09]Okay, now our area is in terms of just one unknown, so now we can jump into step four,
[4:19]which is finding critical points. All right, so in order to find the critical points of this area function, first, we have to take the derivative.
[4:27]So, here I've written out our area function, it's now it's just a function of L, right?
[4:31]And I did some algebra to simplify it. I distributed this L and I split this numerator into two terms.
[4:38]So, we have the area as a function of L equals 20 * L - 1/2 L^2.
[4:43]So, you guys know this, to find the critical points, first you just have to find the derivative.
[4:50]In this case, it's not that bad. So, A' is equal to 20 - L. That's just by the power rule.
[5:00]So, then, the critical points are defined as the points, in this case, L, where the derivative is undefined or where the derivative equals zero.
[5:07]So, this is always going to be defined, no matter what L we pick.
[5:10]So, we're going to get our critical points by setting it equal to zero.
[5:15]All right, so this is pretty simple, this is pretty trivial to solve, L is just equal to 20.
[5:22]So, at L = 20, the original area function is going to be at a maximum or a minimum or neither, so we have to check.
[5:31]And we check using our, uh, first derivative or second derivative test.
[5:34]But before we do that, we have to make sure that this critical point isn't an extraneous solution.
[5:38]In other words, we have to make sure that this value for L lies within our domain for the area.
[5:43]So, what do I mean by that? Let's consider what is our domain for L.
[5:47]What values of L can we have, um, specific to this problem?
[5:52]So, the domain of L, so think about it.
[5:55]What's the smallest that L can be?
[5:59]Could it be zero? Could it be anything greater than zero?
[6:02]Well, we have to remember in the problem, it says that in order for the puppy to have adequate space, the area needs to be at least 5 ft long and 5 ft wide.
[6:09]So, L can't be less than 5 ft, right?
[6:12]This is straight from the from the, uh, from the problem, it was given.
[6:16]So, the smallest L can be is 5 ft.
[6:20]The largest L could be would be, let's see, if you use the smallest length possible for W, then we could calculate based on the fact that W = 5, and the total length has to be 40, what the largest value of L could be.
[6:34]So, here, this is our expression for the perimeter.
[6:37]So, if the smallest W can be is five, right? From the con from the, uh, from the problem, it was given.
[6:44]Then W = 5, this would be 10 + L = 40, the largest that L could be would be 10 then, right?
[6:52]Sorry, 30. If W = 5, the smallest, if you minimize W, you maximize L, so if W is 5, this is 10 + L = 40, so L has to be 30.
[7:05]Okay, so here's our domain for L. L has to be between 5 and 30, inclusive. And so, okay, good. So, our critical point is is L = 20, and that lies within the domain, so this is a valid critical point for the context of this problem.
[7:20]But now we have to see is this a local min or local max or neither? So, let's check. So, let's actually do the second derivative test for this problem.
[7:30]Because, the reason I know that the second derivative test is a good choice is because it seems pretty easy to take the to find the second derivative of it, right?
[7:40]You might be doing a problem, uh, down the line where you have some really complicated expression for the first derivative.
[7:45]And so, you don't want to have to take the second derivative, then it's probably a better choice to use the first derivative test.
[7:58]But in this case, I mean the derivative of of the second derivative of A is just a constant, it's -1, so it doesn't really even depend on L.
[8:08]So, you could think, okay, to do the second derivative test, you plug in your critical point to the second derivative.
[8:11]So, if we plug in L = 20, you know, in fact, it doesn't even matter what L is, we get a negative sign for our second derivative at the critical point.
[8:20]So, because the second derivative is negative at our critical point, in this case, it'd be negative at any point L, that means we have a concave down function.
[8:31]And so, if the function is concave down, right, concave down the whole time, and then our critical point is where the first derivative equals zero, that means that L = 20 corresponds to a local maximum.
[8:44]Okay, so what we just did here, where we, where we figure out whether our critical point corresponds to a local max or local min, you can kind of think of that as step five.
[8:52]So, I didn't label it earlier, but this is technically step five.
[8:57]And like I said, all these steps are applicable to any optimization problem you're doing.
[9:05]I want to tell you guys real quick a little mnemonic. So, for the second derivative test, if you get a positive value, then you can think, positive things make you think happy thoughts.
[9:16]Okay? So, if you get a positive value, then you have this little smiley face, and so your critical point corresponds to local minimum.
[9:26]If you get a negative value, when you plug your critical point into the second derivative, negative things are sad, right?
[9:34]You have this sad face, so the critical point corresponds to local maximum.
[9:38]Or you could think, you know, if you're a robust mathematician, you could think, oh, a negative second derivative, derivative means it's concave down, and so if it's concave down, that means it has to be at a maximum, but, or you could use this mnemonic.
[9:51]This is what I used to use until I got a good sense of what concavity really meant.
[9:58]But anyway, I digress. Um, we've determined that this L value corresponds to a local maximum.
[10:03]So, to maximize area, you want your length to be 20 ft.
[10:10]And then what is W have to be? To get once you get your one unknown variable, you go back to this constraint equation.
[10:17]And here we have our width in terms of L, so perfect.
[10:20]We can just plug in 20 for L.
[10:23]So, W would be 40 - 20 / 2, this equals 20 over 2, which equals 10.
[10:31]So, width = 10.
[10:35]So, this is the parameters that would maximize your area enclosed.
[10:38]Now, what about to minimize the area enclosed? Now, we want to plug in our endpoints of the domain.
[10:45]So, now we're going to say, at L = 5, we're going to find what the corresponding area is.
[10:53]And then we'll say, at L = 30, what is the corresponding area?
[11:00]So, to do this, you just plug in, we have our area function right here in terms of L, so we can just plug in area at L = 5 equals, we just plug in five for L.
[11:13]So, 20 * 5 - 1/2 5^2, this is what? 100 - 1/2 of 25.
[11:27]So, 100 - 12.5, so that's 87.5.
[11:34]Okay, and then we'll plug in L = 30, so A of 30, that gets us 150.
[11:39]So, you can see our minimum area is not going to be at L = 30, it's going to be at L = 5 right here.
[11:48]Okay, so maximum area enclosed at L = 20, W = 10.
[11:53]Minimum area enclosed at L = 5, W = What does W have to be?
[12:05]We go back up here, W = this expression in terms of L, so if we're having L = 5, then this would be 35 over 2.
[12:17]That would be 17.5.
[12:23]There you go, these are your answers.
[12:26]So, like I said, you can follow this process for any optimization problem, it just might be that the derivative is a little harder to find, or it might be that once you get your func the thing you're trying to maximize as a function of your unknown, you might only have one unknown variable originally.
[12:42]Like up here, we had W * L. Maybe in some problem, you'll already have it in terms of just one unknown.
[12:48]In which case, you can just jump right into taking the derivative. But outside of that, pretty much every optimization is the same.
[12:55]So, I hope this video is helpful in outlining that process.
[12:59]Um, yeah, good luck on the test.
![Thumbnail for How to Solve ANY Optimization Problem [Calc 1] by STEM Support](/_next/image?url=https%3A%2F%2Fimg.youtube.com%2Fvi%2FcUMvwG7wvzM%2Fhqdefault.jpg&w=3840&q=75)


