Hello, perash!

I used the same approach as ticbol, but got a different answer.

Consider a pyramid with a square base. The side length of the base is 2 units

and the height of the pyramid is 1 unit. Imagine placing a cube inside this pyramid

(resting on the base of the pyramid) so that each of the four top corners of the cube

is touching each of the 4 slanted edges of the pyramid.

Find the dimensions of the cube.

That is, find the value, in units, of the length of one edge of the cube. Looking down on the pyramid, we see: Code:

*-----------*
| * * |
| * * |
| * | 2
| * * |
| * * |
*-----------*
2

The diagonal of this square is $\displaystyle 2\sqrt{2}$

Slice the pyramid along a diagonal and we have this cross-section: Code:

- *
: * | *
: * | *
: *-----+-----*
1 * | | | *
: * | | | *
: * | | 2x| *
: * | | | *
- *---------*-----*-----*---------*
: √2 : x : √2-x :

The lower-right right triangle is similar to the largest right triangle.

We have: .$\displaystyle \frac{2x}{\sqrt{2}-x} \:=\:\frac{1}{\sqrt{2}} \quad\Rightarrow\quad 2\sqrt{2}x \:=\:\sqrt{2} - x$

. . $\displaystyle 2\sqrt{2}x + x \:=\:\sqrt{2} \quad\Rightarrow\quad (2\sqrt{2}+1)x \:=\:\sqrt{2} \quad\Rightarrow\quad x \:=\:\frac{\sqrt{2}}{2\sqrt{2}+1}

$

The side of the cube is: .$\displaystyle 2x \;=\;\frac{2\sqrt{2}}{2\sqrt{2} + 1} \;=\;\frac{2(4-\sqrt{2})}{7}$