limit of $\frac{1-\sin x+\cos x }{x-\frac{\pi }{2}}$ how can i show that
$$\lim _{x\to \frac{\pi }{2}}\left(\frac{1-\sin \:x\:+\cos \:x\:}{x-\frac{\pi }{2}}\right)=-1$$
$$\left(\frac{1-\sin \:x\:+\cos \:x\:}{x-\frac{\pi }{2}}\right)=\left(\frac{1+\cos \:x -\sin x}{x-\frac{\pi }{2}}\right)$$
any help thanks
 A: Let $\frac\pi2-x=2y$  using $\sin2y=2\sin y\cos y,\cos2y=1-2\sin^2y$
$$\lim _{x\to \frac{\pi }{2}}\left(\frac{1-\sin \:x\:+\cos \:x\:}{x-\frac{\pi }{2}}\right)=-\lim_{y\to0}\dfrac{1-\cos2y+\sin2y}{2y}$$
$$=-\lim_{y\to0}\dfrac{\sin y}y\cdot\lim_{y\to0}(\sin y+\cos y)=?$$
A: Hint
Start changing $x=\frac \pi 2+y$ making
$$\lim _{x\to \frac{\pi }{2}}\left(\frac{1-\sin \:x\:+\cos \:x\:}{x-\frac{\pi }{2}}\right)=\lim _{y\to 0}\left(\frac{1-\sin (y)-\cos (y)}{y}\right)$$
A: $$\lim _{x\to \frac{\pi }{2}}\left(\frac{1-\sin \:x\:+\cos \:x\:}{x-\frac{\pi }{2}}\right)=\\
\lim _{x\to \frac{\pi }{2}}\left(\frac{1-\sin \:x\:}{x-\frac{\pi }{2}}\right)+\lim _{x\to \frac{\pi }{2}}\left(\frac{\cos \:x\:}{x-\frac{\pi }{2}}\right)=\\
\lim _{x\to \frac{\pi }{2}}\left(\frac{\sin(\frac{\pi}{2})-\sin x}{x-\frac{\pi }{2}}\right)+\lim _{x\to \frac{\pi }{2}}\left(\frac{\sin(\frac{\pi}{2}- x)}{x-\frac{\pi }{2}}\right)=\\
\lim _{x\to \frac{\pi }{2}}\left(\frac{2\sin(\frac{\frac{\pi}{2}-x}{2}).\cos(\frac{\frac{\pi}{2}+x}{2})}{-(\frac{\pi }{2}-x)}\right)+\lim _{x\to \frac{\pi }{2}}\left(\frac{\sin(\frac{\pi}{2}- x)}{-(\frac{\pi }{2}-x)}\right)=\\$$
so $$2(\frac{1}{-2})\lim _{x\to \frac{\pi }{2}}\cos(\frac{\frac{\pi}{2}+x}{2})+\underbrace{\lim _{x\to \frac{\pi }{2}}\left(\frac{\sin(\frac{\pi}{2}- x)}{-(\frac{\pi }{2}-x)}\right)}_{-1}=\\-1(0)+(-1)=-1$$
A: It is interesting to notice that even if you want to solve it with L'Hospital,in this case you can but it would suggest not to use the L'hospital method for limits of this form.
$\lim _{x\to \frac{\pi }{2}}\left(\frac{1-\sin \:x\:+\cos \:x\:}{x-\frac{\pi }{2}}\right)=\lim _{x\to \frac{\pi }{2}}-\frac{(\sin{x}-\cos{x})-1}{x -\frac{\pi}{2}}=-\lim _{x\to \frac{\pi }{2}}\frac{f(x)-f(\frac{\pi}{2})}{x-\frac{\pi}{2}}=-f'(\frac{\pi}{2})=-1$
where $f(x)=\sin{x}-\cos{x}$
