Find the smallest positive number $p$ for which the equation $\cos(p\sin x)=\sin(p \cos x)$ has a solution $x\in[0,2\pi].$ Find the smallest positive number $p$ for which the equation 
$\cos(p\sin{x})=\sin(p\cos{x})$ has a solution $x$ belonging $[0,2\pi]$.
I am not able to solve this problem.
Please help me.
 A: It must be that $p\sin{x}+p\cos{x}=\dfrac{\pi}{2}$ with, $p=\dfrac{\pi}{2(\sin{x}+\cos{x})}$.
So, to minimize $p$, $\sin{x}+\cos{x}$ must be maximized. 
$\sin{x}+\cos{x}=\sqrt{2} \sin\left(x+\dfrac{\pi}{4}\right)$, which is maximized when $\sin\left(x+\dfrac{\pi}{4}\right)=1$ at $x=\dfrac{\pi}{4}, \dfrac{7\pi}{4}$.
Hence, $p=\dfrac{\pi}{2\sin\left(\dfrac{\pi}{2}\right)}$.
$p=\dfrac{\pi}{2\sqrt2}$.
Hence, $x=\dfrac{\pi}{4}, \dfrac{7\pi}{4}$ in the interval $[0, 2\pi]$.
A: Given two angles $\alpha$ and $\beta$ one has $$\cos\alpha=\sin\beta=\cos(\beta-{\pi\over2})$$
iff either 
$$\alpha=\beta-{\pi\over2}+2k\pi\tag{1}$$
or 
$$\alpha=-(\beta-{\pi\over2})+2k\pi,\quad{\rm i.e.}\quad \alpha+\beta={\pi\over2}+2k\pi\ .\tag{2}$$
In our case $\alpha=p\sin x$ and $\beta=p\cos x$, so that $(1)$ is equivalent with
$$p(\cos x-\sin x)={\pi\over2}-2k\pi\ ,$$
so that we have to make sure that the equation
$$p{2\over\sqrt{2}}\sin({\pi\over4}-x)={\pi\over2}-2k\pi$$
has a real solution $x$. This is the case if $${2\over\sqrt{2}}p \geq|{\pi\over2}-2k\pi|$$
for a suitable $k$, and the smallest positive $p$ that satisfies this is $p={\pi\over 2\sqrt{2}}$. The resulting solution $x$ of the original equation is then $x={7\pi\over4}$.
The case $(2)$ is similar and has the same outcome for $p$ (so that this is the definitive solution of the problem); the corresponding $x$ is then ${\pi\over4}$.
A: I was just made aware of this question in chat, so I thought I'd post the work I did there in case it's useful.

The equation
$$
\cos(p\sin(x))=\sin(p\cos(x))\tag1
$$
is equivalent to
$$
\sin\left(\frac\pi2-p\sin(x)\right)=\sin(p\cos(x))\tag2
$$
which, since $\sin(x)=\sin(\pi-x)$, has two solutions:
$$
\frac\pi2-p\sin(x)=p\cos(x)\tag3
$$
and
$$
\frac\pi2+p\sin(x)=p\cos(x)\tag4
$$
$(3)$ is equivalent to
$$
\frac\pi{2p}=\sqrt2\cos\left(x-\frac\pi4\right)\tag5
$$
and $(4)$ is equivalent to
$$
\frac\pi{2p}=\sqrt2\cos\left(x+\frac\pi4\right)\tag6
$$
If $\left|\frac\pi{2p}\right|\gt\sqrt2$, there can be no solutions since $|\cos(x)|\le1$.
If $\left|\frac\pi{2p}\right|\le\sqrt2$, then the the solutions to $(1)$ are
$$
x\equiv\pm\cos^{-1}\left(\frac\pi{2\sqrt2\,p}\right)\pm\frac\pi4\pmod{2\pi}\tag7
$$


Thus, the smallest positive $p$ is $\frac\pi{2\sqrt2}$, for which, $(1)$ has the solutions $x\equiv\pm\frac\pi4\pmod{2\pi}$.
