 So if our eventual goal is to maximize the entropy, find the value of the probabilities that maximize the entropy, then we need to at least review how to find the maximum of a function. So that's what we'll do right now. So let's suppose we have some function and for now we'll assume that's just a function of one variable. But if I have some function f of x, it might go up, it might go down, it might go through a minima and might go through a maxima. So here's a maximum, here's a minimum in that function. So as you most likely remember from calculus class, the way we can detect whether the function is at a maximum or at a minimum is to look at the slope of that function. So we can calculate the slope anywhere we want, the slope right here. Changing f over changing x tells us the slope of that function. When the slope is zero, when the slope is flat like it is right here, then that's a sign that we're at some sort of special point in that function. At this special point x star, when the derivative of the function is equal to zero, then that means we're at a maximum. It's certainly not equal to zero everywhere. The slope right here is not zero. So it's only at these special points, the optima or the extrema of the function, the maxima and the minima of the function, that the slope is equal to zero. And it's also going to be equal to zero at the minimum of function. So here's another extrema of this function. So I'm looking for places that might be maxima or might be minima. And if we're particularly interested, we can tell whether the function's at a maximum or whether it's a minimum by looking at the second derivative of the function. The function is concave down when it's at a maximum. The function is concave up when it's at a minimum. In general, we won't be as concerned with that. That's just a reminder of what you've learned in a calculus class most likely. So if we want to find the maximum or the minimum of a function, any one of the extrema of a function, we want to find the places where the slope of the function is equal to zero. So just to work one example, let's suppose the function we're interested in is minus x log x. That may look familiar, especially if you just watched the video on the probabilistic definition of entropy. And the results of this example will indeed be useful when we start calculating things about the entropy. But for right now, let's just think of this as a purely mathematical problem. There's a function minus x log x. I want to find the maximum of that function. We don't have to graph that function, but just so you understand, I have a picture in your head of what it is that we're doing. So minus x log x, if I graph that function, it goes from zero through a maximum, and then dips down and becomes negative. And what we're looking for is this position there. What is the maximum of that function? And again, we don't have to draw the function in order to solve the problem. But it helps maybe to have a picture in your head. So we're looking for the place where the derivative is equal to zero. So we need to be able to take the derivative of the function. Derivative of minus x log x. So x shows up in here twice, so we're going to need to use the product rule. Let's go ahead and write this out very explicitly the first time. So I want the derivative of minus x log x. So I can take the derivative of the first term in which x appears. The derivative of x, of course, is 1. So I've got a negative sign. Derivative of x gives me 1. And then I leave the rest of the function alone. And then the product rule tells me also take the negative sign and the x, leave them alone. And take the derivative of the second part, the derivative of log x. And derivative of log x is 1 over x. So I can clean this up a little bit, negative 1 times log x. And then I've got a minus x over x, so I've got minus 1. So the derivative of this function is minus log x minus 1. And in particular, we're looking for the point where if I plug in a particular value, that derivative is equal to 0. In other words, I'm looking for where log of my special value of x minus 1 is equal to 0. So we can rearrange that equation and write log of x star. Bring that over to the left side. So I've got log of x star is equal to minus 1. I'm doing the log x star is equal to e to the minus 1 or 1 over e. And just to stick a numerical value on that, 1 over e, if I calculate e to the negative 1, that works out to be about 0.37 with lots more significant figures. But the answer to the question that we've asked is 0.37. The value of x at which the function reaches a maximum is 0.37. So this is an example, hopefully, review for how to calculate the maximum of a function. In particular, a single variable function, a function that depends on only one variable. When we start talking about entropy, entropy depends on more than just one variable. So in our next step, we'll be to calculate the maximum or minimum for multivariate functions.