If $f$ is differentiable at $x_0$ and $x_n \to x_0$, $h_n \to 0$ when $\lim \frac{f(x_n+h_n) - f(x_n)}{h_n} = f'(x_0)$? Suppose that $f$ is differentiable at $x_0$, in general this is not sufficient to prove that
$$
\lim \frac{f(x_n+h_n) - f(x_n)}{h_n} = f'(x_0)
$$
for every pair of sequences $x_n \to x_0$ and $h_n \to 0$. However, it seems that and additional condition on the rate of convergence of $x_n$ should suffice since the result obviously holds in the extreme case where we consider the constant sequence $x_n = x_0, \ \forall \ n$.
My question is, is it possible to find the slowest rate of convergence for $x_n-x_0$ such that we still have $\lim \frac{f(x_n+h_n) - f(x_n)}{h_n} = f'(x_0)$? That would deppend on the rate of $h_n$ as well?
 A: A sufficient condition for the statement to be true is that the sequence of ratios $\frac{x_n-x_0}{h_n}$ is bounded (for this of course have to assume each $h_n \neq 0$). Loosely speaking, the convergence $x_n \to x_0$ should be atleast "as fast/slow" as $h_n \to 0$.
To prove this, let $M>0$ be such that for all $n \in \Bbb{N}$, $|x_n - x_0| \leq M|h_n|$. Now, by definition of $f$ being differentiable at $x_0$, we have
\begin{align}
f(x_0 + h) &= f(x_0) + f'(x_0)\cdot h + r(h),
\end{align}
where $\lim_{h\to 0}\frac{r(h)}{h} = 0$. Let $\epsilon>0$. Then, there is a $\delta>0$ such that for all $h$, if $|h|\leq \delta$ then $|r(h)|\leq \epsilon$.
Since $x_n \to x_0$, there is an $N_1\in \Bbb{N}$ such that for all $n\geq N_1$, we have $|x_n-x_0|\leq \frac{\delta}{2}$. Also, since $h_n \to 0$, there is an $N_2\in\Bbb{N}$ such that for all $n\geq N_2$, we have $|h_n|\leq \frac{\delta}{2}$.
So, if $n \geq \max(N_1, N_2)$, we have
\begin{align}
\left|\frac{f(x_n+h_n) - f(x_n)}{h_n} - f'(x_0)\right| &=
\left| \frac{r(x_n + h_n - x_0) - r(x_n - x_0)}{h_n} \right| \\
&\leq \frac{|r(x_n + h_n - x_0)| + |r(x_n - x_0)|}{|h_n|} \\
& \leq \frac{\epsilon |x_n + h_n - x_0| + \epsilon |x_n - x_0|}{|h_n|} \\
& \leq \epsilon \frac{2|x_n - x_0| + |h_n|}{|h_n|} \\
& \leq \epsilon (2M+1).
\end{align}
Since $\epsilon>0$ was arbitrary, this completes the proof that $\lim_{n\to \infty}\frac{f(x_n+h_n) - f(x_n)}{h_n} = f'(x_0)$.
A: around $x_0$
$f(x)=f(x_0)+f'(x_0)(x-x_0)=r(x-x_0)$
where $r(0):=0$ and  $\lim_{x\rightarrow x_0}\frac{|r(x-x_0)|}{|x-x_0|}=0$
Then
$$\frac{f(x_n+h_n)-f(x_n)}{h_n}=f'(x_0)+\frac{r(x_n+h_n-x_0)}{h_n}+\frac{r(x_n-x_0)}{h_n}$$
$$\Big|\frac{r(x_n+h_n-x_0)}{h_n}\Big|\leq\frac{|h_n|+|x_n-x_0|}{|h_n|}\Big|\frac{r(x_n+h_n-x_0)}{x_n+h_n-x_0}\Big|\xrightarrow{n\rightarrow\infty}0
$$
if $|x_n-x_0|=O(h_n)$. For the last term
$$\Big|\frac{r(x_n-x_0)}{h_n}\Big|\leq\frac{|x_n-x_0|}{|h_n|}\Big|\frac{r(x_n-x_0)}{x_n-x_0}\Big|\xrightarrow{n\rightarrow\infty}0
$$
if $|x_n-x_0|=O(h_n)$. Thus, if $|x_n-x_0|=O(h_n)$, we get
$$
\lim_{n\rightarrow\infty}\frac{f(x_n+h_n)-f(x_n)}{h_n}=f'(x_0)
$$
If in addition, $f$ is continuously differentiable in some interval containing $x_0$, then no restrictions on $h_n$ (other than  to have points within the domian) are needed.
A: $x_n - x_0 = \text{o}(h_n)$ is sufficient.
Just add and subtract $f(x_0)$ from numerator and split into two parts.
On the other hand if, say $x_n = x_0 + h_n$ then the limit is not equal to the derivative.
