$\int x \tan x \,dx=\frac{1}{2} i \text{Li}_2\left(-e^{2 i x}\right)+\frac{i x^2}{2}-x \log\left(1+e^{2 i x}\right)+C $
Where Li$\text{Li}_2$ is the polylogarithm function
You can express the result in closed form also through polygamma function, Hurwitz zeta function or generalizer (to real orders) Bernoulli polynomials.dilogarithm function