Consider the cross-section with the tip of the pyramid at the origin, and the base at \(x= h\text{.}\) We have a line going through the origin and the point \(\lrpar{h,\dfrac{L}{2}}\text{.}\) This means the equation of the line is given by \(y = \dfrac{L}{2h}x\text{.}\)
Now, cross-sectional areas are squares; this means the height of each square is given by \(2\cdot \dfrac{L}{2h}x = \dfrac{L}{h}x\text{.}\) So, the cross-sectional area is \(\dfrac{L^2}{h^2}x^2\text{.}\) This means the volume is given by \(\ds \int_0^h \dfrac{L^2}{h^2}x^2\, dx = \dfrac{1}{3}L^2h\)