Problem
A square is inscribed in a right-angled triangle such that one of the square’s vertices coincides with the right angle vertex of the triangle. The legs (or cathetus) of the right triangle are of lengths a and b. Find the perimeter of the inscribed square.
Solution
Let’s denote the side length of the square as x (see the figure).
Consider the similar triangles \triangle ACB and \triangle FEB. (Assuming C is the right angle, A and B are the other vertices, and the square’s vertices are F, E, C, and a point on AB).
Due to similarity, we can set up the proportion:
\frac{a}{x} = \frac{b}{b-x}.
Now, we solve for x:
a(b-x) = bx
ab - ax = bx
ab = ax + bx
ab = x(a+b)
x = \frac{ab}{a+b}.
The perimeter of the square, P, is 4 times its side length:
P = 4x = \frac{4ab}{a+b}.
Answer:
The perimeter of the square is \frac{4ab}{a+b}.