This is a polynomial of the third degree which can be solved as follows:

let tan(x) =y

3y^3-3y^2-y+1=0

dividing the equation by 3 (the coefficient of the highest power)

y^3-y^2-y/3+1/3

the last term (+1/3) is the product of the three roots of the equation. This means that the roots should contain the value 1.

dividing the equation by (y-1)

then the above equation will be

(y-1)(3y^2-1)=0

the second bracket can be solved by the known equation of solving quadratic equations

the root are 1,1/root(3),-1/root(3)