 For this video, let's look at one last example here. Let's find the area of the largest rectangle that can be inscribed in a semicircle of radius R. We're not going to specify the radius of this circle here. We'll just call it R. Let's inscribe a rectangle. What we might inscribe is that the two vertices on the top right here and here are going to live on side of this semicircle. We want this to be the biggest area possible. The largest area we're going to maximize area here. Well, how are we going to do it? Well, if we approach it like we did before, we could say that, well, using the coordinate system that we have right here, if the distance from the x, along the x-axis from the origin to this point right here, that would be x and the distance above would be y, thus giving us the coordinate we have right here. If we use x and y right here, our area is going to equal 2x times y. Because after all, x is the distance from the y-axis to this point. We need to have the entire distance right here. So that's a 2x times y. And so one could try to then optimize like we did before. We have this 2x and y. Well, we'd have to remove one of the variables from the other. We could use the semicircle because the semicircle this time actually is giving us the constraint. Now, the semicircle as a constraint has the equation. Well, just for a general circle, of course, you're going to get x squared plus y squared equals r squared. If you solve for y and choose the upper semicircle, you're going to get r squared minus x squared all inside of the square root. And so then your optimizing equation would look like a equals 2x times the square root of r squared minus x squared. And so we could solve. That is, we could take the derivative of that thing, but that thing is going to look ugly. I mean, with the product rule, it's going to be necessary and then the chain rule inside the square root. That's not the most ideal way of optimizing this one. I want to provide an alternative approach that one could take. And this one actually utilizes a little trigonometry. What if we instead of using x and y, think of the angle theta, formed between the x-axis and this point, which is a vertex or the rectangle? Well, then as angle fluctuates, this point could move all the way up to here or it could move all the way down to here. This kind of gives you the extremes. So this would suggest that theta, theta could be anywhere from zero to what we'll work in radians here. I have this gives us the domain of the problem. And both of these situations do seem absurd because when you take theta equals zero, theta equals zero would look like this rectangle right here. It would just be completely flat. Its area is going to be zero. So clearly that's not going to be our optimal one, but for completeness sake, we'll include it. And then the other one happened at pi halves, which similar thing is happening there. If we take the rectangle of pi halves, it would just be a line again. So its area would be zero. So who's the one in the middle? Let's take a look at that. Well, if we make the appropriate substitution using some trigonometry here, instead of saying x and y, we would get r cosine theta, r sine theta. To kind of give an explanation of how we're approaching this one, we're using some trigonometry to help us out, but later on in Calc 2 particularly, also Calc 3, this technique we're using right now is we're switching from Cartesian coordinates to polar coordinates to solve the problem because I claim the polar solution is much easier or the polar problem is much easier than the Cartesian problem. If that doesn't make any sense to you, don't worry about that. That's a topic for another semester. And so our area function, if we take 2x, that gives us 2r cosine theta. And if we take y, that's r sine theta. We can rewrite this as 2r squared cosine theta sine theta. And we can then take the derivative here. You'll notice there's only one variable in the situation now. We can take the derivative, it's not so bad with the product, but my trig identity sense is tingling here. 2 cosine theta sine theta, my goodness, that's none other than the double angle for sine. So we get r squared times sine of 2 theta. And that's going to be a much cleaner derivative because after all r squared is just a constant here, it doesn't change. Therefore, a prime is going to equal 2r squared cosine of 2 theta. What do you know? That's great. And if you said that equal to 0, we'll divide both sides by 2r. You just end up with cosine of 2 theta equals 0. If you don't like the double angle, we could use some angle identity to switch it back. But I'm actually quite happy with this situation. So we have to figure out when does cosine equal 0? Thinking of your standard unit circle diagram, cosine measures the x-coordinate. So we're looking for when are we on the y-axis. That's going to be at pi halves and 3 pi halves. We only have to find the solutions in a single period. Now you might wonder, isn't 3 pi halves outside the domain? Well, notice we solved this for 2 theta. If we divide both sides by 2, we end up with pi force and we're going to get 3 pi force. Which 3 pi force is in the second quadrant. It's outside of our domain. So that one we can remove and we can get pi halves. This is going to be our optimal solution here. And then only 3 pi halves, the way we interpreted theta, gives us the same answer. So it wasn't wrong to include it. If we take pi halves and put it back into our optimizing function, what's going to happen there? Well, we get, by what we saw right here, you're going to get sine of pi, 2 times pi force. 2 times pi force is pi halves. Sine of pi halves is 1. So you end up with the area, I'm sorry. Yeah, so pi halves is going to be our optimal angle that we want to use right here. And so let's put this back into our area function. That's the, that's, yeah, this, this right, yeah, just put it right here, no big deal. So we're going to get r squared times sine of 2 times pi fourth, which is pi halves right there. And so we end up with r squared as the optimal area. Great. Now, what did, what did the question ask? Did it want to know the optimal area or did it want to know the dimensions? Find the area of the largest rectangle. So, okay, so the optimal area is going to be r squared. And it's obtained when the angle is pi fourths. So what if we didn't know the dimensions in terms of x and y? Well, we go back to the relationships we had before, x equals r cosine. So if theta equals pi fourths, we're going to get r times root 2 over 2. And then y, same thing, r times sine theta, we're going to get r root 2 over 2. So our rectangle is going to look like r root 2 by r root 2 over 2. We double the x coordinate because, remember, we double that for the original rectangle. So if we want the dimensions, we're going to get this. And then if we wanted the maximum area, that's going to be in r squared. All right then. So that's going to be it for our lecture today. I did want to do some more examples of optimization. Because again, these ones take a while to get through. So stay tuned for video 39. That's going to continue these examples on optimization. But if you liked our video today, or if you wanted to see more of this type of content, please subscribe. And if you have any questions, post them in the comments below. I'll be happy to answer them. And I'll see you next time for some more calculus. Have a great day, everyone. Bye.