Maxima & Minima

Now that we have a good idea of how to perform curve sketching, we can now consider one of the most useful applications of differential calculus: Finding maxima and minima. In short, solving max-min problems, the most common forms of an optimization problem.

Consider the following problem:

problem. Suppose we have a wire of length 1.{1.} The wire is cut into two pieces, and each piece must enclose a square. What is the largest area that can be enclosed?

To solve this problem, we want to first draw a diagram of the wire:

Wire diagram

Next, since we're trying to find the area, we want to express the area as a formula:

A(x)=(x4)2+(1x4)2 A(x) = \left( \dfrac{x}{4} \right)^2 + \left( \dfrac{1-x}{4} \right)^2

Once we have this formula, the most intuitive and straightforward way to solve the problem is to find the critical points. In other words, solving for:

A(x)=0 A'(x) = 0

Computing the derivative:

A(x)=x81x8=x+x18=2x18 \begin{aligned} A'(x) = \dfrac{x}{8} - \dfrac{1-x}{8} \\ &= \dfrac{x + x - 1}{8} \\ &= \dfrac{2x - 1}{8} \end{aligned}

Solving for x{x} where A(x)=0:{A'(x) = 0:}

2x18=02x1=0x=12 \begin{aligned} \dfrac{2x - 1}{8} &= 0 \\ 2x - 1 &= 0 \\ x &= \dfrac{1}{2} \end{aligned}

Accordingly, we have the critical point x=1/2.{x = 1/2.} The critical value then is:

A(1/2)=(1/24)2+(1(1/2)4)2=(18)2+(18)2=164+164=264=132 \begin{aligned} A(1/2) &= \left( \dfrac{1/2}{4} \right)^2 + \left( \dfrac{1-(1/2)}{4} \right)^2 \\[1em] &= \left( \dfrac{1}{8} \right)^2 + \left(\dfrac{1}{8}\right)^2 \\[1em] &= \dfrac{1}{64} + \dfrac{1}{64} \\[1em] &= \dfrac{2}{64} \\[1em] &= \dfrac{1}{32} \end{aligned}

And with that, we're done. We hand our results in, and two weeks later, we get an email: "We used the measurements sent, and there has to be some mistake. These are the tiniest squares we've ever made." Confusion sets in. Did we do something wrong? We double-check our work, and everything is right. We slowly realize, however, that we didn't check the end points. Given our function A(x)=x4+1x4,{A(x) = \dfrac{x}{4} + \dfrac{1-x}{4},} we know that the domain is: 0<x<1.{0 < x < 1.} If we examine the limits:

A(0+)=0+(14)2=116A(1)=(14)2+0=116 A(0^+) = 0 + \left(\dfrac{1} {4}\right)^2 = \dfrac{1} {16} \\[1em] A(1^-) = \left(\dfrac{1} {4}\right)^2 + 0 = \dfrac{1} {16}

At this point, it should be clear what we've just done. The critical value we calculated is 132,{\dfrac{1}{32},} and the endpoints are 116{\dfrac{1}{16}} and 116.{\dfrac{1}{16}.} So the graph actually looks like:

Failed optimization

We didn't find the largest possible area; we found the smallest. Not the max, but the min. This demonstrates a critical practice point in solving solving optimization problems:

postulate. The maximum or minimum value does not always occur when the first derviative is 0.{0.} The function's value at the endpoints of the interval considered for global maxima and minima must always be considered.

Warning on maxima and minima

Let's consider another example:

problem. Let b{b} be a box without a top. Find the least surface area for b{b} given a fixed a volume.

Again we start with a diagram:

Starting diagram

Next, we specify the formulas. For the volume, we have:

Vb=xyz V_b = xyz

For the surface area, we have one bottom and four sides: Ab=xz+yx+yx+yz+yz=xz+2yx+2yzA_b = xz + yx + yx + yz + yz = xz + 2yx + 2yz

This surface area formula is pretty ugly. It contains three spearate variables in three separate terms. Is there any way to reduce the number of variables present? Well, let's start by asking why we even have three variables in the first place. We have three variables because we don't know the length, width, or height of this box. But couldn't the box have a square bottom? In which case we'd just have two variables — x{x} and y.{y.}

That would certainly simplify the problem, but for us to take that route, it must be true that a square bottom has a smaller perimeter rather than a rectangular bottom. Otherwise we wouldn't have the smallest possible surface area. Let's state the problem:

problem. Given a rectangle R{R}'s perimeter P,{P,} what are the smallest possible dimensions of R?{R?}

Once more we start with a diagram:

Optimized perimeter

Expressing the rectangle's perimeter as a formula:

PR=2x+2y P_R = 2x + 2y

We want to find the minimum perimeter, so we differentiate P{P} with respect to x{x} and solve for dPRdx=0.{\dfrac{dP_R}{dx} = 0.}

dPRdx=0ddx(2x+2y)=0ddx2x+ddx2y=01+dydx=01+(yx)=0xyx=0xy=0x=y \begin{aligned} \dfrac{dP_R} {dx} = 0 \\[1em] \dfrac{d} {dx}(2x + 2y) = 0 \\[1em] \dfrac{d} {dx}2x + \dfrac{d} {dx}2y = 0 \\[1em] 1 + \dfrac{dy} {dx} = 0 \\[1em] 1 + \left( - \dfrac{y} {x} \right) = 0 \\[1em] \dfrac{x - y} {x} = 0 \\[1em] x - y = 0 \\[1em] x = y \end{aligned}

Looking at that result, we see that a rectangle with the smallest possible area is, in fact, a square, since x{x} (the width) is equal to y{y} (the height). So, we can revise the diagram we started out with:

Revised box optimization

Now we just have two variables, and our equations are much simpler:

V=x2yA=x2+4xy \begin{aligned} &V = x^2y\\[1em] &A = x^2 + 4xy \end{aligned}

We still have several unknowns in our problem: x{x} and y.{y.} This is still a good amount of complexity. Fortunately, the problem contains a constraint — the volume is fixed. This means that the quantiy V=x2y{V = x^2y} never changes. This in turn means that we can solve for y{y} through V:{V:}

V=x2yy=Vx2 \begin{aligned} V = x^2y \\[1em] y = \dfrac{V}{x^2} \end{aligned}

We can then substitute y{y} into the area formula:

A=x2+4xy=x2+4x(Vx2)=x2+4Vx \begin{aligned} A &= x^2 + 4xy \\[1em] &= x^2 + 4x\left(\dfrac{V}{x^2}\right) \\[1em] &= x^2 + \dfrac{4V}{x} \end{aligned}

Now we're in a good spot to differentiate:

A=2x4Vx2 A' = 2x - \dfrac{4V}{x^2}

Setting A=0{A' = 0} and solving for x:{x:}

2x4Vx2=02x=4Vx22x3=4Vx3=2Vx=2V3=213V13 \begin{aligned} 2x - \dfrac{4V}{x^2} &= 0 \\[1em] 2x &= \dfrac{4V}{x^2} \\[1em] 2x^3 &= 4V \\[1em] x^3 &= 2V \\[1em] x &= \sqrt[3]{2V} = 2^{\frac{1}{3}}V^{\frac{1}{3}} \end{aligned}

We now have our critical point:

x=213V13 x = 2^{\frac{1}{3}}V^{\frac{1}{3}}

As we saw earlier, we aren't done. We have no idea whether this critical point corresponds to the maximum value or the minimum value. So we have to check the endpoints. So what are the endpoints for x?{x?} We know that it cannot be negative — a rectangle cannot have negative dimensions:

0<x0 < x

And the upperbound? It's +;{+\infty;} x{x} could be anything:

0<x<+ 0 < x < +\infty

Now that we have the endpoints, we can evalaute:

A(0+)=x2+4Vxx=0+=+ \left. A(0^+) = x^2 + \dfrac{4V}{x} \right\vert_{x = 0^+} = +\infty

Ok, so at the lower endpoint, we get a box with infinite area. That's not what we want, so let's consider the other upper endpoint:

A(+)=x2+4Vxx=+=+ \left. A(+\infty) = x^2 + \dfrac{4V}{x} \right\vert_{x = +\infty} = +\infty

This tells us that we've found a minimum. The critical point we've found does, in fact, correspond to the smallest possible area:

x=213V13x=2(x2y)3x3=2x2yx=2yxy=2 \begin{aligned} x &= 2^{\frac{1}{3}}V^{\frac{1}{3}} \\[1em] x &= \sqrt[3]{2(x^2y)} \\[1em] x^3 &= 2x^2y \\[1em] x &= 2y \\[1em] \dfrac{x}{y} &= 2 \end{aligned}

The smallest possible area of a lidless box with a fixed volume V{V} will have the bottom dimensions x{x} by x,{x,} where x{x} is twice the box's height. In other words, a 2:1{2:1} box.

With a function's sketch, it's easy to find maxima and minima:

Sketching of max and min

The trouble is, sketching is a lot of work. We don't want to always have to sketch just to find a maximum and minimum — it's too time consuming. Fortunately, there's a faster way to finding maxima and minima. We just need to examine a few facts about the function:

  1. Criticial points,
  2. endpoints, and
  3. points of discontinuity

To illustrate, consider the graph of the following function:

Sample function

There are five possible places the minimum or maximum might be:

  1. (0,0){(0,0)}
  2. (e,e){(e,e)}
  3. x+{x \to +\infty}
  4. x{x \to -\infty}
  5. y{y \to -\infty}

Only one out of these five places is a critical point.