3. $[\mathbf{3 0}]$ Let $x$ and $y$ be complex numbers such that $|x|=|y|=1$.
(a) [15] Determine the maximum value of $|1+x|+|1+y|-|1+x y|$.
(b) [15] Determine the maximum value of $|1+x|+|1+x y|+\left|1+x y^{2}\right|+\ldots+\left|1+x y^{2011}\right|-1006|1+y|$.
Solution:
(a) Answer: $2 \sqrt{2}$
(b) Answer: $2012 \sqrt{2}$ We divide the terms into 1006 sums of the form
$$
\left|1+x y^{2 k}\right|+\left|1+x y^{2 k+1}\right|-|1+y| .
$$

For each of these, we obtain, as in part a,
$$
\begin{aligned}
\left|1+x y^{2 k}\right|+\left|1+x y^{2 k+1}\right|-|1+y| & \leq\left|1+x y^{2 k}\right|+\left|x y^{2 k+1}-y\right| \\
& =\left|1+x y^{2 k}\right|+|y|\left|1-x y^{2 k}\right| \\
& =\left|1+x y^{2 k}\right|+\left|1-x y^{2 k}\right| \\
& \leq 2 \sqrt{\left|1-x^{2} y^{4 k}\right|}
\end{aligned}
$$

Again, this is maximized when $x^{2} y^{4}=-1$, which leaves a total sum of at most $2012 \sqrt{2}$. If we let $x=i$ and $y=-1$, every sum of three terms will be $2 \sqrt{2}$, for a total of $2012 \sqrt{2}$, as desired.