Let be two complexs numbers $z_1$, $z_2$ satisfying the conditions $|z_1| = 1$, $|z_2| = 1$, $\left| z_1 + z_2\right| =\sqrt{2}$. Find the least and the greatest value of the value
$$P = \left |3 i (z_1 + z_2) + 9 - z_1z_2\right |.$$
Solution. Suppose $z_1 = 1$, $z_2 = x + i y. $ we find $z_2$ by the system of equations
$$\begin{cases}
|z_2| = 1,\\
\left| z_1 + z_2\right| =\sqrt{2}
\end{cases}$$
that is mean
$$\begin{cases}
x^2 + y^2 = 1,\\
(x+1)^2 + y^2 =2.
\end{cases}$$
Solve this system, we have $(x,y)=(0,1) $ or $(x,y)=(0,-1) $, and then $z_2 = i$ or $z_2 = -i$
With $z_1 = 1$, $z_2 = i$, we have $$P = \left |3 i (1 + i) + 9 - i\right | = 2\sqrt{10}.$$
With $z_1 = 1$, $z_2 = i$, we have $$P = \left |3 i (1 - i) + 9 + i\right | = 4\sqrt{10}.$$
Thus $\max P =4\sqrt{10} $ and $\min P =4\sqrt{10}. $
Let $z_1=e^{ix}, z_2=e^{iy}$, take the principle branch $\arg z\in (-\pi, \pi]$. Since $z_1, z_2$ are symmetric, without loss of generality, let $y\ge x$
$$|z_1+z_2|=\sqrt2\Longrightarrow\cos(x-y)=0\Longrightarrow y=x+\frac\pi2$$
Next, plug in and simplify, we get
$$P=2\sqrt{(5-3\sin x)(5-3\sin y)}=2\sqrt{(5-3\sin x)(5-3\cos x)}=2\sqrt Q$$
take derivative for $Q'=0$ to find extrema points
$$(\cos x-\sin x)(-5+3\cos x+3 \sin x)=0\tag{1}$$
and note that $\cos x+\sin x\le\sqrt2<\frac53$, hence, (1) implies
$$\sin x=\cos x\Longrightarrow x_{1}=-\frac{3\pi}4,~~~x_{2}=\frac\pi4,$$
therefore,
$$\max P=P(x_1)=10+3\sqrt{2},~~~~\min P=P(x_2)=10-3\sqrt2$$