[Math] Volume of a cube with integration.

integrationproof-verification

Say we wanted to derive the formula for the volume of a cube with integration. Each "slice" of the cube has area $x^2$, with "width" $dx$. Integrate from $0$ to $x$, and I believe you would get the following:

$$\int_0^x x^2dx$$

And this equals $\frac 13x^3$, however the volume of a cube is given by $x^3$!

What is wrong with this process?

Best Answer

The problem is that with $\int_0^x x^2dx$ you are actually calculating the volume of a kind of inverted pyramid. As @Fermat suggested, you have to maintain the side fixed (through $a^2$), otherwise it changes as the third axis does.