What is the minimum of the expression $K=\sqrt{(x-a)^{2}+b^{2}}+\sqrt{(x-b)^{2}+a^{2}}$, where $a$ and $b$ are positive constants?
Without loss of generality, we can assume that $b \geq a$. Let's place the points $A, B$, and $X$ to the right of the origin $O$ on the number line such that their distances from $O$ are $a, b$, and $x$ respectively. (If $x$ is negative, $X$ would be to the left of $O$; in our diagram, the case $a < x < b$ is shown.) Let's place the points $A^{\prime}$ and $B^{\prime}$ on different sides of the line $AB$ such that $A A^{\prime}$ and $B B^{\prime}$ are both perpendicular to $AB$, and the distance $\overline{A A^{\prime}}$ is $b$, and the distance $\overline{B B^{\prime}}$ is $a$. Then, using the notation in the diagram, $\overline{A^{\prime} X} = \sqrt{(x-a)^{2} + b^{2}}$ and $\overline{X B^{\prime}} = \sqrt{(x-b)^{2} + a^{2}}$; hence $K = \overline{A^{\prime} X} + \overline{X B^{\prime}}$.

$P$ is the intersection of the line through $B^{\prime}$ parallel to $AB$ and the line $A A^{\prime}$. The line $A^{\prime} B^{\prime}$ intersects $AB$ at the point $X_{0}$. By the triangle inequality:

$$
K = \overline{A^{\prime} X} + \overline{X B^{\prime}} \geq \overline{A^{\prime} B^{\prime}} = \sqrt{{\overline{A^{\prime} P}}^{2} + {\overline{P B^{\prime}}}^{2}} = \sqrt{(a+b)^{2} + (b-a)^{2}} = \sqrt{2a^{2} + 2b^{2}}
$$

The minimum value of $K$ is thus $\sqrt{2a^{2} + 2b^{2}}$. This value is indeed achieved at the point $X_{0}$. The value of $x_{0}$, the distance from the origin to the point $X_{0}$, can be found using the similarity of the triangles $A^{\prime} A X_{0}$ and $B B^{\prime} X_{0}$:

$$
\frac{x_{0} - a}{b} = \frac{b - x_{0}}{a}, \quad \text{from which} \quad x_{0} = \frac{a^{2} + b^{2}}{a + b} \quad \text{follows.}
$$

![](https://cdn.mathpix.com/cropped/2024_05_02_5cf84698855c8b0e76c1g-1.jpg?height=667&width=485&top_left_y=835&top_left_x=863)