Problem 5. During the improvement of the city garden "Pythagoras," three alleys were initially laid out, forming a right-angled triangle with an acute angle $\alpha$. The next alleys were laid out as external squares on the sides of this triangle (resulting in a figure illustrating the Pythagorean theorem and called Pythagorean pants). Finally, on the third stage, the center of the largest square was connected with the vertex of the right angle by a straight alley, and the centers of the two smaller squares were connected to each other. Determine which of the alleys laid out in the third stage is longer. At what value of the angle $\alpha$ do their lengths differ the most?
Solution. Let the original triangle be $ABC$ (angle $C$ is right), the centers of the squares be $O_{1}, O_{2}, O_{3}$, and one of the vertices of a square be $D$ (see figure). Let angle $A$ be $\alpha$.

Let the sides of the original triangle, opposite to vertices $A, B$, and $C$, have lengths $a, b, c$ respectively.

$\angle O_{2} C A = \angle O_{1} C B = \pi / 4$ (angles between the diagonal and a side of the square), therefore, segments $O_{2} C$ and $C O_{1}$ lie on the same line. Each of them is equal to half the diagonal of its square. Thus,

$$
O_{1} O_{2} = \frac{a + b}{\sqrt{2}} \text{.}
$$

Triangles $ABC$ and $ABO_{3}$ are right, so they are inscribed in the same circle with diameter $AB$. Therefore, the inscribed angles $\angle A C O_{3}$ and $\angle A B O_{3}$ subtend the same arc, i.e., they are equal. But $\angle A B O_{3} = \angle C D A = \pi / 4$ (angles between the diagonal and a side of the square). Thus, $\angle A C O_{3} = \angle C D A$.

![](https://cdn.mathpix.com/cropped/2024_05_06_c25b1fb363b4d7d35e0ag-4.jpg?height=1314&width=1407&top_left_y=251&top_left_x=336)

$\angle D A B = \angle C A O_{3}$, since each of them equals $\pi / 4 + \angle C A B$. Therefore, triangles $DAB$ and $CAO_{3}$ are similar. From this, we have $\frac{D A}{A C} = \frac{D B}{C O_{3}}$. Now we can find

$$
C O_{3} = \frac{D B \cdot A C}{D A} = \frac{(a + b) \cdot b}{b \sqrt{2}} = \frac{a + b}{\sqrt{2}} \text{.}
$$

It turns out that $O_{1} O_{2} = CO_{3}$, regardless of the original right triangle $\triangle ABC$.

Answer: $O_{1} O_{2} = C O_{3}$ for any value of $\alpha$.