Find all the errors, if any, in the following L'Hospital's rule argument 
Let $f(x)=e^{-2x}(\cos x+2\sin x)$ and $g(x) = e^{-x}(\cos x+ \sin x).$ Find all the errors (if any) in the following L'Hôpital's rule argument:
$\lim\limits_{x\to \infty}\dfrac{f(x)}{g(x)}=\lim\limits_{x\to \infty}\dfrac{f'(x)}{g'(x)}=\lim\limits_{x\to \infty} \dfrac{5}{2}e^{-x}=0.$

Here's my work.
Recall the requirements for L'Hôpital's Rule:
To argue that $\lim\limits_{x\to c}\dfrac{f(x)}{g(x)}=\lim\limits_{x\to c}\dfrac{f'(x)}{g'(x)},$ the following must be true:
$1.$ $f(x)$ and $g(x)$ are differentiable on an open interval $I,$ but not necessarily at some point $c.$
$2.$ $\lim\limits_{x\to c}f(x)=\lim\limits_{x\to c}g(x)=0$ or $\pm \infty.$
$3.$ $g'(x)\neq 0\;\forall x\in I, x\neq c.$
$4.$ $\lim\limits_{x\to c}\dfrac{f'(x)}{g'(x)}$ exists.
We show that $f(x)$ and $g(x)$ are differentiable on $(-\infty, \infty).$ We have that $f'(x) = e^{-2x}(-2(\cos x+2\sin x) +(-\sin x+2\cos x))=-5e^{-2x}\sin x\;\forall x\in \mathbb{R}.$ Also, $g'(x)=e^{-x}(-(\cos x+\sin x)+(-\sin x+\cos x))= -2e^{-x}\sin x\;\forall x\in\mathbb{R}.$
Note that when $g(x)=0,\dfrac{f(x)}{g(x)}$ is undefined. This occurs when $\cos x + \sin x = 0\Rightarrow \tan x = -1\Rightarrow x = \dfrac{3\pi}{4}+2n\pi,n\in\mathbb{Z}.$ Let $x_0$ be such that $\tan x_0 = -1.$ We thus have that $f(x_0)=e^{-2x_0}(-\dfrac{\sqrt{2}}{2}+\sqrt{2})$ and $g(x_0)=0.$ Hence $\dfrac{f(x_0)}{g(x_0)}$ is indeterminate.  Also, consider when $x_1= \tan^{-1} \left(-\dfrac{1}{2}\right)+2n\pi.$ Then $\dfrac{f(x_1)}{g(x_1)}=\dfrac{e^{-2x_1}\left(\cos \left(\tan^{-1}\left(\dfrac{1}{2}\right)\right)-2\sin \left(\tan^{-1}\left(\dfrac{1}{2}\right)\right)\right)}{e^{-x_1}[\cos (\tan^{-1} (\frac{1}{2}))-\sin (\tan^{-1}(\frac{1}{2}))]}\\
=e^{-x_1}\dfrac{\frac{2}{\sqrt{5}}-\frac{2}{\sqrt{5}}}{\frac{2}{\sqrt{5}}-\frac{1}{\sqrt{5}}}=0.$
Hence $\dfrac{f(x)}{g(x)}$ is not indeterminate for all $x\in\mathbb{N}$ such that $x=\tan^{-1} (-\dfrac{1}{2})+2n\pi.$
Now consider $g'(x)=-2e^{-x}\sin x.$ $g'(x)=0$ whenever $\sin x=0$ as $e^{-x}\neq 0\;\forall x\in \mathbb{R}.$ Thus, $g'(x)=0\Leftrightarrow x=n\pi,n\in\mathbb{N}.$ So this is another error.
From above, we have that $\lim\limits_{x\to \infty}\dfrac{f'(x)}{g'(x)}$ does not exist since it is undefined whenever $x=n\pi,n\in\mathbb{N}$ and equal to $\lim\limits_{x\to \infty}\dfrac{-5e^{-2x}\sin x}{-2e^{-x}\sin x}=\lim\limits_{x\to \infty}\dfrac{5}{2}e^{-x}=0$ whenever $x\neq n\pi.$
 A: Hint What is $\frac{f(x)}{g(x)}$ when 
$$x= \frac{3\pi}{4}+2n \pi \,?$$
A: We have that
$$\frac{e^{-2x}(\cos x+2\sin x)}{e^{-x}(\cos x+ \sin x)}=e^{-x}\frac{\cos x+2\sin x}{\cos x+ \sin x}=e^{-x}+e^{-x}\frac{\sin x}{\sqrt 2 \sin\left(x+\frac \pi 4\right)}$$
and for $x=n\frac \pi 2-\frac \pi4$
$$e^{-x}\frac{\sin x}{\sqrt 2 \sin\left(x+\frac \pi 4\right)} \to 0$$
but for $x=2\pi n+e^{-2\pi n}-\frac \pi4$
$$e^{\left(-2\pi n-e^{-2\pi n}+\frac \pi4\right)}\frac{\sin \left(e^{-2 \pi n}-\frac \pi4\right)}{\sqrt 2 \sin\left(e^{-2 \pi n}\right)}=$$
$$= e^{-e^{-2 \pi n}}\cdot e^{\frac \pi 4} \cdot  \frac{\sin \left(e^{-n}-\frac \pi4\right)}{\sqrt 2}\frac{e^{-2 \pi n}}{\sin\left(e^{-2 \pi n}\right)} \to 1 \cdot e^{\frac \pi 4}\cdot \left(-\frac 12\right)\cdot 1=-\frac{e^{\frac \pi 4}}{2}$$
therefore the limit doesn't exist.
With reference to your question, according to the observation by Paramanand Singh, the only relevant issue here is that we can't apply l'Hospital at the first step since $f/g$ is not defined on an interval.
Ineed, note that according to the more general definition of limit
$$\lim\limits_{x\to \infty}\dfrac{f'(x)}{g'(x)}=\lim\limits_{x\to \infty}\dfrac{-5e^{-2x}\sin x}{-2e^{-x}\sin x}=\lim\limits_{x\to \infty}\dfrac{5}{2}e^{-x}=0$$
since we can take the limit excluding from the domain the points such that $\sin x =0$.
Refer to the related


*

*A proviso in l'Hospital's rule

*What is $\lim_{x \to 0}\frac{\sin(\frac 1x)}{\sin (\frac 1 x)}$ ? Does it exist?
