For real $x$ and $n \in \mathbb{Z}_{+}$, we have
$$\cos(nx)(1 + i \tan(nx)) = e^{inx} = (e^{ix})^n = (\cos(x)(1 + i\tan(x))^n$$
Compare real and imaginary parts on both side, we have
$$
\tan(nx)
= \frac{\Im\rm(LHS)}{\Re\rm(LHS)}
=\frac{\Im\rm(RHS)}{\Re\rm(RHS)}
= \frac{\Im\left((1+i\tan x)^n\right)}{\Re\left((1+i\tan x)^n\right)}
$$
This leads to
$$\begin{align}\tan(nx) &= \frac{
\sum\limits_{k=0}^{\left\lfloor\frac{n-1}{2}\right\rfloor} (-1)^k \binom{n}{2k+1}\tan(x)^{2k+1}
}{
\sum\limits_{k=0}^{\left\lfloor\frac{n}{2}\right\rfloor} (-1)^k\binom{n}{2k} \tan(x)^{2k}
}
= \frac{n \tan(x) + O(\tan(x)^3)}{1 + O(\tan(x)^2)}\\
&= 0 + n\tan(x) + O(\tan(x)^3)
\end{align}
$$
So the constant term is $0$ and the coefficient in front of $\tan(x)$ is $n$.