← MathScape

Setting Up Optimization Problems

MATH161
Reference: Stewart 3.7  •  Chapter: 3  •  Section: 7

Navigation: Wiki Home > Skills > Setting Up Optimization Problems

Setting Up Optimization Problems

From Words to Calculus

A farmer has fencing. A company wants to maximize profit. An engineer needs to minimize material costs. These real-world problems share a common structure: something needs to be made as large or as small as possible, subject to constraints.

The power of calculus is that derivatives tell us where functions reach their extreme values. But before you can use derivatives, you must translate the English description into a mathematical function. This translation step—setting up the problem—is often harder than the calculus that follows.

The good news: there's a systematic procedure that works for nearly every optimization problem.

Prerequisite Map

This skill
Setting Up Optimization Problems

Quick Reference

Property Value
Concept Optimization
Chapter 3.7
Difficulty Intermediate
Time ~20 minutes

The Six-Step Procedure

Step 1: Understand the Problem

Read carefully. Ask yourself:

Common words that signal optimization:

Step 2: Draw a Diagram

Most optimization problems have a geometric component. A clear diagram:

Example: Rectangular field along a river

          ┌─────────────────────────────┐
          │                             │
      x   │        Field                │  x
          │                             │
          └─────────────────────────────┘
    ══════════════════════════════════════════
                    RIVER
                    (no fence needed)
                        y

Step 3: Introduce Notation

Assign symbols to:

Use suggestive letters: $A$ for area, $V$ for volume, $t$ for time, $d$ for distance.

Step 4: Write the Objective Function

Express the quantity to optimize in terms of your variables:

$$Q = \text{(expression in terms of variables)}$$

This is your objective function—the function you'll eventually maximize or minimize.

Step 5: Reduce to One Variable

Here's where constraints become crucial. If your objective function has multiple variables, use the given information to eliminate all but one.

Example: If $Q = xy$ and you know $2x + y = 100$, then:

Now $Q$ is a function of $x$ alone, ready for calculus.

Don't forget the domain: What values can your variable actually take? The domain comes from physical constraints (lengths must be positive, angles between 0 and $\pi$, etc.).

Step 6: Solve Using Calculus

This is covered in the next skill: Optimization Solution Methods.

Worked Example: The Fencing Problem

Problem: A farmer has 2400 ft of fencing to enclose a rectangular field along a straight river. No fence is needed along the river. What dimensions maximize the enclosed area?

Step 1: Understand

Step 2: Diagram

          ┌─────────────────────────────┐
          │                             │
      x   │        Field                │  x
          │                             │
          └─────────────────────────────┘
    ══════════════════════════════════════════
                    RIVER
                        y

Step 3: Notation

Step 4: Objective Function

$$A = xy$$

Step 5: Reduce to One Variable

The constraint: fencing = two sides of length $x$ + one side of length $y$

$$2x + y = 2400$$

Solve for $y$: $y = 2400 - 2x$

Substitute into objective:

$$A(x) = x(2400 - 2x) = 2400x - 2x^2$$

Domain: $x$ must be positive. Maximum $x$ occurs when all fencing goes to depth: $2x = 2400 \Rightarrow x = 1200$. So the domain is $0 \le x \le 1200$.

The setup is complete. We have:

$$\boxed{A(x) = 2400x - 2x^2, \quad 0 \le x \le 1200}$$

Common Constraint Types

Constraint Type Example Typical Equation
Perimeter/Fencing Total fencing is 100 ft $2x + 2y = 100$
Fixed Volume Cylinder holds 1 liter $\pi r^2 h = 1000$
Fixed Surface Area Box uses 600 cm² of material $2xy + 2xz + 2yz = 600$
Point on Curve Point lies on $y^2 = 2x$ Substitute $x = \frac{1}{2}y^2$
Pythagorean Right triangle with legs $a^2 + b^2 = c^2$

Practice Problems

Level 1 Identifying the Objective

