Let us say we have a box. We know that the volume is $l \cdot w \cdot h$.We know that we are trying to optimize this problem with the constraint that $2 w+2 h+l$ is $112$. We know that the base is a square so the volume is now $l^2 h$. We also happen to know that $w=h$. So we have $4w+l=112$. We can isolate the constraint as such: $l=112-4w$. We then get this cubic $(112-4w)^2 \cdot w$. I am sure that you can do the rest.