Possible inconsistencies in finding the equation of a tangent line to a curve that also passes through a point. As the title says, there may be possible inconsistencies in finding the equation of a tangent line to a curve that also passes through a point.
Consider a problem that asks you to find the equation of all tangent lines to the curve f(x) = x^2 that also pass through (5,9). Well one knows that the general equation for a line that passes through a specific point (a,b) is y-a = m(x-b). In this case we have y-9 = m(x-5). We also know that m = f'(x) since it is a tangent of the curve f(x). Furthermore, there is a restriction on f'(x) in that it must pass through (5,9), meaning that f'(x) must = (f(x)-9)/(x-5). Plugging in everything, we have 2x = (x^2 - 9) / (x - 5). Solving, we have x = 9 and 1. Since m = f'(x), we have m = 18 or 2. Then, we plug everything in and we get y = 2x-1 and y = 18x - 81. 
Everything seems fine. So far...
Consider a very similar question: find the equation of all tangent lines to the curve f(x) = x^2 that also pass through (1,1). The biggest difference between this problem and the other is this is a "degenerate" case in the sense that (1,1) actually exists on line f(x) = x^2. Using what we have above, we  setup the equation y-1 = m(x-1) and proceed to solve for m like before. We have 2x = (x^2 - 1) / (x - 1) and solving, we have x = 1. We then plug in 1 into 2x and then plug and chug and we get y = 2x-1. 
Not sure how you put an image, but if you look on desmos, the line is correct and is a tangent of f(x) = x^2 and also passes through (1,1)
Now this seems fine except for the fact that if we check x = 1 for 2x = (x^2 - 1) / (x - 1), we have 0/0 = 2. My question is why does this nonsense equality still yield a legitimate answer? 
 A: Because
$\lim_{x \to 1} \dfrac{x^2-1}{x-1}
=\lim_{x \to 1} (x+1)
=2
$.
A: You’re making a very common mistake, one that’s related to the key error in the classic false proof that $2=1$: When you divided the equation $f'(x)(x-5)=f(x)-9$ by $x-5$, you’ve added a potential division of both sides by zero. The resulting right-hand side ${x^2-9\over x-5}$ is undefined for $x=5$. So, you need to add the condition $x\ne5$ for this transformation to be valid. This tacit condition stays with the equation throughout all of the succeeding manipulations. The solutions to the equation are $x=1$ and $x=9$, neither of which is equal to the prohibited value, so the division and other manipulations of the equation were all valid after all.
In the second case, you divide the equation by $x-1$, so the additional condition is $x\ne1$. Unfortunately, the only solution is $x=1$, so this division wasn’t really valid, as you saw yourself when you plugged this value into ${x^2-1\over x-1}$ and got an indeterminate form. On the other hand, solving this equation as if the division was valid produced the right answer. How come?  
Viewed as a function of $x$, the expression ${x^2-1\over x-1}$ has a removable discontinuity at $x=1$. The value of this function is equal to $x+1$ everywhere that it is defined and $\lim_{x\to1}{x^2-1\over x-1}=2$, which is consistent with $x+1$, so we can “patch” the function with this value so that it’s equal to $x+1$ everywhere. That’s effectively what you did if you solved the equation by reducing the right-hand side to $x+1$.
Another justification is that the formal polynomial division that reduces the r.h.s. to $x+1$ is valid in the ring of polynomials over $\mathbb R$. The power series for ${x^2-1\over x-1}$ converges at $x=1$, so all is well. You’ll see this sort of thing done fairly often in other contexts, such as finding the sum of an infinite series: you formally manipulate an equation or expression assuming that everything you’re doing to it is valid, and then after getting the answer show in some other way that the derivation was in fact valid, e.g., that the series converges in the right region. (A lot of people skip that second part.)
The issue could’ve been avoided altogether by solving the original equation in a different way. Instead of dividing $f'(x)(x-x_0)=f(x)-f(x_0)$ by $x-x_0$, move everything to the left and simplify: $$2x(x-1)=x^2-1 \\ 2x(x-1)-x^2+1=0 \\ x^2-2x+1=0 \\(x-1)^2=0.$$ Every step of that solution is valid for all $x$. Another possibility is to factor the r.h.s. into $(x+1)(x-1)$ first, then move everything to the left and simplify using the distributive law. In some sense, that’s equivalent to dividing both sides by $x-1$, but without the potentially illegal division.
