Find the maximum value of a sum of cosines given certain condition In my calculus class, I've come across this problem when we were on the topic of Jensen's Inequality:
\begin{multline}A=\{\cos(x_1)\cos(x_2)\dots\cos(x_n)\in\Bbb{R}:\\n\in\Bbb{N},x_1^2+...+x_n^2=1\}.\end{multline}
We are tasked with finding $\sup A$.
I have tried the obvious approach of writing
$$\cos(x_1)\cos(x_2)\dots\cos(x_n)=e^{\ln(\cos(x_1))+\dots+\ln(\cos(x_n)}$$
and then trying to find an achievable upper bound for the value of $$\ln(\cos(x_1))+\dots+\ln(\cos(x_n)$$
by using Jensen's inequality for the concave function $\ln(\cos(x))$ in hope that those pesky squares
could be dealt with using $$\sqrt{\dfrac{a_1^2+...+a_n^2}{n}}\geqslant\dfrac{a_1+...+a_n}{n}$$
but so far that didn't help.
I am quite convinced that the answer will be $\dfrac{1}{\sqrt{e}}$ since that is what 
$e^{\ln(\cos(x_1))+\dots+\ln(\cos(x_n)}$ approaches from below when $x_1=x_2=...=x_n$ and $n$ goes to $\infty$, but can't prove it.
Using different methods I've managed to show that the answer is smaller than $e^{\cos(1)-1}$ which is just barely larger than $\dfrac{1}{\sqrt{e}}$, but in proving so I have used inequalities with different equality conditions.
Any help would be appreciated as I feel I am missing something I should definitely find out by now.
By the way, no integrals allowed :)
Yay early calc
 A: Let $x_i^2=a_i$.
Thus, $a_1+...+a_n=1$ and since $$\left(\ln\cos\sqrt{x}\right)''=\frac{\sin2\sqrt{x}-2\sqrt{x}}{8\sqrt{x^3}\cos^2\sqrt x}<0,$$ by Jensen we obtain:
$$\prod_{i=1}^n\cos x_i=e^{\sum\limits_{i=1}^n\ln\cos\sqrt{a_i}}\leq e^{n\ln\cos\sqrt{\frac{a_1+...+a_n}{n}}}=\cos^n\frac{1}{\sqrt n}.$$
The equality occurs for $x_1=...=x_n=\frac{1}{\sqrt n},$ which says that we got a maximal value.
A: Here's a solution with calculus and Lagrange multipliers:
We can minimize the function $f=\ln A-\lambda(x_1^2+...+x_n^2-1)$. Taking the gradient we find that:
$$\frac{\partial f}{\partial x_i}=\tan(x_{i})-2\lambda x_i, ~~i=\{1,...,n\}$$ 
Thus we obtain the following equations for the extrema:
$$\frac{\tan(x_1)}{x_1}=...=\frac{\tan(x_n)}{x_n}=2\lambda$$
It can be shown easily that the function $f(x)=\frac{\tan(x)}{x}$ is increasing in the interval $(0,1)$ and therefore we conclude that $x_1=...=x_n$.That in turn because of the constraint forces the $x_i$'s to the value 
$$x_1=...=x_n=\frac{1}{\sqrt{n}}$$
and A attains a maximum with value 
$$A\leq \cos^n\Big(\frac{1}{\sqrt{n}}\Big)$$
It is easy to prove that the point found above is a maximum too, since 
$$\frac{\partial^2 f}{\partial x_i^2}=\frac{1}{\cos^2(x_i)}-2\lambda=\frac{1-\frac{\sin(2x_i)}{2x_i}}{\cos^2(x_i)}<0$$
so the Hessian is diagonal (all cross derivatives vanish for this function) and all eigenvalues are negative, indicating a maximum.
