A square is inscribed in a right triangle, as shown below. The legs of the triangle are 2 and 3. Find the side length of the square.

Here is the code:

[asy]

unitsize(1.5 cm);

pair A, B, C, D, E, F, G;

A = (0,0);

C = (5,0);

B = (3^2/5,3*4/5);

D = extension(B, A + (0,-5), A, C);

G = extension(B, C + (0,-5), A, C);

E = extension(D, D + (0,1), A, B);

F = extension(G, G + (0,1), B, C);

draw(A--B--C--cycle);

draw(D--E--F--G);

[/asy]

Guest Oct 3, 2022