Limit of function equivalent to limit of a sequence? When I try to compute $\lim_{n\rightarrow\infty}\frac{(\ln n)^2}{n}$ in my mathematical analysis homework, I may be supposed to use Stolz theorem to compute this limit of a sequence. However, I find it much more easier to compute this limit by treating it as a limit of function, say $\lim_{x\rightarrow\infty}\frac{(\ln x)^2}{x}$, using  L'Hospital's Rule. And I got the right answer.
However, I'm still worrying about if I can replace $n$ by $x$ under any circumstances.
Here are my questions

*

*Can anyone tell me under what circumstances can I replace $n$ by $x$ safely when calculating the limit?

*What's the relationship between Stolz theorem and L'Hospital's Rule? (The former looks like a discrete version of the latter theorem)

 A: We have that when the limit with $x\in \mathbb R$ exists then since the limit is the same for any subsequence then
$$\lim_{x\rightarrow\infty}\frac{(\ln x)^2}{x} =L \implies \lim_{n\rightarrow\infty}\frac{(\ln n)^2}{n}=L$$
with $L\in \bar {\mathbb R}$, otherwise the implication doesn't hold as for the mentioned example with $f(x)=\sin(\pi x)$ which doesn't exist but $\sin(\pi n)\to 0$.
For the other question refer to the related

*

*Stolz-Cesàro Theorem

*Another way of proving L'Hopital
A: *

*Over $\mathbb{R}$ (or more generally any metrizable space, including Euclidean spaces etc.), saying $\lim_{x\to x_0} f(x) = L$ is equivalent to every sequential limit $f(x_n) \to L$ for for some sequence $\{x_n\} \to x_0$. In particular, in your example, take the sequence $\{n\}_{n\in \mathbb{N}} \to \infty$. However, just because a subsequential limit exists (e.g. $\sin n\pi\to 0$ as indicated by @Gerry Myerson), does not mean the limit (e.g. $\sin nx$) exists . If the limit (as functions) doesn't exist, then you obviously can't make that substitution. However if the limit (as functions) does exist, then you can.

*Consider the forward difference operator $\Delta_h$ for sequences $\{a_n\}$, tentatively I use the notation to mean $\Delta_h (a_n) = a_{n+h}-a_n$, then a "discrete derivative" look like as $\frac{\Delta_h (a_n)}{h}$, then intuitively, Stolz–Cesàro is the discrete analogue of L'Hôpital's rule for $\Delta_1:=\Delta$, as we can illustrate:

For functions:
$$ \lim_{x\to x_0} \frac{f(x)}{g(x)} = \lim_{x \to x_0} \frac{f'(x)}{g'(x)} = L$$
For sequences:
$$\lim_{n\to\infty}\frac{ a_n}{b_n} =\lim_{n\to\infty} \frac{a_{n+1}-a_n}{b_{n+1}-b_n} = \frac{\Delta a_n}{\Delta b_n}=l$$
assuming that the presequisite conditions for each theorem hold