For each scenario, identify (a) the quantity to be optimized and (b) whether it should be maximized or minimized.

  1. A box with no lid is made from cardboard. The company wants to use the least material.
  2. A rectangular garden has a fixed perimeter. The gardener wants the largest growing space.
  3. A person rows across a river and runs along the shore. They want to arrive quickly.
Thought Process

Look for what matters most in each scenario. "Least," "smallest," "quickly" signal minimization. "Largest," "greatest," "most" signal maximization.

Show Answer
  1. (a) Surface area of box, (b) minimize
  2. (a) Area of garden, (b) maximize
  3. (a) Total travel time, (b) minimize
Level 2 Writing the Constraint Equation

A farmer has 600 meters of fencing to enclose a rectangular area and divide it into three equal pens with fencing parallel to one side. Write the constraint equation relating the length $x$ and width $y$.

    ┌────┬────┬────┐
    │    │    │    │
  y │    │    │    │
    │    │    │    │
    └────┴────┴────┘
           x
Thought Process

Count how many pieces of fence are needed. Looking at the diagram:

  • Two pieces of length $y$ (outer vertical sides)
  • Four pieces of length $x/3$? No—the dividers go the full height.
  • Actually: Two pieces of length $y$ (left and right outer sides)
  • Two pieces of length $x$ (top and bottom)
  • Two internal dividers of length $y$

Total fencing = perimeter + internal dividers.

Show Answer

The fencing consists of:

  • Top and bottom: $2x$
  • Left and right sides: $2y$
  • Two internal dividers: $2y$

Total: $2x + 4y = 600$

Or equivalently: $x + 2y = 300$

Level 3 Complete Setup: Open-Top Box

A box with an open top is made from a 16 cm × 30 cm piece of cardboard by cutting equal squares from each corner and folding up the sides. Set up the volume as a function of one variable and state its domain.

    ┌──┬──────────────────┬──┐
    │x │                  │x │
    ├──┼──────────────────┼──┤
    │  │                  │  │
    │  │     30 cm        │  │
    │  │                  │  │
    ├──┼──────────────────┼──┤
    │x │      16 cm       │x │
    └──┴──────────────────┴──┘
Thought Process

After cutting squares of side $x$ from each corner:

  • The base will be $(30 - 2x)$ by $(16 - 2x)$
  • The height will be $x$

The constraint is built into the setup—the dimensions of the cardboard limit what $x$ can be. For the box to exist, both base dimensions must be positive.

Show Answer

Objective function: $V = \text{length} \times \text{width} \times \text{height}$

$$V(x) = (30 - 2x)(16 - 2x)(x)$$

Expanding: $V(x) = x(480 - 92x + 4x^2) = 4x^3 - 92x^2 + 480x$

Domain:

  • $x > 0$ (must cut something)
  • $16 - 2x > 0 \Rightarrow x < 8$
  • $30 - 2x > 0 \Rightarrow x < 15$

The binding constraint is $x < 8$, so:

$$\boxed{V(x) = 4x^3 - 92x^2 + 480x, \quad 0 < x < 8}$$

Level 4 Distance to a Curve

Find the point on the parabola $y = x^2 + 1$ that is closest to the point $(3, 1)$. Set up the problem completely (objective function in one variable with domain) but do not solve.

Thought Process

The distance from $(3, 1)$ to a point $(x, y)$ on the parabola is: $$d = \sqrt{(x-3)^2 + (y-1)^2}$$

Since $(x, y)$ is on the parabola, we can substitute $y = x^2 + 1$.

A key insight: minimizing $d$ is equivalent to minimizing $d^2$, and $d^2$ is easier to differentiate (no square root).

Show Answer

Let $(x, y)$ be a point on $y = x^2 + 1$.

Distance squared: $$D = (x-3)^2 + (y-1)^2$$

Substitute $y = x^2 + 1$: $$D = (x-3)^2 + (x^2 + 1 - 1)^2 = (x-3)^2 + x^4$$

Expand: $$D(x) = x^2 - 6x + 9 + x^4 = x^4 + x^2 - 6x + 9$$

Domain: All real numbers (the parabola extends infinitely in both directions).

