Limit of division vs Limit of subtraction I was studying the Prime Number Theorem, which says $\lim_{x\to \infty} \frac{\prod(x)}{\frac{x}{\ln x}} = 1$, where $\prod(x) =$ number of primes $\leq x$. But the Wikipedia results for $\prod(x) - \frac{x}{\ln x}$ do not seem to tend to $0$ as $x\to \infty$.
So my doubt, in general is that if $\lim_{x\to a}\frac{f(x)}{g(x)} = 1$, then it seems to be true that $\lim_{x\to a} f(x)-g(x) = 0$. Please give some insight as to why this is true or not. Does $a = \infty$ change the result?
 A: The fact that the limit of the ratio is $1$ basically says nothing about the behaviour of the difference. We illustrate with limits as $x\to \infty$. Similar illustrations can be made with limits as $x\to a$, where $a$ is arbitrary.
$1$.) Let $f(x)=x^2+17$ and let $g(x)=x^2+1$. Then $\lim_{x\to\infty}\frac{f(x)}{g(x)}=1$ but $\lim_{x\to\infty} (f(x)-g(x))=16$.
$2$.) Let $f(x)=x^2+x+1$ and $g(x)=x^2+1$. The limit of the ratio is $1$, but the limit of the difference does not exist, or if you prefer is $\infty$.
$3$.) Let $f(x)=x^2-\sin x$ and $g(x)=x^2+1$. Again the limit of the ratio is $1$, but the difference oscillates.
A: The situation changes depending on $x \to a$ or $x \to \infty$.
For $x \to \infty$, André Nicolas explained it well. But for $x \to a$, where $a$ is a finite number, we  have the following.
Aim: $\forall \epsilon > 0$, we will find $\delta>0$ s.t. if $|x-a|<\delta$ then $|f(x)-g(x)|< \epsilon$.
We know, given $\epsilon_0>0$, we know that there exists a $\delta_0>0$ satisfying when $|x-a|<\delta_0$ we have $|\frac{f(x)}{g(x)} - 1|<\epsilon_0$.
Now let $I_1 = [a-1, a+1]$/{$a$} and $T_1 = max( |g(I_1)| )$. Here WLOG assume $I_1$ is the interval where $g(x)$ is continuously defined on. If not, then replace 1 with the maximum possible length.
Now assume we are given $\epsilon_1>0$. Set $\epsilon_0 = \frac{\epsilon_1}{T1}$. We know can find a $\delta_0$ with $|x-a|<\delta_0 \implies |\frac{f(x)}{g(x)} - 1| < \epsilon_0$. Now define $\delta_1 = min( 1 , \delta_0 )$.
Since we have $|\frac{f(x)}{g(x)} - 1| <\epsilon_0 = \frac{\epsilon_1}{T1}$.
$\implies  \frac{|f(x)-g(x)|}{|g(x)|}<\frac{\epsilon_1}{T1}$.
$\implies |f(x)-g(x)|<|g(x)|.\frac{\epsilon_1}{T1}$.
$\implies |f(x)-g(x)|<\epsilon_1$. ( since $g(x)< T_1$  on the interval $[a-\delta_1, a+\delta_1]$).
Thus:
Given $\epsilon_1$ we have found a $\delta_1$ with $|x-a|<\delta_1$ we have $|f(x)-g(x)|<\epsilon_1$.
That is, $\lim_{x \to a} f(x)-g(x) = 0$.
