TITLE: I wrote a proof of L'Hospital's rule, am I right?
QUESTION [6 upvotes]: Suppose $f$ and $g$ are differentiable and $g'(x)\neq 0$ on an open interval $I$ that contains $a$.
Suppose that 
$$\lim_{x\to a}f(x)=L=\lim_{x\to a}g(x)\quad L=0\,or\,\infty\,or-\infty$$,
then
$$\lim_{x\to a}\frac{f(x)}{g(x)}=\lim_{x\to a}\frac{f'(x)}{g'(x)}$$
I proved the case when $L=0$,and I wrote a proof about the case when $L=\infty$ ,I found it is different from the proof on the internet, so I don't know whether it is right.
My proof:
$$\lim_{x\to a}f(x)=\infty=\lim_{x\to a}g(x)$$
$$\lim_{x\to a}\frac{1}{f(x)}=0=\lim_{x\to a}\frac{1}{g(x)}$$
$$\lim_{x\to a}\frac{\frac{1}{g(x)}}{\frac{1}{f(x)}}=\lim_{x\to a}\frac{[\frac{1}{g(x)}]'}{[\frac{1}{f(x)}]'}$$.
$$\lim_{x\to a}\frac{f(x)}{g(x)}=\lim_{x\to a}\frac{g'(x)[f(x)]^2}{f'(x)[(g(x)]^2}$$
$$\lim_{x\to a}\frac{f(x)}{g(x)}[1-\frac{f(x)g'(x)}{g(x)f'(x)}]=0$$.
I think L'Hospital assumes that $\lim_{x\to a}\frac{f(x)}{g(x)}$ exist, or is $\infty$, or $-\infty$, and so 
$$\lim_{x\to a}\frac{f(x)g'(x)}{g(x)f'(x)}=1$$
$$\lim_{x\to a}\frac{f(x)}{g(x)}=\lim_{x\to a}\frac{f'(x)}{g'(x)}$$.
If it is wrong, please tell me why. Thank you very much!

REPLY [3 votes]: This step here
$$\lim_{x\to a}\frac{f(x)}{g(x)}=\lim_{x\to a}\frac{g'(x)[f(x)]^2}{f'(x)[(g(x)]^2}$$
$$\lim_{x\to a}\frac{f(x)}{g(x)}[1-\frac{f(x)g'(x)}{g(x)f'(x)}]=0$$
doesn't work because the limit in the first line could be $\infty$. If $\lim_{x\rightarrow a} p(x) = \infty$ and $\lim_{x\rightarrow a} q(x) = \infty$, then you can make no conclusions about $\lim_{x\rightarrow\infty} p(x) - q(x)$. Similarly, this step
$$\lim_{x\to a}\frac{f(x)g'(x)}{g(x)f'(x)}=1$$
$$\lim_{x\to a}\frac{f(x)}{g(x)}=\lim_{x\to a}\frac{f'(x)}{g'(x)}$$
doesn't work because $\lim_{x\rightarrow a} f(x)/g(x)$ could be $0$.
You might be able to patch up the proof by considering the $0$ and $\infty$ limits as special cases, as it does seem to work if it is known that the limit is finite and nonzero.