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