and tan−1 is one-one on R, so the arguments must be equal:
sin2x2cosx=sinx2.
Since sinx=0 on (0,π), multiply through by sin2x and divide by 2:
cosx=sinx⟹tanx=1.
The only value in (0,π) with tanx=1 is
x=4π.
Verification. With x=4π, cosx=21 and cosecx=2. Then tan(2tan−121)=1−2122=22, and the right side is tan−1(22). Both sides equal 1.2310 radians, which lies in (−2π,2π), so the two principal values really coincide.
Outside the given interval the condition tanx=1 produces the whole family x=nπ+4π, and each of these does satisfy the original equation; restricting to (0,π) is what singles out 4π.