Let $a_{i} \in \mathbb R_{>0}$ and consider the following problem:
$$\begin{array}{ll} \text{maximize} & f(x) := \displaystyle\prod_{i=1}^{n} x_{i}^{a_{i}}\\ \text{subject to} & x \in S\end{array}$$
where $S$ is a convex set. Find a global maximum and show that it is unique.
It is an unconstrained problem. I have calculated its first order and second order derivative but I am not concluding a perfect solution.