I think you've confused yourself here!
The first part of the question lets you write tan(3X) in terms of t where t=tan X.
If you take
X=π/12 then tan(3X) = 1, so if
t=tan(X)=tan(π/4) then t satisfies the cubic equation
t3−3t2−3t+1=0We can used this logic to find 2 other distinct roots of the cubic. We know that if
X=5π/12,3X=5π/4,tan(3X)=1and
X=9π/12,3X=9π/4,tan(3X)=1Therefore, the roots of the cubic are
a=tan(π/12),b=tan(5π/12),c=tan(9π/12)Now factorize the cubic as (t-a)(t-b)(t-c) and compare coefficients of t^2:
-(a+b+c) = -3
so
a+b+c=3or
tan(π/12)+tan(5π/12)+tan(9π/12)=3But
tan(9π/12)=tan(3π/4)=−1and the required result follows.