If x represents the length of the box, then 42-x will be the girth. Since the largest area for a given girth is that of a square, the side length of the square cross section is (42 -x)/4.
The volume as a function of package length is then
.. v(x) = x((42-x)/4)^2
This has a maximum at x=14. The corresponding volume is 686 in^3.