Differentiating a function by simplification. If we consider a function:
$f\left(x\right)=\dfrac{x-1}{2x^2-7x+5}$
This function is not defined at x=1 and x=5/2. So if we differentiate this function by u/v method we have:
$\dfrac{d}{dx}\left(\frac{x-1}{2x^2-7x+5}\right)$=$\dfrac{1\left(2x^2-7x+5\right)-\left(4x-7\right)\left(x-1\right)}{\left(2x^2-7x+5\right)^2}$=$-\dfrac{2}{\left(5-2x\right)^2}$
This can also be done by simplifying $f\left(x\right)$ to:
$f\left(x\right)=\dfrac{x-1}{\left(x-1\right)\left(2x-5\right)}=\dfrac{1}{\left(2x-5\right)}$
Therefore, Again applying u/v chain rule we have:
$\dfrac{d\left(f\left(x\right)\right)}{dx}=-\dfrac{2}{\left(5-2x\right)^2}$
Which gives the same result. But if we plot both the derivatives (i.e plotting them by specifying $\dfrac{d\left(\frac{x-1}{2x^2-7x+5}\right)}{dx}$ in the initial case and $\dfrac{d\left(\frac{1}{2x-5}\right)}{dx}$ in the latter case), we have the initial derivative not defined at x=1 and x=5/2. But the second derivative is defined at x=1.
Is it valid to differentiate a function by simplifying it?
 A: The second derivative is not defined at $1$ because $f(x)$ is not defined at $1$. Your cancellation of the common term $x-1$ is allowed, provided $x\neq 1$. 
$$\frac{(x-1)}{(x-1)(2x-5)} \overset{x\neq 1}{ = }\frac 1{2x-5}$$
The left-hand side and the right-hand side agree everywhere except at $x=1$, where the denominator on the left, evaluated at $x = 1$ is undefined. By cancelling the common factor, you arrived at a function (right-hand side) that isn't exactly equal to the left-hand side, because they do not agree at $x=1$. So the "simplification" you made loses the information that $x \neq 1$,  and because of this loss, you end up with a partially correct answer.  
You are certainly free to use the method you used (in simplifying the function). But  from the moment of cancellation (which amounts to division by zero), we need to acknowledge this "move" is valid for all $x\neq 1$, and we need to carry this information along, to the very end, so it is not omitted as a point at which the function, and hence its derivative, is undefined.
A: However, this kind of point is of absolutely no use except when answering silly questions, because the limit as $x\to 1$ is the same in both cases. In practice if you have an oddball point $x_0$ where a function is technically undefined, but the left and right limits as $x\to x_0$ of $f(x)$ are the same, then you automatically regard $f(x_0)$ as defined to equal that limit.
Sorry, when I say silly question, I am not criticising the question here but the kind of professor who sets it. :)
A: Remembering two general principles may help in these situations that invariably come up in first calculus classes.  (1) The common rules for differentiating functions are applicable only when a "well defined" qualifier holds: the independent variable (your x) must be restricted to values which lie in the domain of each function involved.  (2) The domain of a quotient of polynomials (aka rational function) cannot include any zeroes of the polynomial denominator. If you examine your simplifying equation which equates two rational functions, you notice the denominators have different zeroes (these zeroes are sometimes called the poles of the rational functions).  If you were to graph the left-hand function at points other than x = 1 and x = 2.5, you'll see a vertical asymptote at x = 2.5, but no such behavior at x = 1.  Try it by substituting numeric values for x, and compare the very different graphic of the rational function that has the same denominator but a numerator x instead of x-1 where there's no cancellation. 
