Kim’s Math NotesCourse index

Introduction to Optimization Problems

How do I choose an objective function and its feasible domain?

Set up an optimization problem as one function of one variable with its domain, then find the largest or smallest value, ends included.

No domain, no comparing

Common mistake V′=0 at 2 and 6, so take x=2.

Correction Domain 0≤x≤6: candidates 0, 2, 6. Compare V: 0, 128, 0.

Setting it up: one variable

Name the parts. The two short sides are x. The side along the river is y. What we want as big as possible is the area: x times y. What we're stuck with is the fence.

Walk along it: x, plus x, plus y, is six hundred.

Watch this part of the concept lesson

Read the rest of this scene

Two variables is one too many. The fence trades one for the other: y equals six hundred minus two x. Same move as related rates: the rule drops a variable. Put it into the area. A of x is x times the quantity six hundred minus two x.

Multiply out: six hundred x, minus two x squared. Now it's one variable. The formula we want to maximize is the objective. The rule it has to obey is the constraint.

Domain first, then the derivative

Before any derivative, ask: which x even make sense? x can't be negative, and the river side, six hundred minus two x, can't be either. So x runs from zero to three hundred. Try x equals four hundred: y is negative two hundred. That's not a fence.

The derivative is six hundred minus four x.

Watch this part of the concept lesson

Read the rest of this scene

It's zero at x equals one fifty. It's a closed domain, so compare the candidates. A of zero is zero. A of one fifty is forty-five thousand. A of three hundred is zero.

Here's the area as x slides from zero to three hundred. The square sits here, at forty thousand. The top is here, at forty-five thousand. The river side is free, so the best field is not a square. It's one hundred fifty by three hundred: forty-five thousand square meters.

And the ends stay on the list. In some problems, the winner sits at an end.

Five steps for any optimization

So here's the recipe, in five steps. Step one: draw the picture, and name the parts. Step two: write the max or min quantity as one formula, the objective. Step three: the rule you're stuck with, the constraint, cuts it down to one variable. Step four: the domain comes from the picture.

Lengths can't go negative.

Watch this part of the concept lesson

Read the rest of this scene

Step five: inside the domain, find where the derivative is zero, or doesn't exist. If the domain is closed, compare those points with the ends, the candidates test from before. The biggest or smallest value wins.

The setup mistake

Differentiate A equals x y while y is still in it, and you're stuck. Some people even differentiate the fence rule. That finds nothing. Cut down to one variable first. Then differentiate the objective, A of x, and only that.

Watch this part of the concept lesson

Example 1: the open box

Example one. Start with a square sheet of cardboard, twelve inches on a side. Cut an x by x square from each corner, fold up the sides, and you get an open box. What x gives the largest volume, and what is that volume? The plan: write the volume as a function of x, find its domain, then set V prime to zero and compare the candidates.

Fold up the flaps into a box.

Watch this part of the concept lesson

Read the rest of this scene

Its height is the cut: x. The base started twelve wide, minus x off the left, minus x off the right: twelve minus two x. Volume is base area times height: V of x equals x times twelve minus two x, squared. The cut can't be negative, and the base side can't be either. So x runs from zero to six.

Your move next: set V prime equal to zero, then compare. Multiply it out first, so we don't need the product rule: V equals four x cubed, minus forty-eight x squared, plus one forty-four x. V prime is twelve x squared, minus ninety-six x, plus one forty-four. Pull out twelve and factor: twelve times x minus two, times x minus six. It's zero at two and at six.

Six is already an end of the domain. It's on the list either way. V of zero is zero. V of two is two times eight squared: one twenty-eight. V of six is zero.

Here's V on the whole domain. Comparing all three is the reason two wins. Cut two-inch squares, and the largest volume is one hundred twenty-eight cubic inches. In your workbook, you'll get a ten by sixteen sheet. Same steps.

Example 2: the closest point

