4. Let $A B C D$ be a square in the plane $\mathcal{P}$. Determine the minimum and maximum value of the function $f: \mathcal{P} \rightarrow \mathbb{R}$ given by

$$
f(P)=\frac{P A+P B}{P C+P D}
$$
4. Ptolemy's inequality for quadrilateral $BCPD$ gives $BC \cdot PD + BD \cdot PC \geqslant CD \cdot PB$, i.e., $PD + PC \sqrt{2} \geqslant PB$. Similarly, $PC + PD \sqrt{2} \geqslant PA$. By adding these two inequalities, we get $(PC + PD)(\sqrt{2} + 1) \geqslant PA + PB$, i.e., $f(P) \leqslant \sqrt{2} + 1$. This value is achieved when $P$ is on the shorter arc $CD$ of the circle $ABCD$.

Analogously, $(PA + PB)(\sqrt{2} + 1) \geqslant$

![](https://cdn.mathpix.com/cropped/2024_06_04_2726a9c5153f9d3c9cfcg-3.jpg?height=319&width=508&top_left_y=363&top_left_x=1162)
$PC + PD$, i.e., $f(P) \geqslant \frac{1}{\sqrt{2} + 1} = \sqrt{2} - 1$, and this value is achieved when $P$ is on the shorter arc $AB$ of the circle $ABCD$.