16

Day 16

Optimization


Optimization

Optimization problems ask for the best possible outcome — maximum area, minimum material, shortest distance — subject to some constraint. Every single one reduces to the exact same idea: turn a two-variable problem into a one-variable function, then find its absolute extremum.

Core Theorem
Steps for Optimization:
(1) Draw a diagram and label all quantities.
(2) Write the primary equation — the quantity you're optimizing — in terms of two variables.
(3) Write a constraint equation relating those variables, solve for one, and substitute into the primary equation so it depends on only one variable.
(4) Find the absolute extremum of that single-variable function (closed interval method, or First/Second Derivative Test).
Watch the TikTok ExplanationOptimization Problems
Step-by-Step SOP
  1. 1

    Draw a Diagram and Label Everything

    Identify all the quantities involved and give each one a variable name.
  2. 2

    Write the Primary and Constraint Equations

    Primary: the quantity to optimize, in terms of two variables. Constraint: a relationship between those variables, from the physical setup.
  3. 3

    Reduce to One Variable and Optimize

    Solve the constraint for one variable, substitute into the primary equation, then find its absolute extremum using the derivative tests you already know.

Practice Exercises


Example 01Medium
A farmer has 1200 m of fencing to enclose a rectangular field along a river (no fence is needed on the side facing the river). Find the dimensions that maximize the enclosed area.
NEED A HINT?
Let xx be the width of the two perpendicular sides and yy the length parallel to the river. The constraint only counts 3 sides of fencing.
SHOW DETAILED EXPLANATION

Step 1: Write the Constraint and Primary Equation

Constraint: 2x+y=1200    y=12002x2x+y=1200 \implies y=1200-2x. Primary equation: A=xyA = xy.

Step 2: Reduce to One Variable

A(x)=x(12002x)=1200x2x2A(x) = x(1200-2x) = 1200x-2x^2, for 0<x<6000<x<600.

Step 3: Find the Critical Point

A(x)=12004x=0    x=300A'(x) = 1200-4x = 0 \implies x=300.

Step 4: Confirm the Maximum and State Dimensions

A(x)=4<0A''(x)=-4<0, confirming a maximum. y=1200600=600y=1200-600=600. Maximum area =300×600=180,000 m2=300 \times 600 = 180{,}000\ \text{m}^2.
Example 02Medium
A 12×12 inch sheet of aluminum has a square of side xx cut from each corner, and the sides are folded up to form an open-top box. Find xx that maximizes the volume.
NEED A HINT?
The base becomes a (122x)(12-2x) by (122x)(12-2x) square, and the box height is xx.
SHOW DETAILED EXPLANATION

Step 1: Write the Volume Function

V(x)=x(122x)2V(x) = x(12-2x)^2, for 0<x<60<x<6.

Step 2: Differentiate and Factor

V(x)=(122x)24x(122x)=(122x)[(122x)4x]=(122x)(126x)V'(x) = (12-2x)^2 - 4x(12-2x) = (12-2x)\left[(12-2x)-4x\right] = (12-2x)(12-6x).

Step 3: Find Critical Points in the Domain

x=6x=6 is an endpoint (excluded), so the only interior critical point is x=2x=2.

Step 4: Confirm and Compute

V(0)=V(6)=0V(0)=V(6)=0, and V(2)=2(8)2=128 in3V(2) = 2(8)^2 = 128\ \text{in}^3 — the maximum volume, achieved by cutting 22-inch squares.
Example 03Hard
A cylindrical can must hold exactly 1000 cm31000\ \text{cm}^3. Find the dimensions that minimize the amount of material (surface area) used.
NEED A HINT?
Solve the volume constraint for hh in terms of rr first, then substitute into the surface area formula so it depends only on rr.
SHOW DETAILED EXPLANATION

Step 1: Write the Constraint and Primary Equation

V=πr2h=1000    h=1000πr2V = \pi r^2 h = 1000 \implies h = \dfrac{1000}{\pi r^2}. Surface area: S=2πr2+2πrhS = 2\pi r^2 + 2\pi r h.

Step 2: Reduce to One Variable

S(r)=2πr2+2000rS(r) = 2\pi r^2 + \dfrac{2000}{r}.

Step 3: Differentiate and Solve

S(r)=4πr2000r2=0    r3=500π    r=(500π)1/35.42 cmS'(r) = 4\pi r - \dfrac{2000}{r^2} = 0 \implies r^3 = \dfrac{500}{\pi} \implies r = \left(\dfrac{500}{\pi}\right)^{1/3} \approx 5.42\ \text{cm}.

Step 4: Find h and Observe the Classic Result

