23: The right formula is
Differentiation gives
The moment the question asks about is when d = 13, from the Pythagoras rule this means x = 12.
Answer