Does anybody has any idea how does 2(tan( θ)-θ)+C become 2[((√x^2-4)/2)-sec^-1*(x/2)]+C

no idea, but the derivative of arcsec(x/2) is

2/(x√(x^2-4))

If secθ = x/2 then
tanθ = √(x^2-4)/2

and the derivative of

2(tanθ-θ) = 2(tan(arcsec(x/2))-arcsec(x/2)) is
2[x/(2√(x^2-4)) - 2/(x√(x^2-4))]

See whether that helps at all.