In calculus, the L’Hôpital’s rule states that the limit of a quotient of functions is equal to the limit of its derivatives, under certain conditions.

#### A statement and a proof of the L’Hôpital’s rule for 0/0 form

**Result** (L’Hôpital’s rule). Let \(f\) and \(g\) be real-valued differentiable functions over an open interval \(I\) except possibly at \(a \in I\) with $$\lim_{x \to a} f(x) = 0 \text{ and } \lim_{x \to a} g(x) = 0.$$ Also, let \(g'(x) \neq 0\) for all \(x \in I \setminus \{a\}\) such that $$\lim_{x \to a} \frac{f'(x)}{g'(x)}$$ exists. Then, $$\lim_{x \to a} \frac{f(x)}{g(x)}$$ exists also, and $$\lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \frac{f'(x)}{g'(x)}.$$

The proof is as follows:

Without loss of generality, we may assume that $$f(a) = g(a) = 0.$$ Now, let \(h\) be a positive real number. By the generalized mean value theorem, there is a real number \(c_h\) in the interval \((a, a+h)\) such that $$(f(a+h) – f(a)) g'(c_h) = (g(a+h) – g(a)) f'(c_h).$$

Since \(f(a)\) and \(g(a)\) are zero, we obtain that $$\frac{f'(c_h)}{g'(c_h)} = \frac{f(a+h)}{g(a+h)}.$$ Let \(h\) approach to zero from the right side. Since \(\lim_{x \to a} \frac{f'(x)}{g'(x)}\) exists, \(\frac{f'(c_h)}{g'(c_h)}\) approaches to \(\lim_{x \to a} \frac{f'(x)}{g'(x)}\) because \(a < c_h < a+h\). This implies that $$\lim_{x \to a^{+}} \frac{f(x)}{g(x)}$$ exists and is equal to \(\lim_{x \to a} \frac{f'(x)}{g'(x)}\).

A similar argument works for \(a+h < x < a\), where \(h\) is a negative real number and approaches to zero from the left side. Hence, the result, as required.

#### A statement of the L’Hôpital’s rule for \(\infty / \infty\) form

We state another form of the L’Hôpital’s rule but we do not prove it here since its proof is too long.

**Result** (L’Hôpital’s rule). Let \(f\) and \(g\) be real-valued differentiable functions over an open interval except possibly at a point \(a \in I\). Also, let \(\lim_{x \to a} g(x) = \infty\) with \(g'(x) \neq 0\), for each \(x \in I \setminus \{a\}\). If $$\lim_{x \to a} \frac{f'(x)}{g'(x)}$$ exists, then $$\lim_{x \to a} \frac{f(x)}{g(x)}$$ exists also, and $$\lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \frac{f'(x)}{g'(x)}.$$

A similar statement holds if \(x \to \pm \infty\).

#### Some examples and applications of the L’Hôpital’s rule

**Exercise**. Apply the L’Hôpital’s rule to compute the following limit: $$\lim_{x \to 0} \frac{m \sin x – \sin (mx)}{x – \sin x}.$$

**Solution**. $$\lim_{x \to 0} \frac{m \sin x – \sin (mx)}{x – \sin x} = $$ $$\lim_{x \to 0} \frac{m \cos x – m \cos(mx)}{1 – \cos x} = $$ $$\lim_{x \to 0} \frac{-m \sin x + m^2 \sin(mx)}{\sin x} = $$ $$\lim_{x \to 0} \frac{-m \cos x + m^3 \cos(mx)}{\cos x} = $$ $$m^3 – m.$$

**Exercise**. Let \(f(x)\) be continuous at \(a\) and \(f'(x)\) exist for all \(x\) in some open interval containing \(a\), except possibly for \(x = a\). Prove that if \(\lim_{x\to a} f'(x)\) exists. Then, \(f'(a)\) also exists and

$$f'(a) = \lim_{x\to a}f'(x).$$

**Solution**. Consider the functions \(h(x) = f(x)-f(a)\) and \(g(x) = x-a\). Since \(f\) is continuous at \(a\), we have $$\lim_{x\to a} h(x) = 0.$$ On the other hand, it is clear that $$\lim_{x\to a} g(x) = 0.$$ Now, applying the L’Hopital’s rule, we have $$f'(a) = \lim_{x\to a} \frac{f(x)-f(a)}{x-a} = $$ $$\lim_{x\to a} \frac{h(x)}{g(x)} = \lim_{x\to a} f'(x).$$

**Exercise**. Let \(f\) and \(g\) be real-valued differentiable functions over an open interval \((-\infty, b)\) with $$\lim_{x \to -\infty} f(x) = 0 \text{ and } \lim_{x \to -\infty} g(x) = 0.$$ Also, let \(g'(x) \neq 0\) for all \(x \in (-\infty, b)\) such that $$\lim_{x \to -\infty} \frac{f'(x)}{g'(x)}$$ exists. Then, $$\lim_{x \to -\infty} \frac{f(x)}{g(x)}$$ exists also, and $$\lim_{x \to -\infty} \frac{f(x)}{g(x)} = \lim_{x \to -\infty} \frac{f'(x)}{g'(x)}.$$ The same result hold if we replace \(-\infty\) by \(+\infty\) and replace \((-\infty, b)\) by \((b, +\infty)\).

**Hint**. Set \(y = -1/x\).

**Exercise**. Let \(f\) be twice-differentiable on an open interval containing a point \(a \in I\) such that \(f^{\prime\prime}\) is also continuous over \(I\). Compute the value of the following limit: $$\lim_{h \to 0} \frac{f(a+h) + f(a-h) – 2f(a)}{h^2}.$$