5. Two vertices of a square lie on a circle of radius $r$, and the other two vertices lie on a tangent to this circle. Determine the length of the side of the square.

Each task is scored out of 10 points.

The use of a pocket calculator or any reference materials is not allowed.
5. Let the labels be as in the figure
![](https://cdn.mathpix.com/cropped/2024_05_30_c6dcfe90a3e35b3b7906g-13.jpg?height=1614&width=1446&top_left_y=353&top_left_x=270)

It holds that $|\Varangle B A E|=|\Varangle B G E|$ because these are inscribed angles over the same chord $\overline{B E}$.

Also, $|\Varangle E F A|=|\Varangle G F B|=90^{\circ}$.

By the AA similarity criterion, it follows that $\triangle A F E \sim \triangle G F B$.

From the similarity, it follows that $|A F|:|G F|=|F E|:|F B|$, or $\frac{a}{2}:(2 r-a)=a: \frac{a}{2}$.

Finally, $a=\frac{8}{5} r$.