# Optimization

In calculus, an optimization problem serves to identify an **extreme** value of a (typically continuous) real-valued function on a given interval. A maximum or minimum value may be determined by investigating the behavior of the function and (if it exists) its derivative. Other areas of science and mathematics benefit from this method, and techniques exist in algebra and combinatorics that tackle similar questions.

#### Contents

## Methodology

An extremum is a maximum or minimum value of a function, in some open interval of function inputs. A **critical point** of a differentiable function \(f\) is a point \(x\) for which \(f'(x) = 0\). Any extremum of a differentiable function is a critical point of that function. A non-differentiable function \(g\) may have extrema at any of its points where its derivative is undefined, as well as at its critical points.

Then, if \(f'(r_i) = 0\) for \(i = 1, \, \dots, \, n\), the maximum and minimum values of a differentiable function \(f\) in the closed interval \([a, \, b]\) each are one of \(f(a), \, f(r_1), \, \dots, \, f(r_n), \, f(b)\).

For what value of \(x\) is \(f(x) = 96\sqrt{x} - 6x \) maximized on the interval \([0, \, 100]?\)

Because \(f'(x) = 48x^{-1/2} - 6\) has one root \(x = 64\), \(f\) has an extremum at \(x = 64\), and the maximum value of \(f\) on the interval \([0, \, 100]\) must be obtained at \(x = 0, \ 64, \text{ or } 100\).

Simply plugging in each possible value yields \(f(0) = 0\), \(f(64) = 404\), and \(f(100) = 360\). Therefore, \(\boxed{x = 64}\) maximizes \(f\) on the interval \([0, \, 100].\ _\square\)

Note that a differentiable function defined over all real numbers attains a **global** maximum (if it exists) and a **global** minimum (if it exists) at a root of its derivative. For instance, a quadratic function obtains its maximum (or minimum, depending on orientation) value at its vertex, as can be verified by non-calculus means.

For a piecewise differentiable function, the points of non-differentiability may also be extrema. Consider the following example:

For what values of \(x\) is \(f(x) = |x^2 - 2x| \) maximized or minimized in the interval \([-1, \, 3]?\)

Note that \(f(x)\) is not differentiable at \(x = 0\) and \(x = 2\), and its derivative (where defined) has value \(0\) only at \(x = 1\). Because \(x = -1\) and \(x = 3\) are endpoints, those \(x\)-values could also maximize of minimize \(f(x)\).

Upon checking each value against the above graph, \(\boxed{x = -1}\) and \(\boxed{x = 3}\) maximize \(f(x)\), and \(\boxed{x = 0}\) and \(\boxed{x = 2}\) minimize \(f(x)\). \(_\square\)

Even though \(x = 1\) is a local maximum, it is not a maximum in the given interval, since \(f(1) = 1 < f(3) = f(-1) = 3\).

Do local extrema occur only if \(f'(x) = 0?\) See here.

## Derivative Tests

For most optimization problems, it is important to determine a maximum and **not** a minimum or to determine a minimum and **not** a maximum. However, the purely formulaic approach outlined above does not provide a distinction between extrema (maxima and minima), potentially leading to some startlingly wrong answers. As seen above, one way to circumvent this problem is to calculate each possible value. The first and second derivative tests provide other solutions to this ambiguity.

**The First Derivative Test**. Suppose \(f\) is a real-valued function and \([a, \, b]\) is an interval on which \(f\) is defined and differentiable. Then, if \(c\) is a critical point of \(f\) in \([a, \, b]\),

- if \(f'(x) > 0\) for all \(x < c\) and \(f'(x) < 0\) for all \(x > c\), then \(f(c)\) is the maximum value of \(f\) in the interval \([a, \, b];\)
- if \(f'(x) < 0\) for all \(x < c\) and \(f'(x) > 0\) for all \(x > c\), then \(f(c)\) is the minimum value of \(f\) in the interval \([a, \, b].\)

In simpler terms, a point is a maximum of a function if the function increases before and decreases after it. Conversely, a point is a minimum if the function *decreases* before and increases after it.

**The Second Derivative Test**. Suppose \(f\) is a real-valued function and \([a, \, b]\) is an interval on which \(f\) is defined and twice-differentiable. Then, if \(c\) is a critical point of \(f\) in \([a, \, b]\),

- if \(f''(x) < 0\) for all \(x\) in \([a, \, b]\), then \(f(c)\) is the maximum value of \(f\) in the interval \([a, \, b];\)
- if \(f''(x) > 0\) for all \(x\) in \([a, \, b]\), then \(f(c)\) is the minimum value of \(f\) in the interval \([a, \, b].\)

In simpler terms, a point is a maximum of a function if the function is concave down, and a point is a minimum of a function if the function is concave up.

Often, both tests will be applicable, and the only real difference will be the amount of calculation required to verify the conditions hold. However, if the first derivative test does not hold, then the second derivative test will not hold either. In such a case, it is best to test all possible extrema, as explained above, and it is easiest to see whether or not the tests will hold by graphing (or otherwise visualizing) the given function on the given interval.

## Applications

The true usefulness of optimization problems becomes clear through their applications. Geometry contains many examples of optimality. Economists' language of utility allows finance and business questions to be solved by methods outlined in this article, and many areas of mathematics and physics impose constraints on problems that may be similarly approached (perhaps with a somewhat generalized optimization). In all such examples, the function must be constructed before the technique can be applied.

A shop sells \(500\) smartphones a week for \($450\) each. A market survey shows that each decrease of \($5\) on the price will result in the sale of an additional \(10\) smartphones per week. What price of the smartphone would result in maximum revenue?

**Details and Assumptions:**

- The revenue is defined as the product of the number of items sold and the price of each item.

A cylinder made of an iron plate can contain \(2000 \text{ cm}^3\) of liquid.

What is the radius of the cylinder (in cm) that minimizes the use of the iron plate?

(Suppose the thickness of the iron plate is negligible.)

A container box open on top is to be made from (18 inches) x (18 inches) galvanized flat sheet metal by cutting equal squares out of the corners and turning up the sides.

Find the largest box (in cubic inches) that can be made in this way.

**Note:** Neglect the thickness of the galvanized flat sheet metal.

## See Also

**Cite as:**Optimization.

*Brilliant.org*. Retrieved from https://brilliant.org/wiki/optimization-problems/