Step 1
(2sin(x)cot(x)+sin(x)-4cot(x)-2)/(2cot(x)+1)=
Factor 2sin(x)cot(x)+sin(x)-4cot(x)-2: (-2+sin(x))(2cot(x)+1)
=((-2+sin(x))(2cot(x)+1))/(2cot(x)+1)=2+sin(x)
Hence, given equation is true.
Step 2
Factors of 2sin(x)cot(x)+sin(x)-4cot(x)-2 is
=2cot(x)sin(x)-2*2cot(x)-2
=2cot(x)(sin(x)-2)+sin(x)-2
=2(-2+sin(x))cot(x)+1*(-2+sin(x))
=(-2+sin(x))(2cot(x)+1)
(2sin(x)cot(x)+sin(x)-4cot(x)-2)/(2cot(x)+1)=-2+sin(x)