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
 A: $$ \lim_{x\to\frac{\pi}{4}}\frac{\cos2x}{\cos x-\sin x}=
  \lim_{x\to\frac{\pi}{4}}\frac{\cos^2 x-\sin^2 x}{\cos x-\sin x}=$$
 $$ \lim_{x\rightarrow\frac{\pi}{4}}\frac{(\cos x- \sin x)(\cos x+\sin x)}{\cos x-\sin x}=$$
$$= \lim_{x\rightarrow\frac{\pi}{4}}{\cos x+\sin x}=\frac{1}{\sqrt{2}}+\frac{1}{\sqrt{2}}=\sqrt2$$
A: 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.
A: The third line is in error: you forgot to cancel the factor of $2 t^2 - 1$ and you switched the sign of $\sqrt{1-t^2}$.  If you correct, you'll see that
$$ \lim_{x \rightarrow \frac{\pi}{4}} \frac{\cos{2 x}}{\cos{x} - \sin{x}} = \lim_{t \rightarrow \frac{1}{\sqrt{2}}} \left [ t + \sqrt{1-t^2} \right ] = \sqrt{2} $$
A: A few observations about your "move" from your second to third line, where you obtain
$$\lim_{x\rightarrow\large\frac{\pi}{4}}\frac{(2t^{2}-1)(t+\sqrt{t^{2}-1})}{2t^{2}-1}$$


*

*you forgot to cancel the common factor of $(2 t^2 - 1)$;

*By writing $\;\sqrt{t^2-1}\;$ instead of $\;\sqrt{1-t^2}\;$ in the numerator, the sign needs to switch. 

*After substituting $\;t = \cos x\;$ in the limit, you need to change the point for which you are taking the limit. That is: $$x \to \frac{\pi}{4}\;\; \iff \;\;t \to \cos\left({\frac{\pi}{4}}\right) = \dfrac{1}{\sqrt{2}}.$$ 


Correcting for these errors, you'll find that
$$ \lim_{x \rightarrow \large\frac{\pi}{4}} \frac{\cos{2 x}}{\cos{x} - \sin{x}} = \lim_{t \rightarrow \large \frac{1}{\sqrt{2}}} \left (t + \sqrt{1-t^2} \right ) = \sqrt{2} $$

A: Plugging in $\frac{\pi}{4}$ for $x$, we see that it is of the form $0/0$, thus we can apply l'Hopital's rule. This gives us: 
\begin{align}
\lim_{x\to\frac{\pi}{4}}\frac{\cos(2x)}{\cos(x)-\sin(x)}&=\lim_{x\to\pi/4}\frac{-2\sin(2x)}{-\sin(x)-\cos(x)}\\&=\lim_{x\to\pi/4}\frac{2\sin(2x)}{\cos(x)+\sin(x)}\\&=\frac{2}{\sqrt{2}}\\&=\sqrt{2}.
\end{align}
