A Square Inside A Triangle (but with a twist) I have a right $\triangle ABC$ and I want to find the side length of one of the legs, $x$, when the square is at its max area, as shown in 
I am given that $AB + BC$ is $10$.
Here's what I tried so far:


*

*I found ratios between the sides using similarity, but I wasn't able to get a conclusive answer, just things in terms of each other.

*I tried to set up equations using the Pythagorean theorem, but that just ended up with some messy variable terms and zero actual progress.
The answer is $x=5$, but I want to know how I would go about approaching this kind of problem. It's like others I've seen before here and in other places, but not being given the side lengths threw me off.

You can show this strictly geometrically. 
By symmetry of the situation you can assume that $BD\ge DC$. Then form the triangle $EGH$ by mirroring $DCE$ by $E$. Now we see that the triangle $EGH$ can be extended to a square $FEGI$ congruent to $BDEF$ and therefore $BCE$ and $AFE$ is together of at least the same  area that $BDEF$. That is $BDEF$ is at most half of ther area of the triangle $ABC$. You also have that the maximal area of the triangle is when $x=5$ and that also happens to coincide with $BDEF$ having half of the ario of the triangle.

