calculate $\lim_{x\rightarrow\frac{\pi}{4}}\frac{\cos2x}{\cos x-\sin x}$ $$\lim_{x\rightarrow\frac{\pi}{4}}\frac{\cos(2x)}{\cos(x)-\sin(x)}=\lim_{x\rightarrow\frac{\pi}{4}}\frac{2\cos^{2}(x)-1}{\cos(x)-\sqrt{1-\cos^{2}(x)}}$$
$$t=\cos(x)$$
$$\lim_{x\rightarrow\frac{\pi}{4}}\frac{2t^{2}-1}{t-\sqrt{1-t^{2}}}=\lim_{x\rightarrow\frac{\pi}{4}}\frac{(2t^{2}-1)(t+\sqrt{t^{2}-1})}{2t^{2}-1}$$
$$\lim_{x\rightarrow\frac{\pi}{4}}(2t^{2}-1)(t-\sqrt{t^{2}-1})=3(\sqrt{2}-1)$$
Please help me to find an error. Correct answer is $\sqrt{2}$. Thanks

writing $\cos 2x = \cos^2 x - \sin^2x $ and expanding $a^2-b^2$ and cancelling $\cos x - \sin x$ you get $\cos x + \sin x$. Putting value $x \to \frac{\pi}{4}$ we get $ \frac{1}{\sqrt 2} + \frac{1}{\sqrt 2} = \sqrt 2$.
EDIT::
Looks like you've been writing $\sqrt{t^2-1}$ for $\sqrt{1 -t^2}$ and also there is substitution so you must be putting $ t \to \frac{1}{\sqrt 2}$
$\underset{x\rightarrow\frac{\Pi}{4}}{\lim}\frac{2t^{2}-1}{t-\sqrt{1-t^{2}}}=\underset{x\rightarrow\frac{\Pi}{4}}{\lim}\frac{(2t^{2}-1)(t+\sqrt{t^{2}-1})}{2t^{2}-1}$
After this you should get
$\lim_{t \to \frac{1}{\sqrt 2}} t + \sqrt{1-t^2}$
this is essentially same as multiplying by $\cos x + \sin x $ and cancelling the $\cos 2x$ up there, so substitution quite unnecessary though.
