Let $f$ be a continuous, even function over some interval $I=[-a,a]$ such that the total arc length of $f$ over $I$ is at least $2$, $f(0)=0$, and $f$ is increasing on $(0,a)$. [You might imagine something like $f(x)=x^2$.] View the graph of $z=f(x)$ as a surface in $\mathbb{R}^3$ (so, parallel to the $y$-axis).

Model a corn tortilla (or pita bread if you prefer) as a pliable disk of radius $1$, place it in the $xy$-plane with its center at the origin, and wrap the tortilla up against the surface $z=f(x)$. [It should now be clear why there was the arc length condition above.]

At this point, we have something like a taco shell. Now take its convex hull and consider its volume $V$.


Can we determine how to maximize $V$ with respect to all such functions $f$? Because, you know, I want my taco to be the biggest.

Elementary candidates for $f$ include a semicircle function, a parabola, an absolute value function, a cosine wave, etc. But if there is a unique answer, it might not be an elementary curve at all.

Edit: This probably shouldn't have been asked in a way that relies on a function $f$. Maybe the biggest taco has regions where the shell is curved completely vertical, and we no longer have the graph of a continuous function. If you prefer, consider curves parametrized by arc length $$\left(X(t),0,Z(t)\right):[0,1]\to xz\mbox{-plane}$$ with $X(0)=Z(0)=0$, and $X$ and $Z$ (not necessarily strictly) increasing. (And of course then reflect that curve through the $yz$-plane and cross it with the $y$-axis to get the entire surface.)

2'5 9'2
  • 51,425
  • 6
  • 76
  • 143
  • Did you mean "the total arc length of $f$ over $I$ is at least $2a$"? – Zev Chonoles Dec 16 '11 at 20:15
  • @Zev When you bend the disc up around the surface, the diameter perpendicular to the $y$-axis will preserve its length of $2$. So I want the curve to be long enough in arc length to support that. Consider $f(x)=\frac{12}{5}|x|$ with $a=\frac{5}{13}$. Total arc length would be $2$ so there would be room to fold the disc up. The only reason $a$ is in the formulation of the question at all is so that we might have an $f$ that doesn't extend indefinitely. – 2'5 9'2 Dec 16 '11 at 20:20
  • Ah, I see. The fact that $2a$ is an obvious lower bound on the arc length of $f$ is why I assumed that's what you meant. – Zev Chonoles Dec 16 '11 at 20:24
  • Ah, I see a linguistic ambiguity. I'm going to edit the question. I think the "so that" should be replaced with something else like "such that". – 2'5 9'2 Dec 16 '11 at 20:31
  • Quick note, if the flexible taco material were in the shape of a rectangle with edges parallel to the axes, the answer would indeed be the semicircle that causes the taco to just become vertical at the edges. – Will Jagy Dec 16 '11 at 20:48
  • Perhaps the calculus of variations could come in handy in answering this question! – Bruno Joyal Dec 16 '11 at 21:10
  • Why can't all question look like this one? Beautiful! – AD - Stop Putin - Dec 16 '11 at 23:05
  • To make this slightly more realistic, perhaps you should add in considerations for the 'angle of repose' of your ingredients, which after all need not sit inside the convex hull of the taco shell! – Aaron Mazel-Gee Dec 20 '11 at 22:09

1 Answers1


Here's your optimal taco (with vegetarian filling):


I'd call it a Jordan curve, but that name is unfortunately already taken, so how about "tacoid"?

Rather appropriately, we can calculate the volume of the taco using something similar to the method of shells. Let $s$ be the arc length parameter along the curve, and consider the part of the taco volume between the two surface elements that correspond to an arc length element $\mathrm ds$. The distance between them along the $x$ axis is $2x$, their length along the $y$ axis is $\sqrt{1-s^2}$, and their height along the $z$ axis is $\mathrm dz=\dot z\mathrm ds$, where here and in the following a dot denotes differentiation with respect to the arc length.

Thus the taco volume is

$$V=\int_0^12\sqrt{1-s^2}x\dot z\mathrm ds\;.$$

We can eliminate $\dot z$ from $\dot x^2+\dot z^2=1$, which gives $\dot x=\sqrt{1-\dot z^2}$, and thus

