\(\frac{1-cos2x}{2\left(1+cosx\right)}-\frac{2cos^2x-1}{sinx\left(1-cotx\right)}=\frac{1-\left(2cos^2x-1\right)}{2\left(1+cosx\right)}-\frac{cos^2x-sin^2x}{sinx-cosx}\)
\(=\frac{1-cos^2x}{1+cosx}+\frac{\left(sinx-cosx\right)\left(sinx+cosx\right)}{sinx-cosx}=\frac{\left(1-cosx\right)\left(1+cosx\right)}{1+cosx}+sinx+cosx\)
\(=1-cosx+sinx+cosx=1+sinx\)