in such type of questions always try n find the multiple of tht angle whoz value is known
lyk in case of 40 its 120
so let a=40
u must be knoin tan3a= 3tana - tan3a/(1-3tan2a)
substitute tan3a as tan120 = -31/2
solve the cubic n u get tan40