(1) Integral formula:

W=dWh(y)ρgdVρgh(y)A(y)dy

(2) Integrand components:

Option 1: Set y=0 at the base, going up.

Take a cross-sectional slice with a vertical plane. This intersects the surface of the pyramid in a triangle whose width w(y) is the side length of the square (the horizontal cross section) at height y.

w(y)=230+0230146y

Note that A(y)=w(y)2. So we have:

W=0146ρgy(230230146y)2dy

Option 2:

Set y=0 at the vertex, going down.

w(y)=0+2300146y

And:

W=0146ρg(146y)(230146y)2dy