Topic 5.10

Write the constraint

Builds on naming the objective and the constraint. 6 minutes.

A pen beside a river

A farmer has 120 m of fence for a rectangular pen beside a river. The river is one side of the pen, so that side needs no fence. The two sides next to the river are \(x\) long, and the side opposite the river is \(y\) long.

Drag \(x\). The bar under the pen lays the fence pieces end to end: two orange pieces of length \(x\), and one piece of length \(y\). Together they fill the 120 m for every \(x\).

The three pieces add up to the fence that the farmer has, so \(x + x + y = 120\). This equation is the constraint.

The constraint links \(x\) and \(y\): when \(x\) grows, \(y\) shrinks, so the two lengths cannot be chosen separately.

Any fence

Take any amount \(F\) of fence. Drag \(x\). The pieces on the bar change in size, and they fill \(F\) for every \(x\).

A constraint is an equation that holds for every shape that the problem allows. Here it is \(x + x + y = F\).

Notation

  1. Draw the situation and name each length that can change.

    \[\cy{x},\ y\]
  2. Find what the problem fixes. It can be a length of fence, a volume, a surface area, a cost, or a curve that a point must stay on.

  3. Write an equation that sets the fixed amount equal to an expression in the variables.

    \[\cy{x} + \cy{x} + y = \cq{120}\]
  4. Count every piece that the problem includes. Leave out any side that the problem says needs no fence, and give every length the same unit.

When it fails

Suppose you write \(2x + 2y = 120\). This counts a fence along the river.

The pen has no fence there. On the bar, that piece is red because the pen does not have it, and it runs past the 120 m mark. A constraint must count only the pieces in the picture.

Example 1: A field with a divider

A farmer has 150 m of fence. The fence goes around a rectangular field, and one more fence divides the field into two pens. The divider is parallel to the short sides. The short sides are \(x\) long and the long sides are \(y\) long. Write the constraint.

  1. List the pieces of fence. Three pieces have length \(x\): the two short sides and the divider. Two pieces have length \(y\), the long sides.

  2. The five pieces add up to the 150 m of fence.

    \[\cy{3x} + 2y = \cq{150}\]
  3. Solve the constraint for \(y\), so that each \(x\) gives one \(y\).

    \[y = 75 - \tfrac32 x\]

    As a check, \(x = 20\) gives \(y = 45\), and \(3(20) + 2(45) = 150\).

Example 2: A point on a parabola

A point \((x, y)\) moves along the parabola \(y = x^2\). The squared distance from the point to \((0, 3)\) is \(d^2 = x^2 + (y - 3)^2\). What restricts \(x\) and \(y\)?

  1. The orange segment is the hypotenuse of a right triangle. Its dashed legs have lengths \(x\) and \(y - 3\), so the squared distance uses both \(x\) and \(y\).

  2. A tempting wrong move: The squared distance is smallest when \(x = 0\) and \(y = 3\), which makes \((0, 3)\) the closest point.

    \[d^2 = 0 \text{ at } (0, 3)\]

    The point \((0, 3)\) is not on the parabola, because the parabola has \(y = 0\) at \(x = 0\). The orange point moves only along the curve, so at \(x = 0\) it sits at \((0, 0)\) and \(d^2 = 9\), not 0.

  3. The point stays on the parabola. This is the constraint, and it ties \(y\) to \(x\).

    \[y = x^2\]

    For example, \(x = 1\) gives the point \((1, 1)\), and \(d^2 = 1 + (1 - 3)^2 = 5\).

Practice

A rectangle has its base on the x-axis. Its two top corners lie on the parabola \(y = 12 - x^2\), and its base runs from \(-x\) to \(x\). Write the height \(h\) of the rectangle in terms of \(x\).

Name the upper right corner \((x, y)\). It lies on the parabola, so its coordinates must fit the equation of the parabola.

Solution
  1. The upper right corner \((x, y)\) lies on the parabola, so \(y = 12 - x^2\). The height of the rectangle is this \(y\), because the base is on the x-axis.

    \[\cy{h} = y = 12 - x^2\]
  2. As a check, \(x = 2\) gives a height of 8. The width is \(2x = 4\), because the base runs from \(-x\) to \(x\).

    \[h = 12 - 2^2 = 8\]

Questions

A farmer builds a rectangular field. The front side is drawn as a double line. It is \(y\) long and costs $6 per meter. The other three sides cost $3 per meter. The two sides next to the front are \(x\) long. The budget is $900.

  1. Which equation is the constraint?

    • \(6x + 9y = 900\)
    • \(6x + 6y = 900\)
    • \(2x + 2y = 900\)
    • \(6x + 12y = 900\)
    Answer

    \(6x + 9y = 900\)

  2. The farmer spends the whole $900, and \(x = 30\) m. What is \(y\)?

    • 80 m
    • 120 m
    • 60 m
    • 720 m
    Answer

    80 m

  3. A can with radius \(r\) cm and height \(h\) cm must hold 2 liters. Which equation is the constraint?

    • \(\pi r^2 h = 2000\)
    • \(\pi r^2 h = 2\)
    • \(2\pi r h = 2000\)
    • \(2\pi r^2 + 2\pi r h = 2000\)
    Answer

    \(\pi r^2 h = 2000\)

Summary

You write the constraint as an equation that sets the fixed amount equal to an expression in the variables.

This works because the fixed amount is the same for every shape that the problem allows, so the equation links the variables.

You use it after you name the objective, and before you substitute it into the objective to leave one variable.

This is one of four skills in topic 5.10 of Which & Why: AP Calculus.