\(\frac{sinx}{1+cosx}+\frac{1+cosx}{sinx}=\frac{sin^2x+\left(1+cosx\right)^2}{sinx\left(1+cosx\right)}=\frac{sin^2x+cos^2x+2cosx+1}{sinx\left(1+cosx\right)}\)
\(=\frac{2+2cosx}{sinx\left(1+cosx\right)}=\frac{2\left(1+cosx\right)}{sinx\left(1+cosx\right)}=\frac{2}{sinx}\)
\(\frac{cosx}{1-sinx}=\frac{cos2.\frac{x}{2}}{1-sin2.\frac{x}{2}}=\frac{cos^2\frac{x}{2}-sin^2\frac{x}{2}}{sin^2\frac{x}{2}+cos^2\frac{x}{2}-2sin\frac{x}{2}.cos\frac{x}{2}}=\frac{\left(cos\frac{x}{2}-sin\frac{x}{2}\right)\left(cos\frac{x}{2}+sin\frac{x}{2}\right)}{\left(cos\frac{x}{2}-sin\frac{x}{2}\right)^2}\)
\(=\frac{sin\frac{x}{2}+cos\frac{x}{2}}{cos\frac{x}{2}-sin\frac{x}{2}}=\frac{\sqrt{2}cos\left(\frac{\pi}{4}-\frac{x}{2}\right)}{\sqrt{2}sin\left(\frac{\pi}{4}-\frac{x}{2}\right)}=cot\left(\frac{\pi}{4}-\frac{x}{2}\right)\)