As #tan(180^o-A)=-tanA#, #tan165^o=tan(180^o-15^o)=-tan15^o#
For #tan15^o#, let us use half angle identity #tanA=(2tan(A/2))/(1-tan^2(A/2))#.
Using this if #A=30^o# and #tan30^o=1/sqrt3#, we have
#(2tanA)/(1-tan^2A)=1/sqrt3#, where #A=15^o#
or #1-tan^2A=2sqrt3tanA#
or #tan^2A+2sqrt3tanA-1=0#
and using quadratic formula
#tanA=(-2sqrt3+-sqrt((2sqrt3)^2-4×1×(-1)))/2#
or #tanA=(-2sqrt3+-sqrt(12+4))/2#
= #(-2sqrt3+-4)/2#
= #2-sqrt3# or #-2-sqrt3#
But #tan15^o# cannot be negative. Hence, #tan15^o=2-sqrt3# and
#tan165^o=-2+sqrt3#