4. Refer to the figure. A hemisphere is placed on top of a sphere having radius 2017. A second hemisphere is then placed on top of the first hemisphere, and a third hemisphere is also placed on top of the second hemisphere. All the centers are collinear, and the three hemispheres all have empty interiors and negligible width. What is the maximum height of this tower made up of the sphere and three hemispheres?
Answer: 6051
Solution: Let $r_{0}=2017$. In the figure below, $h_{i}^{2}=r_{i}^{2}-r_{i+1}^{2}$. By the Cauchy-Schwarz Inequality,
$$
\left(h_{0}+h_{1}+h_{2}+r_{3}\right)^{2} \leq 4\left(h_{0}^{2}+h_{1}^{2}+h_{2}^{2}+r_{3}^{2}\right)=4\left(r_{0}^{2}-r_{1}^{2}+r_{1}^{2}-r_{2}^{2}+r_{2}^{2}-r_{3}^{2}+r_{3}^{2}\right)=4 r_{0}^{2}
$$
and so
$$
h=r_{0}+\left(h_{0}+h_{1}+h_{2}+r_{3}\right) \leq r_{0}+2 r_{0}=3 r_{0}=6051 .
$$

The maximum height 6051 is attained if $h_{0}=h_{1}=h_{2}=r_{3}$, or equivalently, $r_{0}^{2}-r_{1}^{2}=r_{1}^{2}-r_{2}^{2}=$ $r_{2}^{2}-r_{3}^{2}=r_{3}^{2}$. This can happen by setting $h_{0}=h_{1}=h_{2}=r_{3}=\frac{r_{0}}{2}$.