A commonly-accepted definition of a tangent line is the following.
A tangent line is a straight line that touches a function at only one point.
However, there are clearly cases where a tangent at a point touches the function at another point. The example that comes to mind right now is $f(x) = x\sin(x),$ where the derivative at $x=0$ is $0$ and the line with zero slope with $y=0$ intersects the function at numerous (an infinite number of) places, including $(\pi, 0)$ for instance.
Is the above definition of a tangent line sufficient, and how so? If not, what is a better definition for a tangent line?

Here is my answer from an earlier question (How is the derivative truly, literally the "best linear approximation" near a point?), which shows that the tangent is the best local linear approximation to the function at a point:
I'll first give a intuitive answer, then an analytic answer.
Intuitively, the tangent goes in the same direction as the function, following it as closely as possible for a line. Any other line immediately starts to diverge from the function.
Analytically:
Consider the Taylor aproximation at $x$: $f(x+h) =f(x)+hf'(x)+h^2f''(x)/2+... $.
This means that, for small $h$ $f(x+h) \approx f(x)+hf'(x)+h^2f''(x)/2 $ so that the error $E(x, h) =f(x+h)- (f(x)+hf'(x)) $ is about $ h^2f''(x)/2 $.
Now consider any other line through $(x, f(x))$ with slope $s$, with $s \ne f'(x)$. At $x+h$, its value is $f(x)+sh$, so its error, $e(x, h)$ is $e(x, h, s) =f(x+h)-(f(x)+sh) $.
Since $f(x+h)-f(x) \approx hf'(x)+h^2f''(x)/2 $,
$\begin{array}\\ e(x, h, s) &=f(x+h)-(f(x)+sh)\\ &\approx hf'(x)+h^2f''(x)/2-sh\\ &= h(f'(x)-s)+h^2f''(x)/2\\ \end{array} $
so that $\dfrac{E(x, h)}{e(x, h, s)} \approx \dfrac{h^2f''(x)/2}{h(f'(x)-s)+h^2f''(x)/2} = \dfrac{hf''(x)/2}{f'(x)-s+hf''(x)/2} $.
Since $s \ne f'(x)$, as $h \to 0$, the numerator of thie ratio of errors goes to zero, while the denominator stays bounded away from zero.
Therefore the error of the tangent goes to zero faster than the error in any other line through the point.
That is why the tangent is the best linear approximation to the curve.