I made this post about a maximizing quadratic expression problem. Here is the problem I made in the original post:
A table is to be constructed by gluing together $68$ cubes of dimension $1\times1\times1$. All four legs and the rectangular top will be formed by the cubes. The four legs must be the same length and must be one cube thick, and the top is one cube thick, as well. What is the maximum possible volume of the space between the table's top and the floor, excluding the space taken up by the table's legs?
This is my final solution:
Let a be the area of the top and c be the length of a leg.
a + 4c = 68
a = 68 − 4c
We let the maximum volume excluding the four legs equal ac - 4c = 256 - (16 2c)^2 after completing the square.
The maximum is 256 when c = 8.
This is the solution of a commenter:
Noting that subtracting 68−4=64, we can see that, if the legs are only 1 cube high, that leaves 8×8×1=64 for the table top. The space under the table (minus the legs) is 64−(4×1×1)=60 so the volume from the table top to the floor is 2∗64−4=124.
If we let the legs be 4×2=8, the table top is 5×12=60, volume: 3∗60−8=172.
If we let the legs be 4×3=12, the top is 68−12=54 volume: 4×54−12=204
If we let the legs be 4×4=16, the top is 68−16=52, volume: 5×52−16=244
If we let the legs be 4×5=20, the top is 68−20=48, volume: 6×48−20=268
If we let the legs be 4×6=24, the top is 68−24=44, volume: 7×44−24=284
If we let the legs be 4×7=28, the top is 68−28=40, volume: 8×40−28=292
If we let the legs be 4×8=32, the top is 68−32=36, volume: 9×36−32=292
If we let the legs be 4×9=36, the top is 68−36=32, volume: 10×32−36=284
If we let the legs be 4×10=40, the top is 68−40=28, volume: 11×28−40=268
It appears 292 is the maximum volume with outer dimensions of 8×5×8 or 9×6×6
The commenter's solution seems to work, but it contradicts my solution, another commenter's solution, and the book's answer. where did they go wrong?
I posted a $2^{nd}$ answer to your original question and copied it here because I couldn't stand not knowing and tried my hand at find a derivative slope of zero.
Given 68 cubes, the table top is $68-4h$ where $h$ is the height of the legs.
Under the table we have $(h)(68-4h)=68h-4h^2$ and the total volume (sans legs) is $top+under-legs=(68-4h)+(68h-4h^2)-(4h)=68+60h-4h^2$.
For a continuous function, the max volume can be found by where the increasing/decreasing slope of the given function is zero.
The first derivative $\frac{d}{dh}(68+60h-4h^2)=-8h+60\implies 60-8h=0\implies 8h=60$
This tells us that the max leg height is $\frac{60}{8}=7.5$ If fractional heights were allowed the max volume would be $68+60h-4h^2=68+(60\times7.5)-(4\times7.5^2)=68+450-225=293$ but we are are restricted to the nearest integers. Soooo
$$68+60h-4h^2=68+(60\times7)-(4\times49)=68+420-196=292$$ and $$68+60h-4h^2=68+(60\times8)-(4\times64)=68+480-256=292$$