Maximizing the volume of the box obtained by folding the flaps after cutting out squares from each corner of a square 
You have a square [of side $a$] and you cut out it's corners in shape of a square, so you get a box [after folding the flaps up]. The task is to calculate [the side] $a'$ of a squares (you cut out) if the volume of a box is maximum.


I don't know what I'm doing wrong, but when I try to calculate critical points I always get $0$, and there isn't even a maximum but a minimum.
The solution is $\frac{a}{6}$.

If the box need not be a cube, as in your previous post, and we cut out equal squares from each of the corner, squares of dimension $a'\times a'$, then we have a box with a height of $a'$ and length+width $a - 2a'$ each. That gives us a volume of $$V = a'(a-2a')^2 = a'(a^2 - 4aa' + 4a'^2)= a'a^2 - 4aa'^2 + 4a'^3$$
We know that the $a'\leq \frac 12 a$, since if we cut 4 squares of length $\frac 12$, we have no box material to construct a box, so the "resulting" box has volume $0$.
Differentiate $V$ with respect to $a'$, and set equal to $0$ to find the maximum value of $a'$ expressed in terms of $a$. That is, treat $a$ as a constant.
$$V'(a') = a^2 - 8aa' + 12a'^2$$ Now set $V'(a') = 0$ and solve for $a'$.
Note, we can help to clarify matters by using $x = a'$. Then $$V' = 12x^2 - 8ax + a^2 = 0\implies 3x^2 - 2ax + \frac{a^2}{4} = 0 = (3x -\frac 12 a)(x - \frac 12 a) = 0$$
So the only extrema occur when $3x - \frac 12a = 0 \iff x = a' = \frac a6$, or when $(x - \frac 12 a) = 0 \iff x = a' = \frac 12a$.
Note, as discussed above, we get minimum volume of $0$ when $x = a' = \frac 12 a$, leaving only one candidate left for the lenght of $a'$ which maximizes volume: $$x = a' = \frac a6$$
