What is wrong with this proof that L'Hospital works both ways? Our professor proved L'Hôpital's rule through Cauchy's mean value theorem. He proved it in multiple parts, I have trouble following the first, most basic example.
Theorem: Let $f, g$ be continuous functions on $(a,b)$ where $a < b$. Let:

*

*$g(x) \neq 0$ and $g'(x) \neq 0$, $\forall x \in (a,b)$

*$ \lim_{x \downarrow a} f(x) = \lim_{x \downarrow a} g(x) = 0  $
If limit $B = \lim_{x \downarrow a} \frac{f'(x)}{g'(x)}$ exists, then $A = \lim_{x \downarrow a} \frac{f(x)}{g(x)}$ also exists and $A = B$.
Proof:
We define $f(a)=0$ and $g(a)=0$. Then, by condition $(2)$, we see that $f, g$ are continuous on $[a,b)$. Let $x \in (a,b)$. Then on $[a,x]$ all necessary conditions for Cauchy's mean value theorem are fulfilled. Therefore, there exists a $c_x \in (a,x)$, such that:
$$\frac{f'(c_x)}{g'(c_x)} = \frac{f(x)-f(a)}{g(x)-g(a)} = \frac{f(x)}{g(x)}$$
When $x \downarrow a$, also $c_x \downarrow a$. Therefore: if $B= \lim_{x \downarrow a} \frac{f'(c_x)}{g'(c_x)}$ exists, $A= \lim_{x \downarrow a} \frac{f(x)}{g(x)}$ exists as well and $A=B$.
Question: Now, my main question is, why does this last conclusion work? Why couldn't we say the same thing in the other direction: if $A= \lim_{x \downarrow a} \frac{f(x)}{g(x)}$ exists, $B= \lim_{x \downarrow a} \frac{f'(c_x)}{g'(c_x)}$ exists as well and $A=B$. What would be wrong with that conclusion? Everyone says that L'Hopital only works one way, but I don't see why that is true from the proof.
 A: I read comments by Oliver Diaz and yourself, and got puzzled myself. I believe I see where to look for the explanation, though I didn't verify all details, so this answer should be considered a hint (or an extended comment), though I tend to believe it should work.
So look at:
$$\frac{f'(c_x)}{g'(c_x)} = \frac{f(x)-f(a)}{g(x)-g(a)} = \frac{f(x)}{g(x)}$$
what we could get from the above equality and the assumption that the limit $A= \lim_{x \downarrow a} \frac{f(x)}{g(x)}$ exists, we could only get that there is some suitable sequence $c(n) \downarrow a$, as $n\to\infty$, such that $\lim_{n\to\infty}\frac{f'(c(n))}{g'(c(n))}$ exists, and equals $A$.
The point is that we may have $c_x=c_y$ even if $x\not=y$.
If we define $C=\{c_x:x\in(a,b)\}$, then all we know about $C$ is that it is a subset of $(a,b)$ and $a$ is a limit point of $C$ (that is, $C$ contains at least one sequence that converges to $a$). But $C$ need not equal $(a,b)$, and in fact $(a,b)\setminus C$ might well contain some sequence $y_n\downarrow a$ such that either $\lim_{n\to\infty}\frac{f'(y_n)}{g'(y_n)}$ does not exist, or it exists but is different from $A=\lim_{x \downarrow a} \frac{f(x)}{g(x)}$. Either way, the result would be that $\lim_{x \downarrow a} \frac{f'(x)}{g'(x)}$ does not exists.
I think this is illustrated by the example given by Oliver Diaz in the comments, namely $$\lim_{x\rightarrow0}\frac{x^2\sin(x^{-1})}{\sin x}=0,$$ and the corresponding
$$\lim_{x\rightarrow0}\frac{\big(x^2\sin(x^{-1})\big)'}{(\sin x)'}= \lim_{x\rightarrow0}\frac{2x\sin(x^{-1}) -\cos(x^{-1})}{\cos x}.$$ The latter limit does not exists
by looking at $y_n=\frac{1}{2n\pi}$ and $x_n=\frac{1}{\frac{\pi}{2}+2\pi n}$ (as pointed out in the comment by
Oliver Diaz), but note that, nevertheless, at least we have that $\lim_{n\to\infty}\frac{f'(x_n)}{g'(x_n)}=0=A$, even though $\lim_{n\to\infty}\frac{f'(y_n)}{g'(y_n)}=1\not=0$, the result being that $\lim_{x \downarrow a} \frac{f'(x)}{g'(x)}$ does not exist.
A: I think there is actually a problem in the notation of the professor's proof as presented: the letter $B$ is used for two different things.
In the statement of the theorem, we have
$$ B = \lim_{x \downarrow a} \frac{f'(x)}{g'(x)},  \tag1$$
but in the proof we have
$$ B \stackrel?= \lim_{x \downarrow a} \frac{f'(c_x)}{g'(c_x)} \tag2$$
where $c_x \in (a,x)$ for every $x \in (a,b).$
To make things clear, let's only write $B$ when we mean the $B$ in Equation $(1)$ and let's not accept Equation $(2)$. Instead, let's use a different symbol to represent the second limit:
$$ C = \lim_{x \downarrow a} \frac{f'(c_x)}{g'(c_x)}. $$
So the way the proof actually works, is that if
$B = \lim_{x \downarrow a} \frac{f'(x)}{g'(x)}$ exists as in the theorem statement,
then $C = \lim_{x \downarrow a} \frac{f'(c_x)}{g'(c_x)}$ also exists and $C = B.$
This step, which is not stated explicitly in the proof, is not an obvious one
(in my opinion) if you have not seen it before.
If I were seeing this for the first time I would not accept it until I had seen it completely worked out or worked it out for myself using subsequences or $\delta$s and $\varepsilon$s or neighboorhoods or whatever was the proof method du jour for limits.
The next step, which is the one shown, also seems a little tricky to me if you have not seen it before.
We say that if $C = \lim_{x \downarrow a} \frac{f'(c_x)}{g'(c_x)}$ exists, then
$A = \lim_{x \downarrow a} \frac{f(x)}{g(x)}$ exists and $A = C.$
This relies on the idea that we always choose $c_x$ so that
$ \frac{f'(c_x)}{g'(c_x)} = \frac{f(x)}{g(x)}. $
The way this all comes together is that if $B$ exists then $C$ exists and $C = B,$ therefore $A$ exists and $A = C$, and therefore $A = B.$
And that's what L'Hôpital's Rule says.
An interesting thing about your question is that actually
your claim is correct when you say that if
$A = \lim_{x \downarrow a} \frac{f(x)}{g(x)}$ exists then
$C = \lim_{x \downarrow a} \frac{f'(c_x)}{g'(c_x)}$ exists and $A = C$
(again writing $C$ instead of $B$ in order to avoid confusion with the limit $B$ defined in the statement of the theorem).
The reason this fails to give us a "reverse L'Hôpital's Rule"
is that $C$ is not $B$, and the existence of the limit $C$ does not imply the existence of the limit $B.$
If you define limits by sequences, then the existence of the limit $C$ tells us only that there is some sequence of positive $y$ tending to zero such that
$\frac{f'(y)}{g'(y)}$ tends to the limit;
in particular we can choose a sequence $y_n = c_{x_n}$ based on a positive sequence $x_n$ that tends to zero.
But the fact that $\frac{f'(y)}{g'(y)}$ tends to the limit $C$ for some sequence of positive $y$ is not what we need to know; we need this for all sequences of positive $y.$
And the counterexample given in the other answer shows that we cannot guarantee this.
In summary, we can use the limit $A = \lim_{x \downarrow a} \frac{f(x)}{g(x)}$
to get the limit $C = \lim_{x \downarrow a} \frac{f'(c_x)}{g'(c_x)}$,
but we cannot use this to get the limit
$B = \lim_{x \downarrow a} \frac{f'(x)}{g'(x)},$
which is what we would need for a true "reverse L'Hôpital's Rule".
