TITLE: Prove that there exists a sequence $\{x_{n}\}$ such that for every $n\,\quad f_{n}$ has a global maximum
QUESTION [6 upvotes]: For every positive integer $n$ consider function $f_{n}(x)=n^{\sin x}+n^{\cos x},\ x \in \mathbb{R}$.
Prove that there exists a sequence $\{x_{n}\}$ such that for every $n,\  f_{n}$ has a global maximum at $x_{n}$ and $x_{n}\to 0$ as $n \to\infty$.

$(f_n(x))'=n^{\sin(x)}\cos(x)\ln(n)-n^{\cos(x)}\sin(x)\ln(n)$ it doesn't seems very nice.
I am stuck (inexperience I think..).
Any hints would be very appreciated.
Thanks.

REPLY [3 votes]: First, write
$$f'_n(x)=\ln n\left(\cos xn^{\sin x}-\sin xn^{\cos x}\right)$$
I'll discard the case $n=1$, since $f_1$ is constant. So $f'_n$ vanishes only if
$$\tan x=n^{\sin x-\cos x}$$
or
$$g(x)=\frac{\ln\tan x}{\sin x-\cos x}=\ln n$$
It can be easily checked that
$$\lim_{x\to0^+} g(x)=\infty$$
and
$$\lim_{x\to{\pi/4}^-} g(x)=\sqrt2$$
So there exists a zero of $f'_n$ at least for $n>e^{\sqrt 2}$, that is, for $n\geq 5$.
We will prove that $g$ is decreasing in $(0,\pi/4)$. We differentiate the function $h(x)=\ln g(x)$ to get
$$h'(x)=\frac{\cos x+\sin x}{\cos x-\sin x}-\frac{2}{\sin 2x(\ln\cos x-\ln\sin x)}$$
Since $\cos x$ and $\sin x$ are in the interval $(0,1)$, and there the derivative of $\ln$ is greater than $1$, we have
$$\ln\cos x-\ln\sin x>\cos x-\sin x$$
Thus,
$$\frac{\cos x+\sin x}{\cos x-\sin x}<\frac2{\cos x-\sin x}<\frac{2}{\sin 2x(\ln\cos x-\ln\sin x)}$$
and $h'(x)<0$. So $h$ is decreasing. Hence, $g$ is decreasing. This means that we can consider the function $u=g^{-1}$, defined in $(\sqrt 2,\infty)$, and it is also decreasing.
The sequence $x_n$ that we are looking for is given by
$$x_n=u(\ln n)$$
and
$$\lim x_n=u(\lim\ln n)=0$$
Remark: I know that there are left things to prove. Mainly:

The cases $n=2,3,4$.
The zeroes of $f'_n$ are actually maxima of $f_n$. The monotony of $g$ (the hard part of the problem, I think) should help.