First, recognize that 3x=2x+x
Thus tan(3x)=tan(2x+x)
By the sum formula, tan(2x+x)=[tan(2x)+tan(x)]/[1-tan(2x)tan(x)]
By tangent double angle formula, tan(2x)=2tan(x)/(1-tan2(x))
Substituting that in we get [2tan(x)/(1-tan2(x))+tan(x)]/[1-2tan(x)/(1-tan2(x))tan(x))]
Multiplying top and bottom by the quantity 1-tan2(x) to get rid of denominators gives
[2tan(x)+tan(x)(1-tan2(x))]/[1-tan2(x)-2tan(x)(tan(x))]
Simplifying, we get [2tan(x)+tan(x)-tan3(x)]/[1-tan2(x)-2tan2(x)]
Combining like terms, we get [3tan(x)-tan2(x)]/[1-3tan3(x)]
This is all in terms of tan(x) so this should suffice