2. In a regular quadrilateral pyramid, a cube is inscribed such that 4 of its vertices lie on the edges of the pyramid, and the remaining 4 vertices lie on the base of the pyramid. Determine the side length of the cube if the side length of the pyramid is $a$ and the height is $H$.
Solution. Let the cube $A_{1} B_{1} C_{1} D_{1} A_{2} B_{2} C_{2} D_{2}$, with edge $y$, be inscribed in the pyramid $A B C D E$, with edge $a$ and height $H$, under the given condition, as shown in the diagram. It is immediately clear that $\triangle A C E \sim \triangle A_{2} C_{2} E$, from which it follows

$$
\frac{\overline{A C}}{\overline{A_{2} C_{2}}}=\frac{a \sqrt{2}}{y \sqrt{2}}=\frac{H}{H-y} \text { i.e. } a(H-y)=H y
$$

From this equality, it follows that $y=\frac{a H}{a+H}$.

![](https://cdn.mathpix.com/cropped/2024_06_05_4c8be07b5633c340c710g-1.jpg?height=685&width=507&top_left_y=1172&top_left_x=996)