5. The side of the square $A B C D$ is 28. On the side $C D$, a point $E$ is marked, and inside the square, a point $P$ is such that $P E \perp C D$, and $A P=P B=P E$. Find the length of the segment $A P$. If necessary, round the answer to the hundredths.
Answer: $35 / 2=17.5$.

Solution. Let $A P=P E=P B$ be $x$. Extend the segment $P E$ to intersect side $A B$ at point $F$. Note that $P F \perp A B$, since $A B \| C D$. Therefore, in the isosceles triangle $A P B$, the height $P F$ is also the median, so $A F=F B=A B / 2=14$.

![](https://cdn.mathpix.com/cropped/2024_05_06_b124656272d750e4349eg-3.jpg?height=621&width=603&top_left_y=55&top_left_x=721)

Moreover, note that $A D E F$ is a rectangle, so $E F=A D=28$, and then $P F=E F-E P=$ $28-x$. Applying the Pythagorean theorem to triangle $A P F$, we get $x^{2}=14^{2}+(28-x)^{2}$. Expanding the brackets and solving the resulting linear equation, we obtain $x=35 / 2=17.5$.