I am trying to find a function prescribed in polar coordinates $r = f(\theta)$ that maximizes the following quantity
$$\frac{\int_0^{2\pi}r^3\cos\theta\, d\theta}{\int_0^{2\pi}r^4\, d\theta}$$
subject to the constraint $r \leq R \quad \forall \theta \in [0,2\pi)$.
I don't even know where to begin to be honest. I went through a couple of books on calculus of variations. I haven't seen anything that comes close to the problem I have at hand.
Clearly the maximum is $+\infty$. Consider for example $r=f(\theta)=\epsilon |\cos(\theta/2)|$. Then $$ \frac{\int_0^{2\pi}r^3\cos\theta d\theta}{\int_0^{2\pi}r^4 d\theta}=\frac{32}{15\pi\epsilon} $$ and this tends to $+\infty$ as $\epsilon$ goes to $ 0^+$.