Case Study 2 — When Should a Starling Fly Home? Optimization in the Wild

Field: Behavioral ecology / evolutionary biology Section anchors: §10.7 (the "minimize the right thing" instinct), §10.12 (optimal foraging, the marginal value theorem), §10.15 (verifying a global maximum)

The Situation

A European starling is raising chicks. Several times an hour it flies from the nest out to a field, probes the soil for leatherjackets (cranefly larvae) and other invertebrates, loads as many as it can into its beak, and flies back to feed the brood. The field is some distance away, so each round trip costs the bird a fixed chunk of time spent simply traveling — time during which no food is gathered at all. Once at the field, the bird collects prey quickly at first, but as its beak fills, each additional item is harder to pick up and carry: a full beak is clumsy, and the bird must work around the prey it already holds. The rate of loading slows down the longer it stays.

This is the central tension of foraging, and it sets up a genuine optimization problem with real evolutionary stakes. How many prey items should the starling gather before flying home? Stay too short, and it wastes the costly travel on a near-empty beak. Stay too long, and it lingers in the field collecting the last few hard-won items at a crawling rate while the chicks go hungry and the travel-time clock keeps ticking. There is a sweet spot, and natural selection — over thousands of generations — has tuned starlings to find it. Our job is to find it with calculus and see how close the birds come.

This is the marginal value theorem (Charnov, 1976) from §10.12, applied to one of the cleanest experimental systems in behavioral ecology — Alex Kacelnik's classic starling studies of the 1980s, which trained wild-caught starlings to collect mealworms from a feeder at controlled distances.

Step 1 — What Are We Actually Optimizing?

The §10.7 lesson — make sure you optimize the right quantity — matters enormously here, because the naive objective is wrong. A starling that simply maximized the food gathered per trip would never leave the field; more time always means at least a little more food. That can't be the goal.

The quantity that natural selection actually rewards is the long-run rate of food delivery to the nest — energy per unit time, averaged over many trips including the travel. A bird that delivers more food per hour over the whole foraging day raises more chicks, and "more chicks" is exactly what evolution counts. So our objective is the overall delivery rate, and the decision variable is the time $t$ the bird spends loading in the field on each visit (which determines how full the beak is).

Step 2 — Building the Model

