Sharygin I.F.

On the side $AB$ of triangle $ABC$, a square is constructed externally with center $O$. Points $M$ and $N$ are the midpoints of sides $AC$ and $BC$ respectively, and the lengths of these sides are $a$ and $b$ respectively. Find the maximum of the sum $OM + ON$ as the angle $ACB$ changes.
Let $A B D E$ be a constructed square, and $\angle C=\gamma$.

$O M$ is the midline of triangle $A C D$, so $C D=2 O M$. Similarly, $C E=2 O N$. Therefore, it is sufficient to find the maximum of $C D+C E=2(O M+O N)$.

First method. On the side $B C$ of triangle $A B C$, construct a square $C B D_{1} E_{1}$ externally (see figure). Triangles $A B D_{1}$ and $D B C$ are equal by two sides and the angle between them. Thus, $C D=A D_{1}$.

![](https://cdn.mathpix.com/cropped/2024_05_06_dd7345f2b5ef58b5189dg-09.jpg?height=592&width=508&top_left_y=636&top_left_x=775)

In triangle $A C D_{1}$, two sides are known: $A C=b, C D_{1}=a \sqrt{2}$. Additionally, $\angle A C D_{1}=\gamma+45^{\circ}$. The third side $A D_{1}$ takes its maximum value when the triangle degenerates into a segment. Therefore, $C D$ reaches its maximum value of $b+a \sqrt{2}$ when $\gamma=135^{\circ}$. Similarly, $C E$ reaches its maximum value of $a+b \sqrt{2}$ at the same value of $\gamma$.

Thus, each of the quantities $O M, O N$ reaches its maximum when $\gamma=135^{\circ}$. Therefore, their sum is also maximal at $\gamma=135^{\circ}: \max (O M+O N)=\frac{1+\sqrt{2}}{2}(a+b)$.

Second method. Let $\angle A=\alpha, \angle B=\beta, A B=c, C D=d, C E=e$. By the cosine rule, $c^{2}=a^{2}+b^{2}-2 a b \cos \gamma$

$e^{2}=b^{2}+c^{2}-2 b c \cos \left(90^{\circ}+\alpha\right)=b^{2}+c^{2}+2 b c \sin \alpha$. Substituting $c^{2}$ from the first formula into the second and using the sine rule, we get:

$e^{2}=2 b^{2}+a^{2}-2 a b \cos \gamma+2 b c \sin \alpha=2 b^{2}+a^{2}+2 a b(\sin \gamma-\cos \gamma)$. Similarly, $d^{2}=2 a^{2}+b^{2}+2 a b(\sin \gamma-\cos \gamma)$. Therefore, the maximum of $d$ and $e$ is achieved simultaneously with the maximum of the expression $\sin \gamma-\cos \gamma$, which is at $\gamma=135^{\circ}$. Thus, $d+e$ is maximal when $\gamma=135^{\circ}$.

Third method. By Ptolemy's inequality (see problem $\underline{57373}$), $C D \cdot A B \leq B C \cdot A D + A C \cdot B D$, i.e.,

$C D \leq B C \sqrt{2} + A C = a \sqrt{2} + b$. Equality is achieved when the quadrilateral $A C B E$ is cyclic. The rest follows as in the first method.

## Answer

$\frac{1+\sqrt{2}}{2}(a+b)$