Find all $n$ for which a trigonometric inequality has real solutions. Find all $n\in{\mathbb{Z}}$ for which $2\sin{nx}=\tan{x}+\cot{x}$ has solutions in $\mathbb{R}$.
My attempt goes as follows:
From $AM\geq{GM}$,
$$|\tan{x}+\cot{x}|\geq{2\sqrt{\tan{x}\cot{x}}}=2$$
So, $$\tan{x}+\cot{x}\geq{2}\quad\lor\quad\tan{x}+\cot{x}\leq{-2}$$ Thus, $$2\sin{nx}\geq{2}\quad\lor\quad2\sin{nx}\leq{-2}$$The solutions are,
$$\sin{nx}={1}\quad\lor\quad\sin{nx}={-1}$$
From where,
$$nx=\frac{\pi}{2}+k\pi$$
So it seems that the only $n$ for which the inequality is not satisfied is $n=0$.
 A: After using AM-GM we have two cases:
$\sin{nx}=\tan{x}=\cot{x}=1$ or $\sin{nx}=\tan{x}=\cot{x}=-1$
A: HINT:
$$\tan x+\cot x=\dfrac2{\sin2x}$$
$$\implies\sin nx\sin2x=1$$
As $|\sin y|\le1$ for real $y,$
we need $\sin nx=\sin2x=\pm1$
Now if $\sin2x=1,2x=2m\pi+\dfrac\pi2$ where $m$ is any integer
$\sin nx=\sin n\left(m\pi+\dfrac\pi4\right)=(-1)^{mn}\sin\dfrac{n\pi}4$
As for odd $n,\left|\sin\dfrac{n\pi}4\right|\le\sin\dfrac\pi4<1$
$\implies n$ must be even $=2r$(say)
$\implies\sin nx=\sin\dfrac{r\pi}2$ which needs to be $=1$ 
$\implies\dfrac{r\pi}2=2s\pi+\dfrac\pi2\iff r=4s+1$ where $s$ is any integer
Similarly, for $\sin2x=-1$
A: Note that
$$\tan x+\cot x={\sin x\over\cos x}+{\cos x\over\sin x}={\sin^2x+\cos^2x\over\sin x\cos x}={1\over\sin x\cos x}={2\over2\sin x\cos x}={2\over\sin2x}$$
so any solutions to $2\sin nx=\tan x+\cot x$ must satisfy
$$\sin nx=\sin2x=\pm1$$
which is to say, we must have
$$nx=2\pi k+\sigma{\pi\over2}\qquad\text{and}\qquad2x=2\pi k'+\sigma{\pi\over2}$$
where $k$ and $k'$ are integers and $\sigma=\pm1$. But this implies
$$4\pi k+\sigma\pi=2nx=n\left(2\pi k'+\sigma{\pi\over2}\right)=2\pi nk'+\sigma{n\pi\over2}$$
which means that $n$ must be even, say $n=2m$.  This in turn implies
$$4\pi k+\sigma\pi=4\pi mk'+\sigma\pi m$$
or
$$m-1=4K\quad\text{where}\quad K=\sigma(k-mk')\in\mathbb{Z}$$
Thus $2\sin nx=\tan x+\cot x$ has solutions if and only if $n=8K+2$ for some integer $K$.
