Calculus, how do we know local extrema is the absolute max? Given a function such as $f(q)=q(Q-q)$, if we take the derivative of $f$ with respect to $q$ and set it to $0$ then $f'(q)=0=Q-2q \implies q = \frac{1}{2} Q$
But how do we know that this is the absolute maximum value? The book doesn't check to see if its maximum, it just states that it is.
How do we know it is a maximum? What if it is a minimum?

There are many possible arguments. We give two that are often useful.
$1.$ The derivative $f'(q)$ is positive for $q\lt \frac{Q}{2}$ and negative for $q\gt \frac{Q}{2}$. So the function $f(q)$ is increasing up to $q=\frac{Q}{2}$, then decreasing.
It follows that $f(q)$ reaches an absolute maximum at $q=\frac{Q}{2}$.

$2.$ If $Q=0$ the result is obvious, so assume $Q\ne 0$ The function $f(q)$ is negative unless $q$ is between $0$ and $Q$, and is $0$ at $0$ and at $Q$. The function is continuous, so attains an absolute maximum in one or more places the closed interval between $0$ and $Q$. Every such maximum is a local max, so $f'(q)=0$ at every maximum. But there is only one place where $f'(q)=0$, so that place must be where the absolute max occurs.
