tanx/tan2x = (sinx/cosx)/(sin2x/cos2x)
= (sinxcos2x)/(sin2xcosx)
= (sinx(1-2sin^2(x))/(2sinxcos^2(x))
= (1-2sin^2(x))/(2cos^2(x))
= (1-2sin^2(x))/(2(1-sin^2(x))
= (2(1-sin^2(x))-1)/(2(1-sin^2(x))
= 1 - 1/(2(1-sin^2(x))
= 1 - 1/2cos^2(x)
= 1 - 1/2(sec^2(x))
integrating that just gives x - 1/2(tanx) + C