check the picture below.
running a perpendicular line like so from the right-angle, makes three similar triangles, the large, containing the smaller ones, and a medium and a small one. Now, using proportions, you can just use there, the medium and smalle to get "x".