2. Let the complex number $z=5 \cos \theta+2 \mathrm{i} \sin \theta$. If the function
$$
f(\theta)=\theta-\arg z\left(0<\theta \leqslant \frac{\pi}{4}\right)
$$

has a maximum value of $\gamma$, then $\tan \gamma=$
2. $\frac{3}{7}$.

Let $t=\tan \theta(t \in(0,1])$. Then $\tan (\theta-\arg z)=\frac{t-\frac{2}{5} t}{1+t \cdot \frac{2}{5} t}=\frac{3}{\frac{5}{t}+2 t} \leqslant \frac{3}{7}$.
When $t=1$, the equality holds.