I was revising teacher's notes about L'H rule and I came across this limit.
$$\lim_{x \to \frac{\pi}{2}} \frac{x-\frac{\pi}{2}}{\sqrt{1-\sin x}}$$
The teacher tried to evaluate without L'H to demonstrate L'H is necessary here but I can't explain the first passage he did:
$$\lim_{x \to \frac{\pi}{2}} \frac{x-\frac{\pi}{2}}{\sqrt{1-\sin x}} = \lim_{x \to \frac{\pi}{2}} \frac{1}{\frac{-\cos x}{2\sqrt{1-\sin x}}}$$
Can you please help me?
Hint
$\dfrac\pi2-x=2y$
$$\lim_{y\to0}\dfrac{-2y}{\sqrt{1-\cos2y}}=-\sqrt2\lim_{...}\dfrac y{|\sin y|}$$
So, the limit doesn't exist