h=1000πr2h = \dfrac{1000}{\pi r^2}. Substituting r3=500πr^3=\frac{500}{\pi} shows h=2rh=2r exactly — the optimal can always has height equal to its diameter.
Example 04Hard
Find the point on the curve y2=2xy^2 = 2x closest to the point (1,4)(1,4).
NEED A HINT?
Minimize the squared distance D2=(x1)2+(y4)2D^2=(x-1)^2+(y-4)^2 after substituting x=y22x=\frac{y^2}{2} so it depends only on yy.
SHOW DETAILED EXPLANATION

Step 1: Write the Squared Distance in Terms of y

Since x=y22x=\frac{y^2}{2}: D2(y)=(y221)2+(y4)2D^2(y) = \left(\frac{y^2}{2}-1\right)^2 + (y-4)^2.

Step 2: Differentiate

d(D2)dy=y(y22)+2(y4)=y32y+2y8=y38\frac{d(D^2)}{dy} = y(y^2-2) + 2(y-4) = y^3-2y+2y-8 = y^3-8.

Step 3: Solve for the Critical Point

y38=0    y=2y^3-8=0 \implies y=2, so x=42=2x=\frac{4}{2}=2.

Step 4: Confirm and State the Answer

d2(D2)dy2=3y2>0\frac{d^2(D^2)}{dy^2}=3y^2>0 at y=2y=2, confirming a minimum. The closest point is (2,2)(2,2), at distance (21)2+(24)2=5\sqrt{(2-1)^2+(2-4)^2}=\sqrt{5}.
Example 05Medium
A company's revenue and cost functions are R(x)=50x0.01x2R(x)=50x-0.01x^2 and C(x)=200+20x+0.005x2C(x)=200+20x+0.005x^2 (in dollars, for xx units). Find the production level that maximizes profit.
NEED A HINT?
Profit is P(x)=R(x)C(x)P(x)=R(x)-C(x) — maximize it like any other single-variable function. You should find that the maximum occurs exactly where marginal revenue equals marginal cost.
SHOW DETAILED EXPLANATION

Step 1: Write the Profit Function

P(x)=R(x)C(x)=(50x0.01x2)(200+20x+0.005x2)=30x0.015x2200P(x) = R(x)-C(x) = (50x-0.01x^2)-(200+20x+0.005x^2) = 30x-0.015x^2-200.

Step 2: Differentiate and Solve

P(x)=300.03x=0    x=1000P'(x) = 30-0.03x = 0 \implies x=1000.

Step 3: Confirm the Maximum

P(x)=0.03<0P''(x)=-0.03<0, confirming a maximum at x=1000x=1000 units — exactly the production level where R(x)=C(x)R'(x)=C'(x) (marginal revenue equals marginal cost).
Example 06Hard
A store sells 200 units of a product per week at 350 dollars each. For every 10-dollar price decrease, weekly sales increase by 20 units. Find the price that maximizes revenue.
NEED A HINT?
Let xx be the number of 10-dollar price decrements. Write price and quantity both in terms of xx, then maximize their product.
SHOW DETAILED EXPLANATION

Step 1: Set Up Price and Quantity in Terms of x

Price =35010x=350-10x. Quantity =200+20x=200+20x.

Step 2: Write the Revenue Function

R(x)=(35010x)(200+20x)=70000+5000x200x2R(x) = (350-10x)(200+20x) = 70000+5000x-200x^2.

Step 3: Differentiate and Solve

R(x)=5000400x=0    x=12.5R'(x) = 5000-400x = 0 \implies x=12.5.

Step 4: Confirm and State the Answer

R(x)=400<0R''(x)=-400<0 confirms a maximum. New price =350125=225= 350-125 = 225 dollars, and maximum revenue =R(12.5)=101,250=R(12.5) = 101{,}250 dollars.
Common Pitfalls
  • Always Reduce to a Single Variable Before DifferentiatingThe primary equation almost always starts with two variables — don't differentiate until you've used the constraint to eliminate one of them.
  • Don't Skip Confirming Max vs. MinSolving f(x)=0f'(x)=0 only gives a candidate — use the Second Derivative Test (or check the domain's endpoints) to confirm it's actually the maximum or minimum you want, not the opposite.
  • State the Domain RestrictionsPhysical quantities like side lengths or radii must stay positive — always identify the valid domain (e.g. 0<x<60<x<6 for the box problem) before hunting for extrema, since it can rule out spurious critical points.
Gary Chang

Gary Chang

Calculus Educator

5+ Years of Calculus Teaching Experience | AP Calculus Specialist. Dedicated to helping students master calculus through step-by-step logic and clear visualizations.