we know that
see the attached figure with letters
applying the Pythagorean theorem
in the triangle ABE
BE²=x²-9²------------> equation 1
in the triangle ABD
BD²=(16+9)²-x²--------> BD²=25²-x²-----------> equation 2
in the triangle BED
BD²=(BE)²+16²--------------> equation 3
I substitute 1 and 2 in 3
25²-x²=x²-9²+16²------> 25²+9²-16²=2x²-------> 2x²=450--------> x²=225
x=√225--------> x=15 cm
the answer is x=15 cm