I am asked to find the portion of the area $r=2a \cos^2 (\frac{\theta}{2})$ and $r=2a \sin^2 (\frac{\theta}{2})$ have in common with each other provided $a>0$ on the polar plane.
Can someone help me set up the integral please? I'm having some trouble with that part.
I know the formula is:
If I set $r=2a \cos^2 (\frac{\theta}{2})$ and $r=2a \sin^2 (\frac{\theta}{2})$ equal to each other, I get
$2a\sin^2 (\frac{\theta}{2})=2a \cos^2 (\frac{\theta}{2})$
$1=\tan^2(\frac{\theta}{2})$
If I solve this, I get $\theta = \frac{\pi}{2}, \frac{3\pi}{2}$
How would I set up the integral now though? Like, which area would I subtract so I capture the entire domain of intersection? I am a little confused about that. Any help would be much appreciated! Thanks!

Let me give names to the two functions you mention. Let \begin{align} r_1(\theta) &= 2a \cos^2(\theta/2) \\ r_2(\theta) &= 2a \sin^2(\theta/2) \end{align} Based on this picture of $\color{green}{r_1}$ and $\color{red}{r_2}$ for $a=1$:
It looks like you can compute the intersecting area by $$ A = \int_{-\pi/2}^{\pi/2} \frac{1}{2} \color{red}{r_2}(\theta)^2 \, d\theta + \int_{\pi/2}^{3\pi/2} \frac{1}{2} \color{green}{r_1}(\theta)^2 \, d\theta $$ But based on the symmetry, if you want to take a shortcut, you can probably just do: $$ A = 4 \int_0^{\pi/2} \frac{1}{2} \color{red}{r_2}(\theta)^2 \, d\theta = 4 \int_{\pi/2}^{\pi} \frac{1}{2} \color{green}{r_1}(\theta)^2 \, d\theta $$