4. Two pyramids have a common base - a square with side length $a$. Both pyramids are on the same side of the square, their heights have the same length $b$, and the feet of their heights are at the midpoints of opposite sides of the square. Calculate the volume of the common part of these two pyramids.
## Solution.

Let the points and lengths be marked as in the figure.

![](https://cdn.mathpix.com/cropped/2024_05_30_b67770dbc376921a4b0eg-4.jpg?height=740&width=771&top_left_y=651&top_left_x=627)

The intersection of the given pyramids is the body $A B C D G H$.

From the similarity of triangles $K L E$ and $K L M$, it follows that $\frac{a}{b}=\frac{a / 2}{v}$, so the height of the intersection is $v=\frac{b}{2}$. Furthermore, from the similarity of triangles $G H E$ and $B C E$, it follows that $\frac{|G H|}{a}=\frac{|E M|}{|E L|}=\frac{1}{2}$, so $|G H|=\frac{a}{2}$. (10 points) We complete the intersection of the pyramids $B A G C D H$ to the prism $B A P C D Q$, as shown in the figure below.

![](https://cdn.mathpix.com/cropped/2024_05_30_b67770dbc376921a4b0eg-4.jpg?height=633&width=751&top_left_y=1731&top_left_x=643)

We have $|P G|=|H Q|=\frac{a}{4}$. The volume of the intersection is calculated by subtracting the volumes of the pyramids $B A P G$ and $C D Q H$ from the volume of the prism $B A P C D Q$.

$$
V=\frac{a v}{2} \cdot a-2 \cdot \frac{1}{3} \cdot \frac{a v}{2} \cdot \frac{a}{4}=\frac{5 a^{2} b}{24}
$$