Assume 0 < x/2 < π/2. Then
tan²(x/2) + 1 = sec²(x/2) ===> sec(x/2) = √(1 - tan²(x/2))
===> cos(x/2) = 1/√(1 - tan²(x/2))
===> cos(x/2) = 1/√(1 - t ²)
We also know that
sin²(x/2) + cos²(x/2) = 1 ===> sin(x/2) = √(1 - cos²(x/2))
Recall the double angle identities:
cos(x) = 2 cos²(x/2) - 1
sin(x) = 2 sin(x/2) cos(x/2)
Then
cos(x) = 2/(1 - t ²) - 1 = (1 + t ²)/(1 - t ²)
sin(x) = 2 √(1 - 1/(1 - t ²)) / √(1 - t ²) = 2t/(1 - t ²)