Neem $AP=x$ en gebruik de stelling van Pythagoras.