This is a Sangaku-like puzzle (see https://learn1.open.ac.uk/mod/oublog/viewpost.php?post=230691)
We have a square inscribed in a triangle of known base b and height h, as shown. What is the length s of the square's side?
I called this a Samurai puzzle because many of the original sangaku were the work of Samurai.
(Solution in Comments.)