Find limit "1 ^ infinity" $\displaystyle \lim_\limits{x \to \frac{\pi}{4}} 
  \left[\frac{1 + \sin(\pi/4 - x)\sin(2x)}{1 + 0.5\cos(2x)}\right]^{\cot^3(x - \frac{\pi}{4})}$
I've tried to use $\exp$, but found very difficult to simplify the expression.
 A: $$\displaystyle \lim_\limits{x \to \frac{\pi}{4}} 
  \left(\frac{1 + \sin\left(\frac{\pi}{4} - x\right)\sin(2x)}{1 + \frac{1}{2}\cos(2x)}\right)^{\cot^3(x - \frac{\pi}{4})}=$$
$$\displaystyle \lim_\limits{x \to \frac{\pi}{4}} 
  \left(\frac{2+\sqrt{2}(\cos(x)-\sin(x))\sin(2x)}{2+\cos(2x)}\right)^{-\tan^3\left(\frac{\pi}{4}+x\right)}=$$
$$\lim_{x \to \frac{\pi}{4}} 
  \exp\left(\ln\left(\left(\frac{2+\sqrt{2}(\cos(x)-\sin(x))\sin(2x)}{2+\cos(2x)}\right)^{-\tan^3\left(\frac{\pi}{4}+x\right)}\right)\right)=$$
$$\lim_{x \to \frac{\pi}{4}} 
  \exp\left(-\ln\left(\frac{2+\sqrt{2}(\cos(x)-\sin(x))\sin(2x)}{2+\cos(2x)}\right)\tan^3\left(\frac{\pi}{4}+x\right)\right)=$$
$$\exp\left(\lim_{x \to \frac{\pi}{4}} 
  -\ln\left(\frac{2+\sqrt{2}(\cos(x)-\sin(x))\sin(2x)}{2+\cos(2x)}\right)\tan^3\left(\frac{\pi}{4}+x\right)\right)=$$
$$\exp\left(
  -\left(\lim_{x \to \frac{\pi}{4}}\ln\left(\frac{2+\sqrt{2}(\cos(x)-\sin(x))\sin(2x)}{2+\cos(2x)}\right)\tan^3\left(\frac{\pi}{4}+x\right)\right)\right)=$$
$$\exp\left(
  -\left(\lim_{x \to \frac{\pi}{4}}\sin^3\left(x+\frac{\pi}{4}\right)\csc^3\left(\frac{\pi}{4}-x\right)\ln\left(\frac{\sqrt{2}\sin(2x)(\cos(x)-\sin(x))+2}{2+\cos(2x)}\right)\right)\right)=$$
$$\exp\left(
  -\left(\lim_{x \to \frac{\pi}{4}}\csc^3\left(\frac{\pi}{4}-x\right)\ln\left(\frac{\sqrt{2}\sin(2x)(\cos(x)-\sin(x))+2}{2+\cos(2x)}\right)\right)\right)=$$
$$\exp\left(-\left(-\frac{3}{2}\right)\right)=e^{--\frac{3}{2}}=e^{\frac{3}{2}}$$
