We can find the equation of the tangent at the point \( x = 2 \) by dividing \( f(x) \) by \( (x-2)^2 \).

\[ \frac{f(x)}{(x-a)^2}=q(x)+\frac{r(x)}{(x-a)^2} \]

which can be easily rearranged to give

\[ f(x) = q(x) (x-a)^2+ r(x) \]

A couple of things to note. First \( r(x) \) must be linear, since it is a degree less than \( (x-a)^2 \).

Second, at the point \( x = a \) we find that \[ f(a) = r(a) \].

In other words, \( f \) and \( r \) have the same value at \( x = a \).

In other words \( f^{\prime}(x)\) and \( r^{\prime}(x) \) have the same slope/gradient at \(x = a\). This is necessary if \( r(x) \) is a tangent line.

Therefore \( y = r(x) \) must be a tangent line to the curve \( y=f(x) \) at the point \( x=a \).