Cardboard box optimization exercises

 Abstract

We study what integer dimensions of a rectangular piece of cardboard provide integer solutions to a standard optimization problem in introductory calculus.

Setup

We have a rectangular piece of cardboard, of length 𝐿 and width π‘Š. Four equal-sized squares of sidelength π‘₯ are cut out of each corner, and the resulting flaps are folded up to produce a box. The quantity to be optimized is the volume 𝑉 of the resulting box.

Objective function & feasible domain

Once the squares are cut out, the dimensions of the base are 𝐿 - 2π‘₯ and π‘Š - 2π‘₯, making our volume function

𝑉 = 𝑉(π‘₯)

= π‘₯(𝐿 - 2π‘₯)(π‘Š - 2π‘₯)

= 4π‘₯Β³ - 2π‘₯Β²(𝐿 + π‘Š) + π‘₯πΏπ‘Š.

The feasible domain for π‘₯ is

0 ≀ π‘₯ ≀ min(𝐿, π‘Š)/2.

Solution for π‘₯

We differentiate our objective function to find its stationary points:

d𝑉/dπ‘₯ = 12π‘₯Β² - 4π‘₯(𝐿 + π‘Š) + πΏπ‘Š,

and plugging directly into the Quadratic Formula, the stationary points occur at

π‘₯ = [4(𝐿 + π‘Š) Β± √{16(𝐿 + π‘Š)Β² - 48πΏπ‘Š}]/24

π‘₯ = [(𝐿 + π‘Š) Β± √{(𝐿 + π‘Š)Β² - 3πΏπ‘Š}]/6

π‘₯ = [(𝐿 + π‘Š) Β± √{𝐿² - πΏπ‘Š + π‘ŠΒ²}]/6

Notice that the stationary points are homogeneous in 𝐿 and π‘Š, i.e. if we scale the box up by a factor Ξ», the stationary points

π‘₯β‚‹ = [(𝐿 + π‘Š) - √{𝐿² - πΏπ‘Š + π‘ŠΒ²}]/6

π‘₯β‚Š = [(𝐿 + π‘Š) + √{𝐿² - πΏπ‘Š + π‘ŠΒ²}]/6

also scale by a factor Ξ». Therefore, if some particular values of 𝐿 and π‘Š give rational but not integral values of π‘₯β‚‹ and π‘₯β‚Š, it's always possible to scale them so that π‘₯β‚‹ and π‘₯β‚Š become whole numbers.

If L β‰  W, the stationary point xβ‚Š is outside the feasible domain

Although the quadratic formula gives us two distinct stationary points π‘₯β‚‹, π‘₯β‚Š when 𝐿 β‰  π‘Š, only one of them is feasible in the real-world context. Since βˆš{𝐿² - πΏπ‘Š + π‘ŠΒ²} > min(𝐿, π‘Š), it follows that

π‘₯β‚Š = [(𝐿 + π‘Š) + √{𝐿² - πΏπ‘Š + π‘ŠΒ²}]/6

> [3min(𝐿, π‘Š)]/6 = min(𝐿, π‘Š)/2

is never in the feasible domain, and can be omitted as a possible extremum.

Another way of seeing this: since our objective function 𝑉(π‘₯) has zeroes at π‘₯ = 0, π‘₯ = 𝐿/2, and π‘₯ = π‘Š/2, then if 𝐿 β‰  π‘Š, by Rolle's theorem 𝑉(π‘₯) must have a horizontal tangent in the open interval between π‘₯ = 𝐿/2 and π‘₯ = π‘Š/2. See Cardboard Box OptimizationVisualizer (desmos.com)

Getting "nice" rational answers

If we hope to get a rational answer for π‘₯β‚‹, we need 𝐿² - πΏπ‘Š + π‘ŠΒ² to be a perfect square. This is equivalent to specifying that we need 𝐿, π‘Š to be two sides of a 60Β° triangle which has 3 integer sides, i.e. (𝐿, π‘Š, √{𝐿² - πΏπ‘Š + π‘ŠΒ²}) form an Eisenstein triple. Wikipedia gives the following list of primitive Eisenstein triples for small values of 𝐿 and π‘Š:

Length, 𝐿

Width, π‘Š

√{𝐿² - πΏπ‘Š + π‘ŠΒ²}

3

8

7

5

8

7

5

21

19

7

15

13

7

40

37

8

15

13

9

24

21

Plugging these values into the Quadratic Formula given above, we find the following values for π‘₯β‚‹:

Length, 𝐿

Width, π‘Š

√{𝐿² - πΏπ‘Š + π‘ŠΒ²}

π‘₯β‚‹

3

8

7

(3+8-7)/6 = 2/3

5

8

7

(5+8-7)/6 = 1

5

21

19

(5+21-19)/6 = 7/6

7

15

13

(7+15-13)/6 =3/2

7

40

37

(7+40-37)/6 = 5/3

8

15

13

(8+15-13)/6 = 5/3

9

24

21

(9+24-21)/6 =2

Wikipedia also gives the following recipe for generating other Eisenstein triples, which can be used to create other starting dimensions for the cardboard box problem with "nice" solutions for π‘₯β‚‹.

Comments