Let $D\subseteq [0,2\pi]\times [0,2\pi]$ and ${D}^\complement$ be the complementary region, i.e.
- $D \cup {D}^\complement = [0,2\pi]\times [0,2\pi]$ and
- $D\cap {D}^\complement = \emptyset$.
I would like to find $D$ such that I maximize the quantity $$ \int_D \cos(x)\mathrm{d}x \mathrm{d}y-\int_{{D}^\complement} \cos(x)\mathrm{d}x \mathrm{d}y$$ while $$\int_D \cos(y)\mathrm{d}x \mathrm{d}y-\int_{{D}^\complement} \cos(y)\mathrm{d}x \mathrm{d}y>T$$ for some value $T$.