Case Study 1 — The Coffee Roaster's Order Size: Optimization in Operations
Field: Operations management / business economics Section anchors: §10.2 (objective vs. constraint), §10.11 (Economic Order Quantity), §10.15 (verifying a global minimum)
The Situation
Maya runs a mid-sized specialty coffee roaster. Every year her shop sells through a steady $D = 18{,}000$ pounds of green (unroasted) Colombian beans — her best-seller, moving at a remarkably even pace because it anchors the house blend. She buys the beans from an importer who charges a flat ordering fee of $K = \$90$** every time she places an order, no matter the size: this covers the freight booking, the customs paperwork, the quality-inspection sample, and the day of her assistant's time spent reconciling the shipment. On top of that, beans sitting in her climate-controlled warehouse cost her money. Between the financing on the capital tied up, the warehouse rent allocated per pound, insurance, and the slow staling of green coffee, she estimates a **holding cost of $h = \$3$ per pound per year.
Maya's instinct, like most small-business owners, has been to order in big batches "to save on shipping." She currently orders 3,000 pounds at a time, six times a year. Her bookkeeper, fresh out of a business calculus course, suspects this is wrong in both directions — too large to be cheap, but arrived at by gut rather than by math. The question they sit down to answer is the oldest question in inventory management: how many pounds should Maya order at a time to make her total annual logistics cost as small as possible?
This is a textbook optimization problem, and working it carefully shows every move from §10.3 in a real commercial setting.
Step 1 — Naming the Objective and the Constraint
The first discipline of §10.2 is to separate what is fixed from what is free. What is fixed here? The annual demand $D = 18{,}000$ lb is fixed (the customers will drink what they drink). The per-order fee $K = \$90$ and the holding rate $h = \$3$/lb/yr are fixed prices set by the world. What is free — the lever Maya actually controls — is the order size $Q$, the number of pounds per shipment. Everything else flows from $Q$.
So $Q$ is the single decision variable, and the objective is the total annual cost as a function of $Q$. There is no separate algebraic constraint to substitute away (unlike the fencing problem, where a perimeter equation eliminated a variable); instead the "constraint" is structural — the demand $D$ must be met exactly over the year, which fixes the total pounds ordered and lets us count orders as $D/Q$. That is the constraint doing its quiet work: it converts the order size into an order frequency.
Step 2 — Building the Cost Function
Two costs pull against each other, and that tension is the whole story.
Ordering cost. If Maya orders $Q$ pounds each time, she must place $D/Q$ orders over the year to move all $18{,}000$ pounds. Each order costs $K = \$90$, so the annual ordering cost is
$$\text{ordering} = K\cdot\frac{D}{Q} = \frac{90 \cdot 18{,}000}{Q} = \frac{1{,}620{,}000}{Q}.$$
Notice the shape: larger $Q$ means fewer orders, so this term falls as $Q$ grows. Big batches are cheap to order. This is the intuition driving Maya's current policy — and it is half right.
Holding cost. Here is the countervailing force. Maya's inventory is not constant: a shipment of $Q$ pounds arrives, then gets drawn down steadily to zero as customers buy, then a new shipment arrives. Because the drawdown is linear, the average amount of coffee sitting in the warehouse over a cycle is $Q/2$ — halfway between full and empty. At $h = \$3$ per pound per year, the annual holding cost is
$$\text{holding} = h\cdot\frac{Q}{2} = \frac{3Q}{2} = 1.5\,Q.$$
This term rises with $Q$: bigger batches mean more coffee staling in the warehouse, more capital tied up, more insurance. Big batches are expensive to hold.
The objective function is the sum:
$$T(Q) = \frac{1{,}620{,}000}{Q} + 1.5\,Q, \qquad Q > 0.$$
The domain is the open ray $Q > 0$ — you cannot order a negative or zero quantity, and there is no hard upper limit, so we are not on a closed interval. We will need the boundary-behavior argument of §10.15 rather than the endpoint check of §10.4.
Step 3 — Finding the Critical Point
Differentiate. The first term is $1{,}620{,}000\,Q^{-1}$, whose derivative is $-1{,}620{,}000\,Q^{-2}$; the second term differentiates to $1.5$. So
$$T'(Q) = -\frac{1{,}620{,}000}{Q^2} + 1.5.$$
Set it to zero:
$$\frac{1{,}620{,}000}{Q^2} = 1.5 \implies Q^2 = \frac{1{,}620{,}000}{1.5} = 1{,}080{,}000 \implies Q^* = \sqrt{1{,}080{,}000} \approx 1{,}039.2 \text{ lb}.$$
This is exactly the Economic Order Quantity of §10.11. We could have plugged straight into $Q^* = \sqrt{2DK/h}$: indeed $\sqrt{2\cdot 18{,}000\cdot 90 / 3} = \sqrt{3{,}240{,}000/3} = \sqrt{1{,}080{,}000} \approx 1{,}039$, the same number. Deriving it by hand, though, makes the trade-off visible in a way the memorized formula hides.
Step 4 — Confirming It Is a Global Minimum
A critical point is only a candidate (§10.13). Two independent arguments confirm this one is the genuine global minimum.
Second-derivative test. $T''(Q) = \dfrac{2\cdot 1{,}620{,}000}{Q^3} = \dfrac{3{,}240{,}000}{Q^3} > 0$ for all $Q > 0$. The cost curve is concave up everywhere, so the single critical point is a minimum, and on a convex function a local minimum is automatically global (§10.15).
Boundary behavior. As $Q \to 0^+$, the ordering term $1{,}620{,}000/Q \to +\infty$ (Maya would be placing orders almost continuously — paperwork would bury her). As $Q \to \infty$, the holding term $1.5Q \to +\infty$ (she would be sitting on a warehouse full of staling coffee). The cost explodes at both ends, so the interior critical point — squeezed between two infinities, exactly like the can problem of §10.6 — must be the global minimum. Both arguments agree.
Step 5 — Translating Back and Sanity-Checking
The optimal order size is about 1,039 pounds, which means $D/Q^* = 18{,}000 / 1{,}039 \approx 17.3$ orders per year — roughly every three weeks. Compare the costs:
- At Maya's current $Q = 3{,}000$: $T = \dfrac{1{,}620{,}000}{3{,}000} + 1.5(3{,}000) = 540 + 4{,}500 = \$5{,}040$/yr.
- At the optimum $Q^* \approx 1{,}039$: $T = \dfrac{1{,}620{,}000}{1{,}039} + 1.5(1{,}039) \approx 1{,}559 + 1{,}559 = \$3{,}118$/yr.
Maya saves roughly **\$1,920 a year** — about 38% of her logistics cost — simply by ordering smaller, more often. Her instinct to "save on shipping" had pushed her far past the balance point: at $Q = 3{,}000$, holding cost (\$4,500) dwarfed ordering cost (\$540), a lopsided ratio that should have been a warning sign.
And here is the beautiful structural fact §10.11 promised: at the optimum, ordering cost exactly equals holding cost. Both come out to \$1,559. That is not a coincidence of these numbers — it is provable in general (Exercise E5): at $Q^$, $K D/Q^ = hQ^/2$. The square root in the EOQ formula is precisely the order size that balances the two competing forces evenly. When Maya's bookkeeper sees the two costs land on the same number, the abstract derivative suddenly feels concrete: the optimum is the point of perfect balance.*
A short Python check (hand-computed outputs shown — not executed):
python import numpy as np D, K, h = 18000, 90, 3 Q_star = np.sqrt(2*D*K/h) # -> 1039.23 ordering = K*D/Q_star # -> 1558.85 holding = h*Q_star/2 # -> 1558.85 (equal!) print(round(Q_star,1), round(ordering+holding,2)) # 1039.2 3117.69
Why the Model Is Both Powerful and Limited
The EOQ is over a century old (Harris, 1913) and still the baseline every inventory-management system starts from — but Maya should understand what it leaves out, because that is the §10.6 lesson restated: garbage in, optimum out. The basic model assumes demand is perfectly steady, lead times are instant, and there are no quantity discounts. Real importers often cut the per-pound price for orders above some threshold, which adds a downward step to the cost and can pull the true optimum toward a larger batch. Green coffee also degrades over time, so very long holding periods carry a quality cost the flat $h$ doesn't fully capture. None of this makes the calculus wrong; it means the objective function must grow to include every cost that matters. The skill Chapter 10 builds is not memorizing $\sqrt{2DK/h}$ — it is knowing how to write the objective when the textbook formula no longer fits.
Discussion Questions
- Maya's importer offers a 4% discount per pound on any order of at least 2,000 pounds. Sketch how you would modify the objective function to test whether taking the discount (and ordering larger) beats the EOQ. What new term appears, and why can't you just use $\sqrt{2DK/h}$ anymore?
- Suppose Maya's holding cost $h$ doubles because warehouse rent spikes. Without recomputing, predict whether $Q^*$ goes up or down, and by what factor, using the formula's structure. (Hint: $Q^* \propto 1/\sqrt{h}$.)
- At the optimum, ordering cost equals holding cost. Prove this in general from $Q^* = \sqrt{2DK/h}$, and explain in plain English why a balanced split is the signature of this trade-off but not of every optimization.
- The model assumes average inventory is $Q/2$. What real feature of Maya's business (a "safety stock" buffer she keeps so she never runs out) would change that assumption, and how would it shift the holding-cost term?
A Short Annotated Reading
- Harris, F. W. (1913), "How Many Parts to Make at Once," Factory, The Magazine of Management. The original derivation of the EOQ, written by a Westinghouse engineer. Remarkably readable; shows the trade-off was understood in concrete shop-floor terms before it was dressed up in calculus notation. See §10.11's Historical Note.
- Nahmias, S. & Olsen, T. L., Production and Operations Analysis (7th ed.). The standard operations-management text; its inventory chapters extend the basic EOQ to quantity discounts, backorders, and stochastic demand — exactly the "grow the objective" moves Discussion Question 1 asks about.
- Silver, Pyke & Thomas, Inventory and Production Management in Supply Chains. A practitioner-oriented deep dive showing how modern supply-chain software still uses EOQ as its starting point, then layers on the realism. Good for seeing where the clean derivative meets messy operations.
- Stewart, Calculus: Early Transcendentals, §4.7 (Optimization Problems). The reference treatment of applied single-variable optimization; the inventory example there parallels this case study closely.