How to calculate Limit of $(1-\sin x)^{(\tan \frac{x}{2} -1)}$ when $x\to \frac{\pi}{2}$. 
How to calculate Limit of $(1-\sin x)^{(\tan \frac{x}{2} -1)}$ when $x\to \frac{\pi}{2}$.

We can write our limit as $\lim_{x\to \frac{\pi}{2}}e^{(\tan \frac{x}{2} -1) \log(1-\sin x)}~ $  but I can not use L'Hopital rule.
Is there another way?

Making the substitution $
x = \dfrac{\pi}{2} + y$ the required limit is
$\lim_{y \to 0} \exp h(y)$ where $h(y)= \ln(1-\cos y) \left( \tan(\pi/4 + y/2) - 1 \right) = \ln(1-\cos y) \times \dfrac{2\tan(y/2)}{1-\tan(y/2)}$. 
Since $1-\cos y = 2 \sin^2(y/2)$ we have $$h(y) = (\sqrt{2}\sin(y/2)) \ln(2\sin^2(y/2))  \times \dfrac{2}{\sqrt{2}} \times \dfrac{\dfrac{\tan (y/2)}{y/2}}{\dfrac{\sin(y/2)}{y/2}} \times \dfrac{1}{1-\tan(y/2)}  $$.
Since $\lim_{x\to0}x\ln(x^2) = 2\lim_{x \to 0} x \ln |x| = 0$ and so we have $\lim_{y\to 0}(\sqrt{2}\sin(y/2)) \ln(2\sin^2(y/2)) = 0$ and $\lim_{y\to 0}h(y) = 0 \times \dfrac{2}{\sqrt{2}} \times \dfrac{1}{1} \times 1 = 0.$
So the required limit is 1.
