{'fraction_non_alphanumeric': 0.03430002890451874, 'fraction_numerical': 0.013392427016090181, 'mean_word_length': 3.9903846153846154, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
It is not a Coincidence! On Curious Patterns in Calculus Optimization Problems

In this paper we consider a few Calculus optimization problems in which we notice peculiar patterns. In each of these cases there is a geometric explanation for the pattern showing that it is not just a coincidence.


The basics
1.1. Optimizing a rectangle. It can be shown using the standard calculus optimization technique that of all rectangles with a given perimeter, the square has the largest area. (It also follows that of all rectangles with a given area, the square has the smallest perimeter.) There is also an easy geometric way to prove this. The picture below shows two rectangles: one of them, s × s, is a square, and the other, (s + h) × (s − h), is not. They have the same perimeter (4s), but the square has a larger area since the areas of the shaded parts are equal, but the square also contains a region that the other rectangle does not. A square = s 2 > s 2 − h 2 = (s + h)(s − h) = A rectangle Remark 1.2. As proved on p. 50 in [4], even among all quadrilaterals with a given perimeter, the square has the largest area.
1.2. Optimizing a rectangular prism. We can ask a similar question in 3D: of all rectangular prisms with the given volume, which one has the smallest surface area? Or, equivalently, of all rectangular prisms with the given surface area, which one has the largest volume? The answer to both of these questions is a cube.
Notice that these problems are too general for a single variable calculus course: there are too many degrees of freedom. Namely, there are three unknowns (three dimensions), but only one constraint (the given surface area or the given volume). So typically in the first semester calculus class we only consider the 2-variable problem of optimizing a square prism. This would actually be sufficient for our work below, however, we can't resist the temptation to show our reader the following geometric argument that works for all rectangular prisms. Suppose we have any rectangular prism that is not a cube. Choose any face that is not a square and make it the base. Consider the square that has, say, the same area. It will have a smaller perimeter. Construct a prism with the same height as the original one: It will have the same volume but a smaller surface area! (It will have the same volume because both the area of its base and its height are the same as those of the original prism; and a smaller surface area because the areas of the base and the top are the same but the area of the sides is smaller since the perimeter of the base is smaller.) Thus a prism that is not a cube cannot have the smallest possible surface area among all rectangular prisms with a fixed volume. Now we are ready to consider some more interesting problems.
2. The fence problem 2.1. Problem. Some version of the following rectangular field optimization problem can be found in almost every calculus textbook (see e.g. exercise 7 on p. 337 in [6]; example 1 on p. 258 in [1] looks different at first, but actually is an equivalent optimization problem).
A farmer wants to fence off a rectangular field and divide it into 3 pens with fence parallel to one pair of sides. He has a total of 2400 ft of fencing. What are the dimensions of the field that has the largest possible area? y x The standard calculus optimization technique easily produces the answer: the field must have dimensions x = 300 ft and y = 600 ft. (It should be noted, however, that in this problem the area of the field turns out to be a quadratic function of x, therefore its maximum value, i.e. the value at the vertex of the parabola, can be found by completing the square, so this problem can be solved without using calculus.) 2.2. Observation. Notice that there are four pieces of fence of length 300 ft and two pieces of length 600 ft, therefore both the total length of the vertical pieces and the total length of the horizontal pieces are 1200 ft. The reader is invited to try a modification of the above problem (e.g. by varying the total length of the fence and/or the number of pens) and observe that the property described above still holds: to obtain the largest possible area, exactly half of the fence must be spent on the vertical pieces, and exactly half on the horizontal pieces. We could even have both vertical and horizontal partitions, and the optimal dimensions would still have the above property. , but what is important, is that its roots are L = 0 (well, if no fence at all is spent on the vertical pieces, the area of the field is 0) and L = 2400 (similarly, if no fence is spent on the horizontal pieces, the area is 0). The graph of this quadratic function is a parabola opening downward, and, due to symmetry, the highest point on the parabola, its vertex, is halfway between the roots. This new rectangle uses exactly the same amount of fence as the original one, and its area is twice that of the original rectangle. Since maximizing the area is equivalent to maximizing twice the area, finding the optimal dimensions in the modified problem will give us the optimal dimensions in the original problem. But the modified problem is just a rectangle, and we know that the optimal shape is a square. In a square, the total length of the vertical pieces is equal to that of the horizontal pieces. Thus this property must hold in the original problem.
We can use the same idea with any number of required partitions. Say, if we need four partitions to make five pens, we'll modify the problem by making the rectangle three times taller; from 6 partitions we'll make the rectangle four times taller, and so on. The reader might ask: what are we going to do if the number of partitions is odd? Well, we will just cut one of them in half: 3. The cylindrical can problem 3.1. Problem. The following is another well-known problem (see e.g. example 2 on p. 333 in [6]; problem 6 on p. 135 in [5] is a slightly different version).
A cylindrical can must have volume 1000 cm 3 . Find the dimensions that will minimize the cost of the metal to manufacture the can. In mathematical terms, find the dimensions that minimize the surface area of such a cylinder (with top and bottom). h r The reader is invited to check that the optimal dimensions are r = 3 500/π cm and h = 2 3 500/π cm.

3.2.
Observation. Notice that in the optimal can h = 2r, and the same relationship holds for an optimal square prism box if we let r be the distance from the center of the base to any side (note that r is the radius of the inscribed circle, called the inradius of the square; the line segment from the center of a regular polygon to the middle of any side is also called its apothem). h r Is this a coincidence? We will show that it is not, but rather these two problems (optimizing the can and optimizing the square prism) are equivalent.

Why is this so?
Let us see how the volume and the surface area of the can and the square prism are related:

Now,
Notice that the expressions for both surface areas contain twice the area of the base, and A square = 4 π A circle . If only the other two terms in these expressions were related in the same way, namely, if P square was 4 π times larger than P circle , that would mean that SA prism was also 4 π times larger than SA can , which, in turn, would mean that the two problems are equivalent.
So here is our question: is It is easy to see that these quotients are 8r 2πr and 4r 2 πr 2 , so indeed they are equal. But is that a coincidence, or is there something deeper here? Why Psquare P circle = Asquare A circle ? Let us rewrite the above equation as follows: A circle P circle = Asquare Psquare . Now look again at the above equation in terms of r: πr 2 2πr = 4r 2 8r . On each side, the denominator is the derivative of the numerator! This property is briefly illustrated below, while its formal proof for any regular polygon is given in [3] and a more general case is explored in [2].
Imagine increasing the radius of a circle by ∆r (see picture below). Its area is increased by ∆A ≈ P circle ∆r. That's why the derivative of the area is lim ∆r→0 ∆A ∆r = lim ∆r→0 P circle ∆r ∆r = P circle . The same is true for the square! r r r r Now, both areas (of the circle and of the square) are quadratic power functions of r. For any two quadratic power functions, say, ar 2 and br 2 , their derivatives are 2ar and 2br respectively, so the ratios of the function to its derivative would be ar 2 2ar = r 2 = br 2 2br . It does not matter what the coefficient a or b is, since it appears in both the function and its derivative and gets canceled in the ratio.
So the above observation is not at all a coincidence. Moreover, as we will see in the next section, this applies to any prism that has a regular polygon as the base! 3.4. Other boxes. Suppose we want to construct a box in the shape of some other prism whose base is a regular polygon. What would be the optimal shape then? For example, given the desired volume, what ratio of the height h to the inradius r would minimize the surface area (and thus minimize the amount of material needed)? h r r h As we know, area grows proportionally to the square of the length. Therefore, the area of any regular polygon is a square function of the inradius, i.e. of the form cr 2 where c is some constant. The perimeter of the polygon is then 2cr. This means that both the volume and the surface area of any such prism differ from those of a square prism by a constant multiple (namely, c 4 ), thus the problem of optimizing any such box is equivalent to the problem of optimizing a square prism. So, in all cases the optimal shape is the one for which h = 2r! 4. The ellipse inscribed in a semi-circle problem The following is a modification of problem 9 on p. 979 in [6].  This problem is a bit tougher than the previous ones, and requires a longer computation. The optimal shape turns out to be the one with a = 2 . Notice that these are exactly vertices of the largest-area rectangle inscribed in a semi-circle (see e.g. example 5 on p. 336 in [6]; see also p. 130 in [4] for a generalization of this problem): y y x x 4.3. Why is this so? Are the problems of optimizing the ellipse and optimizing the rectangle inscribed in a semi-circle equivalent? It certainly appears so, but what do the inscribed ellipse and the inscribed rectangle have in common? Try to figure it out!