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!