What is
$\displaystyle\lim_{x\to\frac{\pi}{2}}\bigl(\sqrt{\cos^2x-2\sin x+2\sin^2x}\bigr)^{[\sin x]}$
(where $[\,{.}\,]$ denotes greatest integer function) equal to?
I substituted the values directly and that gave me $ 0^1$. This is not an indefinite value and thus the answer should be correct. But the correct answer is $1$. How is that possible?
Hint
If $x\in [0,\pi]$, $x\neq \frac{\pi}{2}$ $$\left(\sqrt{\cos^2(x)-2\sin(x)+2\sin^2(x)}\right)^{[\sin(x)]}=1.$$