Previously, we were able to figure out the firm's optimization behavior in a world where the firm knew its cost and the firm face the exogenous price which we just labeled p sub zero. So, the price that's given to the firm and given that signal that comes into the firm, the firm knows its production technology, its cost. We figured out how to optimize by looking at a total revenue and a total cost function. In fact, I'm going to repeat that because we're going to find a quicker way, the new in this, but I want to sort of draw where we were at the end of that. We had a situation, dollars is set on a vertical axis, quantity on a horizontal axis, and we had a situation where we had a fixed cost, we had a total cost curve, and we had a total revenue curve. We understood that we could find the maximum profit by getting an eyeball or I could draw the profit function but I'll just sort of eyeball it right now. The maximum profit would be about right there, the biggest vertical gap. Now, let's first remember a couple things. One is that the slope of total cost is equal to the marginal cost and the slope of total revenue is equal to marginal revenue. Vertically, you can see that gap looks to be the largest between there but I want to think about this more systematically. If you were to think about back to the days, I'll put another one of those bubbles that's kind of a bubble that pops up over your head in the cartoons and you're thinking about something. Well, recall from the days that you took geometry on some axis system. Instructor said, "Look, suppose we have two functions. We have one function that says y is equal to f of x and we have another function that says y is equal to h of x." Those are just two arbitrary functions I just drew. If your instructor said, "What x level would maximize the difference between those two?" You were able to prove that the x level that you would choose, that is, what level of x would maximize this vertical gap is the one where the slope of the two functions were the same. Think about it. If the slopes of the two functions are different, suppose they are different like this. There's only two ways they can be different. They can be diverging. If they're diverging, it means you still haven't found the max between the two, right? So, you're not there yet. Just keep increasing x because that gap is getting larger. If they're converging, it means you've gone too far. Hey, wait a minute. Gap is getting smaller. There's only two ways that the slopes can be different. They're either different like this or different like this. Either one of those cases, you're in the wrong space. Only when the slopes are identically equal have you found that max. If you think about the story from this picture, as you start out from this point which we'll call- we'll take this point here and call it Alpha. Alpha, the slopes are wildly apart and as you step to the right increasing x, the slopes are getting farther and farther and farther apart but they're bending. At one point, the slopes get to be identically equal too and you've got the biggest gap now because if you go one step farther, they're actually getting closer. So, what that means is to maximize this difference, you just want to set the slopes to be equal. That's all we have to do back on this picture. If I want to maximize the gap between those two curves, they're just two curves, one of them you could call f of x and one you could call h of x, or in this case, f of q and h of q. I want to find the output point where the slopes of those two are equal. So, we will maximize profits by setting the slope of the cost function equal to the slope of the revenue function or marginal cost equals marginal revenue. Now, that may have been too far back in your memory when you took your analytical geometry class to think that through, but I hope you understand the intuition here. If the slopes are different and they're diverging, you still haven't found the maximum distance. If the slopes are different and they're converging, you're going past the place where the two curves are farthest apart from each other. Only when the two slopes are equal, I'm not saying the slopes are zero, I'm just saying when the slopes are equal, have you found the max of that gap. I need to do just a little bit of housekeeping here, and I want to say, you just watch this for a minute. I want to set profit is equal to total revenue minus total cost. If you were to show that function to anybody and say, calc one, the very first calculus class, and say, "Hey, how would you maximize profits?" That person in that calculus class would say, "Well, I know I would take the derivative of profit with respect to output and I'd set that equal to zero." That's the first-order condition that you would do when you find the maximization of a problem. Well, the derivative of profit with respect to quantity is the same thing as writing the derivative of total revenue minus total cost with respect to quantity, right? I haven't done anything fancy there, which is a derivative of total revenue over output minus the derivative of total cost over output, that's a simple distributive property, and I want to set this equal to zero. That part because that's how I know I'm going to maximize the function. I'm going to set this first order condition equal to zero, but what is this? This term is marginal revenue. This term is marginal cost and I want those two to be equal to zero. That means the two of them have to be the same value. Once again, this is a more formal proof, using calculus, of the fact that the way you maximize the difference between two functions is to set their slopes equal. The reason I went through this exercise is not because I'm wanting to turn you into a budding young calculus students. It's because I want you to know that I haven't made any other assumptions here other than just simple maximization. This is going to be great for us because going forward, we're going to look at all sorts of different markets. We're going to look at markets that have lots of players. We're going to look at markets that have one player. We call that a monopoly. We're going to look at markets that have a few number of players, it's called oligopoly competition amongst the few. We're going to look at cartel markets. We're going to look at all sorts of markets. Every time, all the firms in those markets want to do this. This is the fully general rule for profit maximization. They go to sleep at night saying the same mantra, "Marginal revenue equals marginal cost. Marginal revenue equals marginal cost." The intuition of this is, imagine if you will, that you're thinking about your cash register at your store. If the marginal revenue of an extra unit you sell exceeds the marginal cost, sell it, because that marginal revenue is the extra revenue coming in and the marginal cost is what it costs you to make that. If they're paying you more than what it cost to make it, do it. It's grazing the pile of coins in the cash register at the end of the day. If it turns out the extra revenue is less than what it cost to make it, don't be selling that unit. Don't be selling that unit. Stop. Only when marginal revenue equals marginal cost are you in a happy spot, and that's the point where you're making the most money in your firm. We're going to look at that over and over again as we go forward.