 So, this is not a calculus topic, but it's one that often shows up as a challenge for many students in calculus, and that's this problem of writing objective functions. So, the idea is that an objective function in general is any sort of function that models some specific phenomenon. So, classic examples of the revenue when we sell coffee at a given price, or the area of a figure when we know one's length of the figure, the yield of a chemical reaction at a given concentration, and so on. The challenge is that there's no formula that will tell you what the objective function is. The only way you can find the objective function is you have to construct it. And so, the only way to get it good at constructing objective functions is to construct a lot of them. And this is something that is done in... Well, nowadays it's done starting in basic arithmetic. You do it in algebra. You do it in geometry. You do it in pre-calculus. You do it in trigonometry. And we're going to do it again in calculus because it's an important idea. Now, one wrinkle that we might have is because calculus talks about rates of change. It turns out that it's in many ways easier to write an objective function once you have a rate of change. So, for example, we have the situation of coffee, shop sells coffee, and at that price that we're selling it at, we sell 500 a day, and then we have some information about how our sales will change. And we want to write an expression for the revenue as a function of price. Now, I don't know how you learned how to write objective functions in pre-calculus or in algebra or in previous courses, but if you are still having difficulty with them, here's one approach that you might have. A good starting point for trying to find any function is to identify what changes and what stays the same. So, here we're told that the price of a cup of coffee is $2, but this could change. How do we know it could change? Well, it's implied in this statement that we could increase or decrease the price. So, we ought to let that represent a variable. So, we'll have our variable x being the price of a cup of coffee. What else could change? Well, again, we sell 500 cups of coffee a day, but again, we have the possibility of that quantity changing. Sales will increase or decrease, again, implying that the number of cups we actually sell is also going to be a variable. Now, you did have to have some familiarity with the outside world. So, one of the things that we have here, revenue, is the product of the price per cup and the number of cups sold. So, I can express that revenue is x, that's the price of a cup of coffee, times c, that's the number of cups of coffee sold. And I'd like to express revenue as a function of price only, right? I'd like to express the function as a function of price, which means that x is fine. The number of cups sold, on the other hand, I would also like to write as a function of price. So, how do we obtain that? So, again, you've probably, you have done this in previous courses, and if you have a good way of approaching this problem, use it. If you don't have a good way of approaching the problem, here's something that might help. It might help us to set up a table that will make it easier to see what the relationship is between the price x and the number of cups sold. And this is a table of data, and we're going to do two things here. One, we're going to collect a couple of examples of price and cups sold, and then we'll do a little bit of algebra to try and see what the relationship between the two of them is. So, what do I know? And I do know that at a price of $2 a cup, I sell 500 cups of coffee, so I can enter that in as a table value. What else do we know? Well, we also know, based on our assumption, that sales will increase or decrease by 5 cups for every dollar increase or decrease in price. Now, here is something that we have to parse. That says that my sales will decrease if I have $1.01 increase in the price. Likewise, the sales will increase if we have a decrease in the price. So, that means if I raise my price, I'm going to have viewer sales. Now, here's an idea that's worth keeping in mind. When you're doing this sort of analysis, it doesn't actually pay to do too much arithmetic. So, I could set a new price, $2.20 or whatever, but maybe I'll just increase the price by .01. So, here I know that this is 2.01, but I'm just going to leave it as 2 plus .01. And there's a couple of reasons for this. The most important is that if I'm going to change my sales based on every .01 increase, then I already know the number of .01 increase and my cup sold will be 500 minus 5. And again, it's not really worth doing the arithmetic to figure out what this is. We can, but it makes the algebra harder to see. Maybe I'll do a 2.01 increase in the price of a cup of coffee, and that's going to cause me to have a 2.05 decrease in the number of cups sold. And let's go big time. Let's increase that price by 10 cents. And so, our number of cups sold will decrease by 10 sets of 5. Now, we'll play the game. One of these things is not like the other. And so, the first thing we might notice here over in the right-hand column, all of these have a 500. All of them have a minus. All of them have a 5. But sometimes those 5s have coefficients, and sometimes they don't. Well, that's a little bit different, so let's see if we can eradicate that difference. And so, I'll throw in a coefficient of 1, because I can always do that. And likewise, I've done the same thing over here on the left. Everything added 2, everything added .01, and now everything has a coefficient. And so, now let's see if I can find that function. So, I'd like to know if the price is x, what's the number of cups sold? Well, again, one of these things is not like the other. So, in this column, everything is a 2 plus, there's a .01, and then there's some other numbers there, and that's just an x. So, let's see if we can transform this x into something that looks like one of these other expressions. So, that's going to require a little bit of algebra. So, the first thing I want to do is I would like to have a 2 plus there. Again, here's a point where a little bit of analysis goes a long way. This expression here, the last thing I do before evaluating it is I add two things. So, that's actually going to be the first thing I'm going to take care of. I want a 2 plus, the nice thing about math is if you want something, you can put it in. The only thing that has to happen is you've got to balance the books. So, now I have a 2 plus, as long as I had that x minus 2. And important thing to note, I have not changed what I have in that column. It's still x after all the dust settles. Well, again, one of these things is not like the other. Everything has a .01 in it, I want a .01 in here, this is math, you can get what you want. If I put a .01 in here times, I need to make sure that I pay for it by dividing by it. So, I'm going to multiply by .01, I'm going to divide by .01, and then that's going to be my new expression. And so, now everything has a 2 plus, everything has a .01, and then everything has a coefficient. Now, it's not really necessary, but it's kind of nice if we can manage to do this. This divide by .01 here is the same as multiplying by 100, so I'll rewrite it this way. And now let's do a comparison. So, this now looks like everything else in the column. 2 plus, 2 plus, something, something, .01, .01. This expression here now looks like every other entry in this column. So now let's take a look at how we go from left column to right column. And the first thing to notice, everything has a 500, everything has a 5, and the coefficient of 5 is the same thing as the coefficient of .01. So that says that what should go here if we want to be consistent should be 500 minus the thing in front of .01 times 5. And so our formula looks like that. So everything has a 500, everything has a 5, and the thing in front of the 5 is the same as the thing in front of the .01. And there's my function. And again I might want to do a little bit of algebra to make that expression look a little bit nicer. And so there's my cleaned up form of the expression. Number of cups sold is going to be 1500 minus 500x. And that tells me that C is 1500 minus 500x. And don't forget, what we're actually looking for is revenue as a function of price. So revenue is going to be the product of cost, the price, times the number sold.