### Instruction: Let $S$ be the set of all points $(x,y,z)$ such that $x^2 + y^2 + z^2 \le 25$ and $z \ge 0.$  Compute the side length of the largest cube contained in $S.$.### Response: I recognize that $S$ is the upper half of a sphere with radius 5 and center at the origin.
I want to find a cube that fits inside this half-sphere and has the largest possible side length.
I imagine placing the cube so that its bottom face is parallel to the $xy$-plane and its center is on the $z$-axis.
Then the distance from the center of the cube to any vertex is half the diagonal of the cube.
If I call the side length of the cube $s,$ then the diagonal of the cube is $s\sqrt{3}$ by the Pythagorean theorem.
So the distance from the center of the cube to any vertex is $\frac{s\sqrt{3}}{2}.$
This distance must be less than or equal to the distance from the origin to any point on the sphere, which is 5.
Therefore, I have the inequality $\frac{s\sqrt{3}}{2} \le 5.$
I can solve for $s$ by multiplying both sides by $\frac{2}{\sqrt{3}}$ and simplifying.
I get $s \le \frac{10}{\sqrt{3}}.$
This is the largest possible value of $s,$ since any larger value would make the cube poke out of the sphere.
To express $s$ in simplest radical form, I can rationalize the denominator by multiplying the numerator and denominator by $\sqrt{3}.$
I get $s \le \frac{10\sqrt{3}}{3}.$