# Proof of tangent lines to a curve

So I know how to calculate the tangent line to a curve with differentiation by taking the slope of a secant line and minimizing the change close to 0. I even tried out the neat little graph simulations where you can see the lines getting close to convergence.

My question is:

How do you know that the tangent line calculated from differentiation truly only touches a curve once?

Let's say there's a curve that looks like 3 very different mountain tops as an example:

There are very steep downward slopes and then it reverses to very steep upward slopes. Is the tangent line calculated at every certain point only going to touch the curve once? Is this foolproof? Are there examples where this fails? I know visually that I can imagine plenty of scenarios where this works but is a tangent line supposed to work even if it stretches out indefinitely?

There's also an example on wikipedia where it says that the absolute value of x as a function also fails because there is no differentiable slope, but can't you just draw a horizontal line at the origin of x = 0 and y = 0 as the tangent line, because that looks to only touch the "V" shape once indefinitely. Does wikipedia just mean that this tangent line still exists and "differentiation" just doesn't work in this case?

Thanks guys.

Quick answer: the tangent line may intersect the curve many times. For general curves, the tangent line at a point cannot be defined reasonably by counting the intersection points. Just think of the graph of $x \mapsto \sin x$ at $x=\pi/2$: the tangent line is the line $y=1$, which touches the graph infinitely many times.