Problem 5. A right-angled triangle with sides $3 \mathrm{~cm}, 4 \mathrm{~cm}$ and $5 \mathrm{~cm}$ has a square cut out. The square has the largest possible area and one vertex of the square coincides with a vertex of the triangle. Calculate the perimeter and area of the triangles that remain.
Solution. We use the notations as in the diagram on the right. Let

$$
\overline{A C}=3, \overline{B C}=4 \text { and } \overline{A B}=5 .
$$

Triangles $A B C$ and $A P N$ are right-angled and share a common acute angle, so $\triangle A B C \sim \triangle A P N$, which means $\frac{3-x}{x}=\frac{3}{4}$.

![](https://cdn.mathpix.com/cropped/2024_06_05_b353751bdd87cc544500g-12.jpg?height=286&width=503&top_left_y=400&top_left_x=979)

From the last equation, we get $x=\frac{12}{7}$. Therefore,

$$
\overline{P N}=\overline{P Q}=x=\frac{12}{7}, \overline{A N}=3-x=\frac{9}{7} \text { and } \overline{B Q}=4-x=\frac{16}{7} .
$$

Now, using the Pythagorean theorem, we get

$$
\overline{A P}=\sqrt{\overline{A N}^{2}+\overline{P N}^{2}}=\frac{15}{7} \text { and } \overline{P B}=\sqrt{\overline{P Q}^{2}+\overline{B Q}^{2}}=\frac{20}{7}
$$

Finally,

$$
\begin{aligned}
& L_{\triangle A P N}=\overline{A P}+\overline{P N}+\overline{A N}=\frac{15}{7}+\frac{12}{7}+\frac{9}{7}=\frac{36}{7} \text{ cm} \\
& L_{\triangle P B Q}=\overline{P B}+\overline{P Q}+\overline{B Q}=\frac{20}{7}+\frac{12}{7}+\frac{16}{7}=\frac{48}{7} \text{ cm} \\
& P_{\triangle A P N}=\frac{\overline{P N} \cdot \overline{A N}}{2}=\frac{1}{2} \cdot \frac{12}{7} \cdot \frac{9}{7}=\frac{54}{49} \text{ cm}^{2} \\
& P_{\triangle P B Q}=\frac{\overline{P Q} \cdot \overline{B Q}}{2}=\frac{1}{2} \cdot \frac{12}{7} \cdot \frac{16}{7}=\frac{96}{49} \text{ cm}^{2}
\end{aligned}
$$