# Cancelling variable factors in a rational function

Consider the function $\displaystyle\frac{2x−1}{x+5}$. The domain of this function is all real numbers except $x = -5$. Now consider that I do this: $\displaystyle\frac{2x−1}{x+5}⋅\frac{x}{x}$. This changes the domain of the function to all real numbers except $x = 5$ and $x = 0$. Why is this allowed? Technically x / x is just 1, but the two expressions end up having different domains just from multiplying by 1 = x / x. I just don't see why this is allowed considering that f(x) changed domains just from multiplying by that factor. In addition, why is the reverse situation allowed? For example, if we have a function defined by $\displaystyle f(x) =\frac{2x−1}{x+5}⋅\frac{x}{x}$, this means that the domain is all reals except -5 and 0. However, just by cancelling the x's, we have a whole new function, where x = 0 is now defined. However, this simple cancellation means that f(x) is no longer the same function, but a new function with a new domain, such that if $f\displaystyle (x)=\frac{x(2x−1)}{x(x+5)}$ then $\displaystyle f(x)≠\frac{2x−1}{x+5}$. I am just confused as to why this cancellation is allowed.

• $\frac{x}{x}$ is not just $1$. You're missing a subtle point. This does not hold if $x=0$. – MathematicsStudent1122 Apr 30 '16 at 4:32
• They are two different functions because they're defined on two different domains. But they're related. For example, the one defined on the bigger domain is the unique function that agrees with the one defined on the smaller domain and is also continuous. – Qiaochu Yuan Apr 30 '16 at 5:56

The domain of the original function is $x \in \mathbb{R}, x \neq 5$ because that makes the denominator equal to 0. The other function is defined on the domain of all $x \in \mathbb{R}, x \neq 0, 5$ because the original one (like I said) would have a denominator of 0, and the appending one will also have a denominator of 0. $0 \times 0$ is still 0, so if you simplify the function, the denominator would still be undefined for $x = 0, 5$.