For what real values of $x$ will the expression

$$
\sqrt{2 \sin x}-\sin x
$$

have the greatest value?
I. Solution. Let $a=\sqrt{\sin x}$, so we examine the quadratic expression $\sqrt{2} a - a^{2}$.

![](https://cdn.mathpix.com/cropped/2024_05_02_cb1450896cc4d100d155g-1.jpg?height=358&width=507&top_left_y=222&top_left_x=798)

We find the roots:

$$
-a^{2} + \sqrt{2} a = 0, \quad a(-a + \sqrt{2}) = 0
$$

Thus, the roots are: $a_{1}=0, a_{2}=\sqrt{2}$.

Since the coefficient of $a^{2}$ is negative, the function attains its maximum at the arithmetic mean of the two roots, that is,

$$
a = \sqrt{\sin x} = \frac{\sqrt{2}}{2}, \quad \sin x = \frac{1}{2}
$$

From this, it follows that $x_{1} = \frac{\pi}{6} + 2 k_{1} \pi \left(k_{1} \in \mathbb{Z}\right), x_{2} = \frac{5 \pi}{6} + 2 k_{2} \pi \left(k_{2} \in \mathbb{Z}\right)$.

# II. Solution. 

$$
\begin{aligned}
\sqrt{2 \sin x} - \sin x & = \sqrt{\sin x} \cdot (\sqrt{2} - \sqrt{\sin x}) \leq \\
& \leq \left(\frac{\sqrt{\sin x} + \sqrt{2} - \sqrt{\sin x}}{2}\right)^{2} = \left(\frac{\sqrt{2}}{2}\right)^{2} = \frac{1}{2}
\end{aligned}
$$

We used the squared form of the arithmetic and geometric mean inequality: $a b \leq \left(\frac{a + b}{2}\right)^{2}$, where equality holds when $a = b$.

Thus, the maximum value of the expression is $\frac{1}{2}$, and it is attained when $\sqrt{\sin x} = \sqrt{2} - \sqrt{\sin x}$, which implies $\sin x = \frac{1}{2}$. From this, it follows that the value of the expression is the largest when $x_{1} = \frac{\pi}{6} + 2 k_{1} \pi \left(k_{1} \in \mathbb{Z}\right)$ and $x_{2} = \frac{5 \pi}{6} + 2 k_{2} \pi \left(k_{2} \in \mathbb{Z}\right)$.