The surface area of the part of the sphere $x^2 + y^2 + z^2 = a^2 $ that lies within the cylinder $x^2 + y^2 = ax $ and above the $xy$-plane.
When determining boundaries, how do you get $ r = a \cos \theta $ and why is $ -\pi/2 \le \theta \le \pi/2 $ ?
Thank you!

The equation of the cylinder is a circle of radius $a/2$ centered at $(a/2,0)$ in the $xy$ plane. This is a circle tangent to the origin, and in polar coordinates, its equation is $r = a \cos \theta$. (When you convert, you get $r^2=ar\cos\theta$, then divide by $r$.) As $\theta$ goes from $-\pi$ to $\pi$, the circle is drawn twice, so we need only $-\pi/2 \leq \theta \leq \pi/2.$