Why limits of functions which are not $\frac{0}{0}$ have an asymptote I just finished learning limits from Thomas Calculus. While doing it exercises I figured out that if $f(x)$ has numerator $0$ and denominator $0$. For example:
$f(x) = \frac{1 - \cos(x)}{ x}$ 
$f(x) = \frac{\cos(x) }{ x }$ 
as $x \to 0$.
The first one is $\frac{0}{0}$ and doesn't have an asymptote on $x = 0$; but the second one does. Are they even related? How? 
And why is the function
 $f(x) = \frac{x}{\sqrt{2} - x}$ different from 
 $f(x) = \frac{x}{ 1 - x}$?
In the second one it looks like a line is connecting the two sides of this. 
I'd be happy if anyone could help me understand these asymptotes better.
 A: Usually the function $f$ is said to have an asymptote at $c$ if either $\lim_{x\to c^-}f(x)=\pm\infty$ or $\lim_{x\to c^+}f(x)=\pm\infty$.
Note that the function need not be defined at $c$, but $c$ should be a limit point of the domain of $f$ (some texts require $f$ is defined either in a left or a right neighborhood of $c$, with the possible exclusion of $c$).
Since
$$
\lim_{x\to0}\frac{1-\cos x}{x}=0
$$
the function $f(x)=(1-\cos x)/x$ has no asymptote at $0$. On the other hand,
$$
\lim_{x\to0^-}\frac{\cos x}{x}=-\infty,
\qquad
\lim_{x\to0^+}\frac{\cos x}{x}=\infty,
$$
so the function $x\mapsto\frac{\cos x}{x}$ has an asymptote at $0$.
A: Remember that the Taylor series for cosine is
\cos x = 1-\frac{x^2}{2}+ \frac{x^4}{24} +\cdots$     
When we divide by $x$ alone we get
$\frac{\cos x}{x}  = \frac 1x -\frac{x}{2}+ \frac{x^3}{24} +\cdots$ The $\frac 1x$ out front gives the asymptote.   
When we subtract the series from 1 first we get
$1-\cos x = \frac{x^2}{2}- \frac{x^4}{24} +\cdots$ so that we don't get a $\frac 1x$ term when we divide by $x$.  This leaves us with
$\frac{1-\cos x}{x} = \frac{x}{2}- \frac{x^3}{24} +\cdots$  
To answer your second question,  both functions you mention have asymptotes (one at $x=\sqrt{2}$ and the other at $x=1$)  so I fail to understand your question. It may be you are witnessing a graphing error,  but that is due to the software trying to correct for a "mistake" it believes exists at the point of the asymptote by drawing a straight line across.  This fixes many similar issues when graphing that arise from rounding errors or such,  but does have the consequence of causing errors such as the one you may have witnessed.  If I am wrong in my interpretation let me know.
A: $$\frac{1-\cos x}{x}=\frac{\cos 0-\cos x}{x}=\frac{2\sin\frac{x}{2}\sin\frac{x}{2}}{x}=\sin\frac{x}{2}\frac{\sin\frac{x}{2}}{\frac{x}{2}}$$
This tends to $0\cdot 1=0$ as $x\to 0$, so the limit is finite, so there is no asymptote.
A: In your second example, recall that $\cos(0)=1$ so the limit is of type $\frac{1}{0}$ not of type $\frac{0}{0}$ as in the first example. Also the two functions $f_1(x)=\dfrac{x}{\sqrt{2}-x}$ and $f_2(x)=\dfrac{x}{1-x}$ are very similar differing mainly in the location of the vertical asymptote. If you are using a graphing program it will plot points for $x$ values separated by some uniform distance $\Delta x$. If there is a vertical asymptote between $x$ and $x+\Delta x$ then the software will incorrectly connect the two points with a straight line segment.
A: $$\frac 5 x \to \text{what, as }x\downarrow0\text{ ?}$$
The downward arrow means approaching $0$ from above; for the moment I'm not considering negative numbers.
Imagine $x$ is very very very close to $0$.  Say $x = \dfrac 1 {\text{1 million}}$.  Then $\dfrac 5 x$ is how many times $x$ goes into $5$.  It goes into $5$ no few than $5$ million times -- quite a large number.  Now cut $x$ down to $\dfrac 1 {\text{1 billion}}$ and $x$ goes into the numerator $5$ billion times.  You can make $x$ go into $5$ as large a number of times as you want by making $x$ small enough.  Thus $5/x$ goes to $+\infty$ as $x$ approaches $0$ from above. So you have a vertical asymptote.
Now consider $\dfrac{3x} x$.  Make $x$ small and you also make $3x$ small.  The tiny number $x$ still goes into the numerator only $3$ times.  It approaches $3$, not $+\infty$.
