Given a volume V for a conserve can, using calculus we find that the dimensions that minimise the surface area (and hence the cost of material) is such that the height is equal to the diameter (hence it looks like a square when viewed from the side).
But when I go to my cupboard I find that many cans are not manufactured in this ratio. Why would manufacturers ignore the optimal solution? Or, am I missing something?