$$\boxed{D(x) = x^4 + x^2 - 6x + 9, \quad x \in \mathbb{R}}$$

Minimizing $D(x)$ gives the same answer as minimizing the actual distance.

Level 5 Inscribed Rectangle in an Ellipse

A rectangle is inscribed in the ellipse $\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1$ with sides parallel to the axes.

(a) Using the symmetry of the ellipse, explain why we can assume the rectangle has vertices at $(\pm x, \pm y)$ for some point $(x, y)$ in the first quadrant.

(b) Express the area as a function of $x$ alone.

(c) Alternatively, express the area using the parametrization $x = a\cos\theta$, $y = b\sin\theta$.

(d) Which setup—(b) or (c)—do you expect will be easier to solve? Explain.

Thought Process

The ellipse has symmetry about both axes. An inscribed rectangle with sides parallel to the axes must share this symmetry, so its center is at the origin.

For part (c), the parametric form of the ellipse is standard: any point on the ellipse can be written as $(a\cos\theta, b\sin\theta)$.

When comparing setups, consider what the derivatives look like. The algebraic approach requires differentiating a square root; the trigonometric approach involves products of sine and cosine.

Show Answer

(a) The ellipse is symmetric about both axes. A rectangle inscribed with sides parallel to the axes inherits this symmetry. If one vertex is at $(x, y)$ in the first quadrant, the others must be at $(-x, y)$, $(-x, -y)$, and $(x, -y)$.

(b) The rectangle has width $2x$ and height $2y$, so: $$A = (2x)(2y) = 4xy$$

Since $(x, y)$ is on the ellipse: $y = b\sqrt{1 - x^2/a^2}$

$$A(x) = 4x \cdot b\sqrt{1 - \frac{x^2}{a^2}} = 4bx\sqrt{1 - \frac{x^2}{a^2}}$$

Domain: $0 \le x \le a$

(c) With $x = a\cos\theta$ and $y = b\sin\theta$: $$A(\theta) = 4(a\cos\theta)(b\sin\theta) = 4ab\cos\theta\sin\theta = 2ab\sin(2\theta)$$

Domain: $0 \le \theta \le \frac{\pi}{2}$

(d) The trigonometric setup is easier. We can immediately see that $\sin(2\theta)$ has maximum value 1 at $\theta = \pi/4$, giving $A_{\max} = 2ab$. No calculus needed!

The algebraic approach requires the quotient rule or product rule with a square root, which is more work.

CCI-Style Conceptual Questions

Level 2 Conceptual: Constraint Interpretation

A farmer uses 200 meters of fencing to create a rectangular pen. If $x$ represents the width and $y$ represents the length, the constraint equation is $2x + 2y = 200$.

Which statement correctly interprets the domain restriction $0 < x < 100$?

(A) The width must be less than the length. (B) The width cannot exceed the total fencing available. (C) If all fencing goes to width, we get $x = 100$, leaving nothing for length. (D) The perimeter formula requires $x < 100$.

Thought Process

The constraint $2x + 2y = 200$ means $x + y = 100$. If $y$ must be positive, then $x < 100$.

Think about extreme cases: What happens if $x = 100$? Then $y = 0$, and there's no pen—just a line.

Show Answer

(C) is correct.

From $x + y = 100$, if $x = 100$, then $y = 0$. This doesn't give a rectangle—just a line segment. For a valid rectangle, we need $y > 0$, which forces $x < 100$.

Mastery Checklist

Mental Model

The Translation Process:

Think of optimization setup like translating between languages:

English Mathematics
"We want to maximize area" Objective: $A = ?$
"given 100 ft of fencing" Constraint: $2x + 2y = 100$
"length must be positive" Domain: $x > 0$

The constraint is the bridge between variables. It lets you express everything in terms of one unknown—and that's when calculus can take over.


Connections

Looking back:

Looking ahead:

Real-world connections:


Previous Up Next
What Derivatives Tell Us Skills Index Optimization Solution Methods

Last updated: 2026-01-22