Explanation:
there is no side marked y.
to get x :
the graphic shows us already the split of the overall object into sub-shapes :
2 right-angled triangles
1 rectangle
x is the sum of the width of the rectangle and the shorter leg of the larger, top right-angled triangle.
to get both we need to use Pythagoras :
c² = a² + b²
with c being the Hypotenuse (the side opposite of the 90° angle), a and b being the legs of the triangle.
let's start with the shorter leg of the larger triangle.
the Hypotenuse is 18, and the longer leg is the same as the length of the "underlying" rectangle : 10.
so, we get
18² = 10² + leg1²
324 = 100 + leg1²
leg1² = 224
leg1 = sqrt(224) = 14.96662955...
now to the width of the rectangle.
it is the same as the longer leg of the smaller triangle on the right side.
its Hypotenuse is 5. its shorter leg is 2.
so, we get
5² = 2² + leg2²
25 = 4 + leg2²
leg2² = 21
leg2 = width rectangle = sqrt(21) = 4.582575695...
x = leg1 + leg2 = 14.96662955... + 4.582575695... =
= 19.54920524...