$$V=\int_0^12\sqrt{1-s^2}x\sqrt{1-\dot x^2}\mathrm ds=:\int_0^1\mathcal L(s,x,\dot x)\mathrm ds\;.$$

We can maximize this using the calculus of variations. The Euler–Lagrange equation is

$$\frac{\mathrm d}{\mathrm ds}\frac{\partial\mathcal L}{\partial \dot x}=\frac{\partial\mathcal L}{\partial x}\;,$$

which yields

$$\frac{\mathrm d}{\mathrm ds}\left(-\sqrt{1-s^2}x\frac{\dot x}{\sqrt{1-\dot x^2}}\right)=\sqrt{1-s^2}\sqrt{1-\dot x^2}\;,$$

which we can simplify to

$$x\ddot x+1-\dot x^2=x\dot x(1-\dot x^2)\frac{s}{1-s^2}\;.$$

Note that the left-hand side is what we'd usually get for a circle if we didn't have the factor $\sqrt{1-s^2}$ from the shape of the taco; a rectangular taco wouldn't have this term and would thus take the form of a semi-cylinder, as Will noted.

None of the candidates solves this equation; I doubt that it can be solved analytically. I solved it numerically using RK4. This was a bit tricky because there are singularities both at $x=0$ (horizontal tangent) and at $s=1$ (vertical tangent).

Since we have an initial condition at $s=0$ and a fixed arc length parameter value for the endpoint, $s=1$, we'd like to integrate the equation from $s=0$ towards $s=1$; then we could vary the remaining initial condition to get the optimal volume. However, the problem is that the singularity at $x=0$ forces the tangent to be horizontal there, so we can't freely specify a first derivative there.

The situation at $x=0$, where $s=0$, is basically the same as for the semi-circle we get without the $\sqrt{1-s^2}$ term, so we can try to get some guidance from there. The solution in that case is

$$\begin{array}{ccccc} x=r\sin\frac sr&&\dot x=\cos\frac sr&&\ddot x=-\frac1r\sin\frac sr\\ z=r(1-\cos\frac sr)&&\dot z=\sin\frac sr&&\ddot z=\frac1r\cos\frac sr\\ \end{array} $$

with a free parameter $r$, the radius of the semi-circle.

We can see from this solution that we also can't freely specify $\ddot x$ at $x=0$, since its value $0$ is independent of the curvature, as is $\dot z=0$. However, $\ddot z=1/r$ is the curvature, which we can choose freely. Thus, we transform from $x$ to $z$ using

$$\dot x=\sqrt{1-\dot z^2}$$


$$\ddot x=-\frac{\dot z\ddot z}{\sqrt{1-\dot z^2}}$$

to obtain

$$\ddot z=\frac{\dot x\dot z}x-\dot x^2\dot z\frac s{1-s^2}\;.$$

Now we can circumvent the singularity by calculating $\ddot z$ from the differential equation for $x\ne0$ and freely choosing a value for it at $x=0$, which will determine the taco's curvature. We can then vary this parameter to maximize the volume.

It turns out that at small initial curvatures, the graph is at first roughly circular (near $s=0$) but then turns and ends in a horizontal tangent. This makes sense if you look at the signs of $\ddot x$ and $\ddot z$: The additional term from the $\sqrt{1-s^2}$ factor increases $\ddot x$ and decreases $\ddot z$, so if it dominates at $s=1$, it causes the tangent to be horizontal. (The tangent has to be either horizontal or vertical at $s=1$ to counter the pole in the $s$-dependent term.)

However, as the initial curvature is increased, eventually the tangent becomes vertical before $s=1$ is reached. The mechanism for this is similar as in the circular case, and the $s$-dependent term only causes a quantitative correction in this case. It turns out that, as in the circular case, the volume is maximal precisely at the curvature that makes the tangent at $s=1$ come out vertical. To avoid problems from this singularity, I switched from the equation for $\ddot z$ to the equation for $\ddot x$ at $s=1/2$, so that at either singularity I was effectively dealing with a "horizontal" tangent and finite curvature.

