设AP=X则PD=10-X
X²+4²+(10-X)²+4²=10²
X²+16+100-20X+X²+16=100
2X²+32-20X=0
X²+16-10X=0
(X-2)(X-8) =0
所以X=2或8