Need help in proving that $\frac{\sin\theta - \cos\theta + 1}{\sin\theta + \cos\theta - 1} = \frac 1{\sec\theta - \tan\theta}$ We need to prove that $$\dfrac{\sin\theta - \cos\theta + 1}{\sin\theta + \cos\theta - 1} = \frac 1{\sec\theta - \tan\theta}$$
I have tried and it gets confusing.

$$\frac{\sin\theta-\cos\theta+1}{\sin\theta+\cos\theta-1}$$
$$=\frac{\tan\theta-1+\sec\theta}{\tan\theta+1-\sec\theta}(\text{ dividing the numerator & the denominator by} \cos\theta )$$
$$=\frac{\tan\theta-1+\sec\theta}{\tan\theta-\sec\theta+(\sec^2\theta-\tan^2\theta)} (\text{ putting } 1=\sec^2\theta-\tan^2\theta) $$
$$=\frac{\tan\theta+\sec\theta-1}{\tan\theta-\sec\theta-(\tan\theta-\sec\theta)(\tan\theta+\sec\theta)}$$
$$=\frac{\tan\theta+\sec\theta-1}{-(\tan\theta-\sec\theta)(\tan\theta+\sec\theta-1)}$$
$$=\frac1{\sec\theta-\tan\theta}$$

Alternatively using Double-angle formula by putting $\tan\frac\theta2=t,$
$$\text{ LHS= }\frac{\sin\theta-\cos\theta+1}{\sin\theta+\cos\theta-1}=\frac{\frac{2t}{1+t^2}-\frac{1-t^2}{1+t^2}+1}{\frac{2t}{1+t^2}+\frac{1-t^2}{1+t^2}-1}$$
$$=\frac{2t-(1-t^2)+1+t^2}{2t+(1-t^2)-(1+t^2)} =\frac{2t+2t^2}{2t-2t^2}=\frac{1+t}{1-t}\text{assuming }t\ne0$$
$$\text{ RHS= }\frac1{\sec\theta-\tan\theta}=\frac1{\frac{1+t^2}{1-t^2}-\frac{2t}{1-t^2}}=\frac{1-t^2}{(1-t)^2}=\frac{1+t}{1-t} \text{assuming }t-1\ne0$$
