Having a bit of a problem calculating the volume of a take-away box:
I originally wanted to use integration to measure it by rotating around the x-axiz, but realised that when folded the top becomes a square, and the whole thing becomes rather irregular. Since it differs in circumference I won't be able to measure it like I planned.
Is there any method or formula that can be used to measure a shape like this, or do I just have to approximate a cylinder and approximate a box and add those two together?









As the shape of the solid is not clearly defined, I'll make the simplest assumption: lateral surface is made of lines, connecting every point $P$ of square base to the point $P'$ of circular base with the same longitude $\theta$ (see figure below).
In that case, if $r$ is the radius of the circular base, $2a$ the side of the square base, $h$ the distance between bases, a section of the solid at height $x$ (red line in the figure) is formed by points $M$ having a radial distance $OM=\rho(\theta)$ from the axis of the solid given by: $$ \rho(\theta)={a\over\cos\theta}{x\over h}+r\left(1-{x\over h}\right), \quad\text{for}\quad -{\pi\over4}\le\theta\le{\pi\over4}. $$ A quarter of the solid has then a volume given by: $$ {V\over4}=\int_0^h\int_{-\pi/4}^{\pi/4}\int_0^{\rho(\theta)}r\,dr\,d\theta\,dx= \frac{h}{12} \left(4 a^2+\pi r^2 + 2ar \ln{\sqrt2+1\over\sqrt2-1}\right). $$