13. If $\tan x=3 \tan y\left(0 \leqslant y \leqslant x<\frac{\pi}{2}\right)$, find the maximum value of the function $u=x-y$.
13. $\tan u=\tan (x-y)=\frac{\tan x-\tan y}{1+\tan x \tan y}=\frac{2 \tan y}{1+3 \tan ^{2} y}$. Also, $0 < y < \frac{\pi}{2}$, so $1+3 \tan ^{2} y \geqslant 2 \sqrt{3} \tan y$. Therefore, $\tan u \leqslant \frac{\sqrt{3}}{3}=\tan \frac{\pi}{6}$, then the maximum value of $u$ is $\frac{\pi}{6}$.