I'm having a bit of trouble with the following question.
Find the maximum height above the x-axis of the cardioid $r = 2(1 + \cos(\theta))$. What is the area of the region that is inside of this cardioid and outside the circle $r = 6\cos(\theta) $?
I already found the maximum height. That wasn't difficult. However, I am not sure about the 2nd part.
The solutions does this and I get most of it. I got how the intersection points were found. That makes a lot of sense to me. I'm confused on how the $\theta = \frac{\pi}{2}$ and $\theta = \pi $ is found though. Where is that coming from and why is the integral split up at $\frac{\pi}{3}$ and again at $\frac{\pi}{2}$? Additionally, I notice the $\frac{5\pi}{3}$ isn't used anywhere.
I guess what I am confused about is the bounds for the integral. Why can't I just integrate from $\frac{\pi}{3}$ to $\frac{5\pi}{3}$?
Can someone clear up that part for me? I would greatly appreciate it.

There are two things to understand -
i) The circle $r = 6 \cos \theta$ forms for $-\frac{\pi}{2} \leq \theta \leq \frac{\pi}{2}$.
The circle is centered at $(3, 0)$ and has radius of $3$. Its equation is $(x-3)^2 + y^2 = 9$. When we represent this circle as $r = 6 \cos \theta$, we are basically taking distance of each point on the circle from the origin ($OA$ in the diagram). Geometrically, you can see $\angle OAB = 90^0, OB = 6$ and so $OA = r = 6 \cos \theta$. Now for $\theta = 0, OA = OB = 6$ and as we traverse counter-clockwise in the first quadrant, as $\theta$ increases $OA$ reduces and at $\theta = \frac{\pi}{2}, OA = 0 $ as $A$ and $O$ coincide. The same logic in the fourth quadrant.
ii) We have to find area of cardioid outside of circle
I will only talk about the area above x-axis. We can double the area as the curves are symmetric about x-axis. Area of cardioid outside of the circle is only between $\frac{\pi}{3} \leq \theta \leq \pi$.
Now given the circle is only defined between $\frac{\pi}{3}$ and $\frac{\pi}{2}$, we need to divide the integral into two. The way the solution does is that it calculates the area of the cardioid between $\frac{\pi}{3}$ and $\pi$ and then subtracts the area of the circle ($\frac{\pi}{3} \leq \theta \leq \frac{\pi}{2}$) from it. Then it doubles it as the same area is formed below x-axis too.
You could also write the integral to find area as below,
$\displaystyle 2 \int_{\pi/3}^{\pi/2} \int_{6\cos\theta}^{2(1+\cos\theta)} r \ dr \ d\theta + 2 \int_{\pi/2}^{\pi} \int_0^{2(1+\cos\theta)} r \ dr \ d\theta$