Is the proof on the volume of a generalzing the volume of a square pyramid correct
Introduce a $z$ axis perpendicular to the base, and positive in the downward direction, with the origin at the tip of the pyramid.
Let the area of the base of the pyramid be $B$. For $0<z<h$, a cross section parallel to the base of the pyramid is similar to the base. Since the side lengths are $\propto z$, the area are $\propto z^2$.
$$\text{Area of Cross Section at a depth of z = } A(z) = B\times\frac{z^2}{h^2}$$
Now, using the standard Calculus formula for volume of a solid: $$\text{Volume} =\int_{0}^{h}{A(z)}dz =\int_{0}^{h}{\left(B\times\frac{z^2}{h^2}\right)}dz =\frac{B}{h^2}\int_{0}^{h}{z^2}dz =\frac{B}{h^2}\times \frac{h^3}{3} =\frac{Bh}{3} $$
which is the standard formula for volume of a pyramid