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.