Given that$: \lim_{x\to\frac{\pi}{2}}\left ( sec(x)-\frac{1}{1-sin(x)} \right )$
$\Rightarrow \lim_{x\to\frac{\pi}{2}}\left ( \frac{1}{cos(x)}-\frac{1}{1-sin(x)} \right )$
Now put $x=\frac{\pi}{2}+t$
${x\to\frac{\pi}{2}}$
${\frac{\pi}{2}+t\to\frac{\pi}{2}}$
${t\to\frac{\pi}{2}-\frac{\pi}{2}}$
${t\to\ 0 }$
Now, $\lim_{t\to\ 0}\left ( \frac{1}{cos(\frac{\pi}{2}+t)}-\frac{1}{1-sin(\frac{\pi}{2}+t)} \right )$
$\Rightarrow \lim_{t\to\ 0}\left ( \frac{1}{-sin(t)}-\frac{1}{1-cos(t)} \right )$ $[ sin(\frac{\pi}{2}+\theta)=cos\theta,cos(\frac{\pi}{2}+\theta)=-sin\theta ]$
$\Rightarrow \lim_{t\to\ 0}\left ( \frac{1}{-sin(t)}-\frac{1}{1-cos(t)} \right )$
$\Rightarrow \lim_{t\to\ 0}\left ( \frac{1-cos(t)+sin(t)}{-sin(t)(1-cos(t))} \right )$
$\Rightarrow \lim_{t\to\ 0}\left ( \frac{1-cos(t)+sin(t)}{-sin(t)+sin(t).cos(t)} \right )$
Multiply in the numerator and denominator by $'2'$
$\Rightarrow \lim_{t\to\ 0}\left ( \frac{2-2cos(t)+2sin(t)}{-2sin(t)+2sin(t).cos(t)} \right )$
$\Rightarrow \lim_{t\to\ 0}\left ( \frac{2-2cos(t)+2sin(t)}{-2sin(t)+sin(2t)} \right )$ $[sin2\theta=2sin\theta.cos\theta ]$
Now, we can put the limit directly$:$
$\left ( \frac{2-2cos(0)+2sin(0)}{-2sin(0)+sin(2.0)} \right )$
$\left ( \frac{2-2(1)+2(0)}{-2(0)+(0)} \right )$
$\left ( \frac{2-2+0}{0+0} \right )$
$\left ( \frac{0}{0} \right ) form$
So we can apply L-Hospital Rules.
L’Hospital’s Rule:
Suppose that we have one of the following cases, $\lim_{x\to a}\frac{f(x)}{g(x)}=\frac{0}{0} (OR) \lim_{x\to a}\frac{f(x)}{g(x)}=\frac{\pm\infty}{\pm\infty}$
where $a$ can be any real number, infinity or negative infinity. In these cases we have,
$\lim_{x\to a}\frac{f(x)}{g(x)}=\lim_{x\to a}\frac{f'(x)}{g'(x)}$
$\lim_{t\to\ 0}\left ( \frac{0+2sin(t)+2cos(t)}{-2cos(t)+2cos(2t)} \right )$
$\Rightarrow \lim_{t\to\ 0}\left ( \frac{2sin(t)+2cos(t)}{-2cos(t)+2cos(2t)} \right )$
$\Rightarrow \lim_{t\to\ 0}\left ( \frac{2sin(t)+2cos(t)}{-2cos(t)+2cos(2t)} \right )$
$\Rightarrow \lim_{t\to\ 0}\left ( \frac{sin(t)+cos(t)}{cos(2t)-cos(t)} \right )$
Since the numerator is positive and the denominator $cos(2t)-cos(t)$ approaches zero and is less than zero for $'t'$ near $'0'$ on both sides, the function decreases without bound.
So,answer is $-\infty$