Draw a horizontal line on each face of the pyramid at height y. Since the sides are lines, the length of those lines is a linear function of y: L= my+ b. When y= 0, that length is a so L= m(0)+ b= a or b= a. When y= h, that length is 0 so L= m(h)+ a= 0 and .

That is, slicing the pyramind horizontally at height y gives a cross section of an equilateral triangle with side length .

What is the area of such a triangle, A(y)? Imagining a thin layer, of height dy, the volume of such a layer is A(y)dy. Integrate that from y= 0 to y= h to find the volume of the pyramid.