Is it always valid to cancel something like (x-2) in the numerator and denominator of a rational function? What is the difference between $f(x) = \dfrac{(x + 2)(x - 2)}{x (x - 2)}$ and $g(x) = \dfrac{x + 2}{x}$?  Can you always cancel the (x - 2) factor?  Isn't an asymptote lost when that is done?  When I evaluate it at $x=2$ with a computer, like Wolfram Alpha or something, the software always seems to cancel and then evaluate.  That's why I'm confused.  I would think it should be undefined.
Edit:  Actually, I should have used the term "undefined point" rather than "asymptote".  What I'm actually interested in is the derivative.  Does the derivative have to preserve this undefined point or not?  It seems to me that I should preserve the $(x-2)$ when calculating the derivative in order to preserve the undefined point, but the computer invariably cancels it.
 A: The function $f(x)$ is indeed undefined when $x = 2$.    
However, $f(x)=g(x)$ when $x \ne 2$.  So except at the point $x=2$, the curves $y=f(x)$ and $y=g(x)$ are geometrically identical.  In particular, no asymptote is lost in going from $f(x)$ to $g(x)$.
The only difference between $y=f(x)$ and $y=g(x)$ is that the curve $y=f(x)$ has a "hole" of $0$ width at $x=2$.  If you plot the two curves, the difference will be invisible, whatever the magnification.
A reasonable argument can be made that software should quietly forget about the fact that $f(x)$ has a singularity at $x=2$, and give $f(2)$ the value $g(2)$.  I cannot imagine any real situation where this would cause a problem.  Indeed, treating $f$ as undefined at $x=2$ in this case could cause a perfectly valid computation to hang when it shouldn't. (I am not counting a high school test as a real situation.)
A: The answer depends on what kind of mathematical objects $f$ and $g$ are:


*

*Formal rational functions, that is $f$ and $g$ are elements of the field of fractions of the polynomial ring in the variable $x$ over some field -- here the real numbers I guess. In this case $f$ and $g$ are equal.

*Functions on some set -- here a subset of the reals I guess. Then $f$ and $g$ are different functions because $f$ is not defined at $2$, hence the domains of definition of the two functions do not coincide. However there is a unique extension of $f$ that is defined at $2$ and is a rational function. This extension is $g$.
A: This question has been well answered.  I thought it might help, however, to graph both functions and compare the graphs:
$f(x) = \displaystyle\frac{(x+2)(x-2)}{x(x-2)}$ looks like:
 
Note the hole in the graph of $f(x)$ at $x = 2$.  On the other hand, $g(x) = \displaystyle\frac{x+2}{x}$ looks like:
.