It turns out that the correction due to the $s$-dependent term is actually quite small. In practical terms, it's probably not worth making the effort to optimize the form, since the cylindrical form is almost as good. The optimal volume is about $0.415015$ (with the curvature at $x=0$ about $2.0328$), whereas if you wrap the disk around the cylinder with radius $2/\pi$ that solves the rectangular version, the volume is $1/2-J_1(\pi)/\pi\approx0.409404$ (according to Wolfram|Alpha).

Here's a comparison of the tacoid and the semi-circle:

tacoid and semi-circle

Red is the tacoid, green is the semi-circle. The tacoid rises more rapidly, since it doesn't want to waste arc length on first getting further out, since it can't profit from that as much later on when the $\sqrt{1-s^2}$ factor kicks in. The tacoid would be a bit worse than the semi-circle if the taco were rectangular (only $0.618983$ instead of the optimal volume $2/\pi\approx0.636620$ of the semi-cylinder). To illustrate how this changes due to the $\sqrt{1-s^2}$ factor, I weighted the $x$ values by that factor. Blue shows the weighted tacoid, and yellow shows the weighted semi-circle. The taco's gain near the top is slightly bigger than the loss near the bottom.

We can also compare with a circular graph optimized for a disk-shaped taco. The optimal value of the radius in that case is about $0.899736\cdot2/\pi\approx0.572790$, and the corresponding cylindrical volume is about $0.413570$, which is less than half a percent below the optimum, so in calculating cylindrical approximations your students were coming quite close to the optimal result.

We can draw the same graphs as above to compare the tacoid and the reoptimized cylinder,

tacoid and reoptimized cylinder

but perhaps more interesting is a comparison of the enclosed volume plotted against the arc length,

enclosed volume against arc length

which shows that these two solutions make use of their arc length in a surprisingly similar manner, with the tacoid (red) only very slightly more greedy than the cylinder (green), and even that small difference almost evening out at the end.

Since the reoptimized cylinder has the added advantage of bending back inwards slightly to improve your grip on the contents, this raises the question whether it might be preferable in practical terms to forgo the half-percent optimization and go for a simple cylindrical form with optimal radius.

  • 215,929
  • 14
  • 263
  • 474
  • 13
    The added picture makes your answer even classier than it previously was. – J. M. ain't a mathematician Dec 17 '11 at 05:26
  • Nicely done. I've often specified a cylindrical or parabolic curve and asked my advanced calculus students to do as best they could to find exact values or numerical approximations of the volume, but I never suspected this optimization question was answerable. Thanks! – 2'5 9'2 Dec 17 '11 at 07:13
  • @alex: You're welcome. I added some results and images comparing the optimal solution to a cylinder optimized for the disk-shaped taco. – joriki Dec 17 '11 at 11:43
  • Is that last graph comparing volumes using the semi-cylinder or the reoptimized cylinder? – 2'5 9'2 Dec 17 '11 at 19:43
  • @alex: The reoptimized one. – joriki Dec 17 '11 at 19:50
  • 1
    I'm slowly working my way through this magnum opus. If I'm not mistaken, the $\sqrt{1-s^2}x\sqrt{1-\dot x^2}$ on the right side after "which yields" shouldn't have an $x$, since you've differentiated that out. (I assume it's just an error in presentation and that it didn't affect later calculations.) – dfan Dec 20 '11 at 14:02
  • @dfan: Many thanks. You're right on both counts -- the $x$ doesn't belong there, and the line after it comes out right if you take it out. I've removed it. – joriki Dec 20 '11 at 14:22
  • 1
    Interesting -- one and a half years later, this answer got a downvote -- perhaps the downvoter could state the reasons? – joriki Apr 01 '13 at 22:21
  • The reoptimized cylinder bends back inward - but wouldn't its volume be larger if the circular curve straightened out after reaching its vertical tangent? And have _even more_ volume if it had an inflection at that point and then curved outward? I'm curious how close these considerations would bring the "straightened circle" volume to the optimal tacoid volume. You're already within half a percent - can you reach orders of magnitude closer? Two years after the fact, I completely understand if you don't still have the numerical solution algorithm keyed in. – 2'5 9'2 Oct 31 '13 at 20:39