To calculate the maximum or minimum of a function, find where the [[derivative]] of the function is equal to zero.
An absolute maximum or minimum will be the highest or lowest possible value of the function. Some functions will have relative maxima or minima for specified ranges within the domain.
To determine if the value is a maximum or minimum, plug the value into the [[second derivative]] to determine if the graph is concave or convex at the point. If the second derivative is negative, the graph is concave and the point is a relative maximum. If negative, the graph is convex and the point is a relative minimum.
To find where the derivative of a function is equal to zero, you may need to solve by [[factoring]] or use the [[quadratic formula]].
## Example
What is the maximum volume you can get for an open box constructed by removing squares of size x from each corner of a paper that is 6 cm by 6 cm and folding up the sides?
First, let's write the equation for volume which we want to maximize. Because we're cutting some distance $x$ from each corner to create the box, the length and width of the box will be given by $6-2x$ and the height will be $x$. The formula for volume is the product of length, width and height so we have
$V(x) = (6-2x)(6-2x)(x)$
Expanding the terms we get
$V(x) = 4x^3 - 24x^2 + 36x$
The first derivative is
$V'(x) = 12x^2 - 48x + 36$
which can be factored to
$V'(x) = 12(x^2 - 4x + 3)$
We can use the quadratic formula to set find the values at which $V'(x)$ is equal to zero. Recall the quadratic formula is
$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$
and plugging in our values we get
$x = \frac{4 \pm \sqrt{(-4)^2 - 4*1*3}}{2*1}$
which will solve to $x = 1$, $x=3$. Both of these are within the domain of our problem (any value from $0$ to $3$, which is half the length of each side of the cardboard, is technically feasible).
We can use the second derivative to test whether each point is a maximum or minimum. The second derivate is
$V''(x) = 24x - 48$
Plugging in our solutions we find
$V''(1) = -24$
$V''(3) = 24$
Thus, the value $x = 1$ is a relative maximum. Now we can plug this value back into our original equation to get the maximum volume.
$V(1) = (6 - 2*1)(6 - 2*1)(1) = 16$