Long division yields the tangent to a function I was reading about polynomials and long division at wikipedia, and came over
this part.

Polynomial long division can be used to find the equation of the line that is tangent to the graph of the function defined by the polynomial $P(x)$ at a particular point $x = r$.
If $P(x)$ divided by $(x - r)^2$ leaves a remainder of $R(x)$ then the equation of the tangent line to $P(x)$ at $x = r$ is $y = R(x)$ (regardless of whether or not $r$ is a root of the polynomial).

Source: http://en.wikipedia.org/wiki/Polynomial_long_division#Finding_tangents_to_polynomials
Can someone give me an intuitive explenation of why this is true, or a proof? Googling gave me nothing, and a few drawings of using $(x-a)(x-\Delta x)$ seemed to have something to do with the line from $a$ to $b$. Now letting $\delta x \to a$ would give the tangent. Is this correct?
I do not quite see why dividing $P(x):(x-a)(x-\Delta x)$ would give me a line through $a$ and $\Delta x$ though..
Any help, suggestions or tips is very welcome =)
 A: Since you're dividing by a quadratic, the remainder is linear --- $R(x)=ax+b$ for some $a,b$. You have $$P(x)=(x-r)^2Q(x)+R(x)$$ for some polynomial $Q$. Differentiate, set $x$ equal to $r$, and take it from there. Come back if you need more help. 
A: In general, if $f$ and $g$ are functions, $f$ is tangent to $g$ at $a$ if $f(a)=g(a)$ and $f'(a)=g'(a)$.
We have $p(x)=(x-r)^2+r(x)$, which gives
$$p'(r)=2(r-r)+r'(x)=r'(x)$$
So $p'(x)=r'(x)$
We also know that $p(r)=(r-r)^2+r(x)=r(x)$, so both stipulations for $p$ and $r$ to be tangent at $r$ are true.
A: Here's a more intuitive non-calculus based answer.


*

*First after the division we have $ f(x) = (x-r)^2Q(x) + R(x)$ where R(x) is a linear equation.  So at x = r, the quotient term zeroes out and f(r) = R(r).  In other words there is an intersection between the curve and line.

*If the line R(x) is tangent at that intersection then f(x) - R(x)  must be either negative or positive for a small delta around x and on both sides. If its a regular intersection then the difference will change signs on the left and right.

*Because we chose to divide by $ (x-r)^2$ after adjusting by a small delta  $ (x - r \pm \Delta)^2 >= 0$. As long as r is not root of Q(x) its zeros are far enough away from the delta we chose that the delta won't cross them and its sign cannot shift either.  So the necessary condition is met for tangency.


Note: the procedure breaks down when Q(x) does have additional roots of r but then R(x) = 0.
