Example: Optimize a function over bounded domain

EXAMPLE 4 Find the points on the sphere \(x^2 + y^2 + z^2 = 4\) that are closest to and farthest from the point \((3, 1, -1)\).