Explanation:
the height BD is (using Pythagoras) :
BD² = CB² - CD² = 9² - 3² = 81 - 9 = 72
BD = sqrt(72)
the height to the Hypotenuse of a right-angled triangle is also the square root of the product of the segment lengths of the Hypotenuse (the segments created by point D).
so, BD = sqrt(3×(x-3))
therefore,
sqrt(72) = sqrt(3×(x-3))
72 = 3×(x-3) = 3x - 9
81 = 3x
x = 27