Example two. Find the point on the curve y equals root x that's closest to the point three, zero. The plan: write the distance squared in terms of x, and set its derivative to zero. Watch why we square it. Take any point on the curve. If its x-coordinate is x, its height is root x.

The distance d to three, zero: by the distance formula, d squared is x minus three, squared, plus root x minus zero, squared. Don't take the big square root. Distance is never negative, so the smallest d comes at the same x as the smallest d squared. Call the squared distance D of x.

Watch this part of the concept lesson

Read the rest of this scene

No big square root, no messy chain rule. Your move: simplify D, then take D prime. Clean up D. x minus three, squared, plus root x squared, which is just x. So D of x is x squared minus five x plus nine.

For the domain, root x needs x to be at least zero. D prime is two x minus five. Zero at x equals five halves. How do we know it's the smallest? D is a parabola that opens up, so its vertex is the lowest point anywhere.

The left end, x equals zero, gives D of zero equals nine. Bigger. D of five halves: twenty-five fourths, minus twenty-five halves, plus nine. That's eleven fourths. Remember, D was distance squared. So the closest distance is root eleven over two.

And the closest point on the curve is five halves, root five halves. There's no right end here, and the parabola settled it. When there's no shape to lean on, that's next lesson. In your workbook, find the closest point to two, zero.

Example 3: the largest rectangle

Example three. A rectangle sits on the x-axis, with its two top corners on y equals twelve minus x squared. What is its largest possible area? The plan: area as a function of x, on a closed domain. Then compare the candidates. Put the top-right corner on the curve at x.

Its height is twelve minus x squared.

Watch this part of the concept lesson

Read the rest of this scene

From the y-axis, it's x to the right, and another x to the left. So it's two x, not x. The height is the curve's height: twelve minus x squared. Width times height: A of x is two x times twelve minus x squared, or twenty-four x minus two x cubed. At x equals zero, there's no width.

Slide right until twelve minus x squared is zero, at root twelve: no height. So x runs from zero to root twelve, ends included. Your move: set A prime equal to zero, then compare. A prime is twenty-four minus six x squared. Set it to zero.

Then x squared is four, so x is plus or minus two. Negative two is outside the domain. Throw it out. A of zero is zero. A of two is width four times height eight, thirty-two. A of root twelve is zero.

Compare: zero, thirty-two, zero. The largest area is thirty-two, with the rectangle four wide and eight tall. In your workbook, you'll get a rectangle under a semicircle. Same steps.

Worked examples

Example 1

A 12 in by 12 in square sheet. Cut an x by x square from each corner and fold up the sides into an open box.
What x gives the largest volume? What is it?
Hint

Volume as one function of x, its domain, then compare V′=0 with the ends.

Answer and solution
  1. 2
  2. 128
  1. V(x)=x(12−2x)2,0≤x≤6
  2. V′(x)=12x2−96x+144=12(x−2)(x−6)=0→x=2,6
  3. V(0)=0,V(2)=2⋅82=128,V(6)=0
  4. The largest volume is 128 in^3, at x=2 in.

Example 2

Find the point on the curve y=x that is closest to the point (3,0).
xy1234512(3,0)
Graph
Hint

A smaller distance means a smaller distance squared: minimize D=d2.

Answer and solution

Answer (52,52)

  1. A point on the curve: (x,x). d2=(x−3)2+(x)2.
  2. D(x)=x2−6x+9+x=x2−5x+9,x≥0
  3. D′(x)=2x−5=0→x=52(an upward parabola: the minimum)
  4. The closest point is (52,52), at distance 114=112.

Example 3

A rectangle sits on the x-axis,
with its two top corners on y=12−x2.
What is its largest possible area?
xy-4-22424681012(x,\ 12-x^2)
Graph
Hint

Plan: A(x) → candidates

Answer and solution

Answer 32

  1. Width 2x, height 12−x2; the domain 0≤x≤12 is closed.
  2. A(x)=2x(12−x2)=24x−2x3,A′(x)=24−6x2=0→x=2
  3. Candidates: A(0)=0, A(12)=0, A(2)=4⋅8=32. The largest area is 32.

