# Why does simplifying a function change its domain?

Perhaps this is a silly question, but if you have a function, such as

$$f(x) = \frac{x^2}{x}$$

the domain is all real numbers except x = 0.

However, this function simplifies to

$$f(x) = x$$

which has a domain of all real numbers. The domains for the two functions are different. Why are you permitted to simplify the first function if the domain changes?

-
To be short, the (maximum valid) domain changes because the reason why the domain is restricted falls away. – glglgl May 25 '14 at 5:54

To be strictly correct, the domain does not change. The simplified version of $$f(x)=\frac{x^2}{x}\ ,\quad x\ne0$$ is $$f(x)=x\ ,\quad x\ne0\ .$$
Really, a function is not properly specified unless the domain is stated. If a function is given without a domain then the normal default assumption is to take the largest possible domain. So, if you were given a proposed function $f(x)=x$ with no "back story" you would probably (but need not) choose the domain $\Bbb R$. But this case is different since you do have some prior information about the function.
Think of domain of more as a graph. If you have $y=x$ (as in your example), is the function defined at $0$? yes. If you have $y=\frac{x^2}{x}$ and you plug in $0$, it's an improper fraction, so it wouldn't even "work" unless it was simplified.
If you have something like $\frac{(x-3)}{(x^2-9)}$, $x$ can't be $3$, right? But this is a "legit" function at $x=3$ (undefined, rather than improper). So when you simplify something like this to $y=\frac{1}{(x+3)}$ the domain is STILL $x \neq 3$