Let $g(t)$ be the cumulative amount of food (say, in energy units, or just number of prey) the bird has loaded after spending time $t$ in the patch. Because loading slows as the beak fills, $g(t)$ is a diminishing-returns curve: increasing, but concave down ($g' > 0$, $g'' < 0$). A standard, well-fitting shape for starling data is the saturating curve

$$g(t) = \frac{a\,t}{t + b},$$

which rises steeply at first and then flattens toward a ceiling of $a$ prey as $t \to \infty$. Suppose for this bird $a = 12$ (the beak saturates near 12 items) and $b = 4$ (a time-scale constant, in the same units as $t$), so

$$g(t) = \frac{12t}{t + 4}.$$

Let $\tau$ be the round-trip travel time between nest and field — pure overhead, no food gathered. Take $\tau = 6$ in the same time units (a fairly distant field).

Over one complete cycle the bird spends $\tau + t$ time (travel plus loading) and delivers $g(t)$ food. So the long-run delivery rate — the objective to maximize — is

$$R(t) = \frac{g(t)}{\tau + t} = \frac{12t/(t+4)}{6 + t}, \qquad t > 0.$$

This is "total gain divided by total time," the average rate over the whole cycle. We want the $t$ that makes $R(t)$ as large as possible.

Step 3 — The Marginal Value Theorem Shortcut

We could differentiate $R(t)$ directly with the quotient rule, but §10.12 gives a more illuminating route. The maximum of the average rate $R(t) = g(t)/(\tau + t)$ occurs exactly where the instantaneous loading rate equals the long-run average rate:

$$g'(t^*) = \frac{g(t^*)}{\tau + t^*}.$$

The left side is how fast the bird is loading right now (the slope of $g$); the right side is its average delivery rate over the whole cycle. The theorem says: leave the patch at the instant your current loading rate drops to the average rate you could be achieving. Stay longer and your current rate falls below your average — you are dragging your own average down. Leave sooner and you abandon prey you were still collecting faster than average. (This equivalence is itself a calculus fact: setting $R'(t) = 0$ via the quotient rule rearranges precisely into $g'(t^*)(\tau + t^*) = g(t^*)$, which is the boxed condition.)

Compute $g'(t)$ for our curve:

$$g'(t) = \frac{d}{dt}\!\left(\frac{12t}{t+4}\right) = \frac{12(t+4) - 12t}{(t+4)^2} = \frac{48}{(t+4)^2}.$$

Now set $g'(t) = g(t)/(\tau + t)$:

$$\frac{48}{(t+4)^2} = \frac{12t/(t+4)}{6 + t} = \frac{12t}{(t+4)(6+t)}.$$

Multiply both sides by $(t+4)^2(6+t)$ to clear denominators:

$$48\,(6 + t) = 12t\,(t + 4).$$

Expand: $288 + 48t = 12t^2 + 48t$. The $48t$ cancels from both sides, leaving

$$288 = 12t^2 \implies t^2 = 24 \implies t^* = \sqrt{24} = 2\sqrt{6} \approx 4.90.$$

The optimal loading time is about 4.9 time units per visit.

Step 4 — Confirming It Is a Maximum

Is $t^* \approx 4.9$ really where the delivery rate peaks, not a minimum or a saddle? Two checks, in the spirit of §10.15.

Sign of $R'$ around $t^*$. The marginal value theorem is just $R'(t) = 0$ in disguise. For small $t$ (beak nearly empty), the instantaneous loading rate $g'(t)$ is high — much higher than the average that includes travel overhead — so the bird is improving its average by staying: $R' > 0$. For large $t$ (beak nearly full), $g'(t)$ has dwindled toward zero while the average is still positive, so $R' < 0$ — staying now drags the average down. The rate $R(t)$ thus rises, peaks once, and falls: $t^* \approx 4.9$ is a maximum.

Boundary behavior. As $t \to 0^+$, $R(t) = g(t)/(\tau + t) \to 0/6 = 0$ (no time to gather food, but you still paid the travel). As $t \to \infty$, $g(t) \to 12$ (a ceiling) while the denominator $\to \infty$, so $R(t) \to 0$. The rate vanishes at both extremes and is positive in between, so its single interior critical point is the global maximum — the same "squeezed between two zeros" logic that pins down the can and EOQ optima, mirror-imaged for a max.

The peak delivery rate itself is

$$R(t^*) = \frac{g(t^*)}{\tau + t^*} = \frac{12(4.90)/(4.90 + 4)}{6 + 4.90} = \frac{12 \cdot 4.90 / 8.90}{10.90} = \frac{6.607}{10.90} \approx 0.606 \text{ prey per time unit.}$$

Step 5 — What the Answer Predicts, and Whether Birds Obey

The model makes a sharp, testable prediction: when travel time $\tau$ is larger, the bird should stay longer in the patch. Re-run the algebra with a nearer field, say $\tau = 2$ instead of $6$. Then $48(2 + t) = 12t(t+4) \implies 96 + 48t = 12t^2 + 48t \implies t^2 = 8 \implies t^* = \sqrt 8 \approx 2.83$. Halving-and-then-some the travel time pulls the optimal loading time down from $4.9$ to $2.8$. The logic is exactly §10.12's: when each trip is cheap, bail out early and take another trip; when each trip is costly, wring more out of every visit before paying the travel toll again.

This is precisely what Kacelnik found. Starlings flown at longer distances to the feeder consistently loaded more mealworms before returning, and the loading numbers tracked the marginal-value-theorem prediction strikingly well — not perfectly (real birds satisfice, face predation risk, and miscount), but closely enough that the theorem is now a cornerstone of behavioral ecology. No starling solves a quotient-rule equation. Evolution did the optimization, selecting over countless generations for birds whose stopping rule happened to satisfy $g'(t^*) = g(t^*)/(\tau + t^*)$. The calculus we did in five steps describes a strategy natural selection discovered long before anyone wrote down a derivative — the §10.12 punchline made vivid.

A short Python check (hand-computed outputs shown — not executed): ```python import numpy as np a, b, tau = 12, 4, 6

Solve g'(t) = g(t)/(tau+t) -> reduces to t^2 = abtau/(a) ... here 288=12t^2

t_star = np.sqrt(24) # -> 4.899 g = a*t_star/(t_star+b) # -> 6.607 rate = g/(tau+t_star) # -> 0.606 prey per unit time print(round(t_star,3), round(rate,3)) # 4.899 0.606 ```

Discussion Questions

  1. The model treats the loading curve $g(t) = 12t/(t+4)$ as fixed. In a richer field (more prey), the ceiling $a$ and the time-scale $b$ both change. Predict qualitatively how a higher prey density should shift $t^*$, and reason it out from the marginal value theorem rather than recomputing.
  2. We maximized food rate. A parent starling also faces predation risk that grows the longer it is away from the nest. Sketch how you would add a risk term to the objective, and argue whether it would push $t^*$ up or down.
  3. Show algebraically that for the curve $g(t) = at/(t+b)$, the optimal residence time is $t^* = \sqrt{b\tau}$ — the geometric mean of the time-scale and the travel time. Verify it reproduces $t^* = \sqrt{24}$ here. Why is a geometric mean a satisfying answer for a problem balancing two times?
  4. The starling never computes anything. In what precise sense is it "optimizing"? Connect this to the §10.8 idea that a photon obeying Fermat's principle "solves" the lifeguard's least-time problem without any awareness.

A Short Annotated Reading

  • Charnov, E. L. (1976), "Optimal foraging, the marginal value theorem," Theoretical Population Biology 9, 129–136. The founding paper. Short, elegant, and the source of the $g'(t^*) = g(t^*)/(\tau + t^*)$ condition in §10.12. Worth reading once to see a calculus result reshape an entire field.
  • Kacelnik, A. (1984), "Central place foraging in starlings," Journal of Animal Ecology 53, 283–299. The classic experiment behind this case study; demonstrates real birds tracking the travel-time prediction. A model of how to test a calculus-derived hypothesis with live animals.
  • Stephens, D. W. & Krebs, J. R., Foraging Theory (Princeton, 1986). The standard graduate text; Chapter 2 develops the marginal value theorem with full rigor and many variants (patch depletion, risk, information). The place to go after this case study.
  • Stewart, Calculus: Early Transcendentals, §4.7. General single-variable optimization technique; while it doesn't cover foraging, its rate-maximization examples use the same "maximize average = where marginal meets average" structure seen here.