Workbook

Problem 1

Two nonnegative numbers have a sum of 12. Find the numbers that make the product of the square of one number and the other number as large as possible.
Hint

Call the numbers x and 12−x. Maximize P(x)=x2(12−x) on [0,12].

Answer and solution

Answer 8 and 4 (product 256)

  1. P(x)=x2(12−x),0≤x≤12
  2. P′(x)=24x−3x2=3x(8−x)=0→x=0,8
  3. P(0)=0,P(8)=256,P(12)=0
  4. The numbers are 8 and 4 (product 256).

Common mistake Maximizing the sum or the plain product.

Watch the worked solution to Problem 1

Problem 2

A farmer has 240 m of fence for a rectangular pen. A fence parallel to one side divides the pen into two parts. What dimensions give the largest total area?
Hint

Three fences of length x and two of length y: 3x+2y=240. Write the area in one variable.

Answer and solution

Answer 40 m by 60 m, area 2400 m^2

  1. 3x+2y=240→y=120−32x,A(x)=x(120−32x),0≤x≤80
  2. A′(x)=120−3x=0→x=40,A(0)=0,A(40)=2400,A(80)=0
  3. 40 m by 60 m, with area 2400 m^2.

Common mistake Using 2x + 2y = 240 without the middle fence.

Watch the worked solution to Problem 2

Problem 3

An open box is made from a 10 in by 16 in sheet by cutting a square of side x from each corner and folding up the sides. What is the domain of the volume function V(x)?
  1. x>0
  2. 0≤x≤5
  3. 0≤x≤8
  4. 0≤x≤10
Hint

Each length must be at least 0: x≥0 and 10−2x≥0.

Answer and solution

Answer B. 0≤x≤5

  1. The sides of the base are 10−2x and 16−2x; both must be at least 0, and x≥0.
  2. 10−2x≥0 gives x≤5. So 0≤x≤5. Answer B.

Common mistake Taking 0 <= x <= 8 from the 16-inch side.

Watch the worked solution to Problem 3

Problem 4

Find the point on the curve y=x that is closest to the point (2,0).
Hint

Minimize the square of the distance: D(x)=(x−2)2+x.

Answer and solution

Answer (32,32)

  1. D(x)=(x−2)2+(x)2=x2−3x+4,x≥0
  2. D′(x)=2x−3=0→x=32(an upward parabola: the minimum)
  3. The closest point is (32,32).

Common mistake Minimizing D(x) without squaring, or forgetting the point's y = sqrt(x).

Watch the worked solution to Problem 4

Problem 5

The open box from the 10 in by 16 in sheet has volume V(x)=x(10−2x)(16−2x) for 0≤x≤5. Find the largest possible volume. Justify your answer.
Hint

Solve V′(x)=0 and keep only the roots in [0,5]. Compare with the ends.

Answer and solution

Answer 144 in^3, at x = 2

  1. V′(x)=12x2−104x+160=4(3x−20)(x−2)
  2. x=203>5 is outside the domain. Candidates: x=0,2,5.
  3. V(0)=0,V(2)=2⋅6⋅12=144,V(5)=0
  4. The largest volume is 144 in^3, at x=2.

Common mistake Keeping the root 20/3, which is outside the domain.

Watch the worked solution to Problem 5

Problem 6

A rectangle has its base on the x-axis and its upper corners on the semicircle y=4−x2. Find the largest possible area of the rectangle.
Hint

Upper corner (x,4−x2): area A(x)=2x4−x2 on [0,2].

Answer and solution

Answer 4

  1. A(x)=2x4−x2,0≤x≤2
  2. A′(x)=24−x2−2x24−x2=8−4x24−x2=0→x=2
  3. A(0)=0,A(2)=22⋅2=4,A(2)=0
  4. The largest area is 4.

Common mistake Using x as the full width instead of half of it.

Watch the worked solution to Problem 6