21. Consider two concentric circles on the same plane with radii $R$ and $r (R > r)$. Let $P$ be a fixed point on the circumference of the smaller circle, and $B$ be a moving point on the circumference of the larger circle. The line $BP$ intersects the larger circle at another point $C$. The line $l$ passing through point $P$ and perpendicular to $BP$ intersects the smaller circle at another point $A$ (if $l$ is tangent to the smaller circle at $P$, then $A = P$). (1) Find the set of values taken by the expression $BC^2 + CA^2 + AB^2$; (2) Find the locus of the midpoint of segment $AB$.
21. Let the centers of the two circles be $O$, and draw $OM$ perpendicular to $BC$ through $O$, intersecting $BC$ at $M$. Let $AP = 2t$, so $OM = t$. Thus, $BC = 2BM = 2\sqrt{R^2 - t^2}$, which means $BP^2 + CP^2 = 2(R^2 + r^2) - 4t^2$. Therefore, $BC^2 + CA^2 + AB^2 = BC^2 + (PC^2 + PA^2) + (BP^2 + PA^2) = 6R^2 + 2r^2$.

This is a constant, independent of the position of $B$ (even in the special case where $A = P$, the expression $BC^2 + CA^2 + AB^2$ still takes the same value). Hence, the set of values for the expression is $\{6R^2 + 2r^2\}$. This answers the first part of the question.
Now let's solve the second part.
Draw a line through $A$ parallel to $CB$, intersecting the larger circle at points $C'$ and $B'$. In this case, it is easy to see that $PBB'A$ forms a rectangle, so the midpoint of segment $AB$ is also the midpoint of segment $PB'$. As $B$ moves around the larger circle once, $B'$ also moves around the larger circle once. This indicates that the locus is a circle with the midpoint of segment $OP$ as its center and $R/2$ as its radius, covering four quadrants.