Let $f$ be a function from $\mathbb{R}^2$ to $\mathbb{R}$ such that $f(X) = |XA| + |XB|$, where $A,B \in \mathbb{R}^2$. Let $T$ be a point on the ellipse $\varepsilon\colon f(X)=k$, for some $k\ge |AB|$. If $C \neq T$ is a point on the tangent line to $\varepsilon$ through $T$, then $f(C) > f(T)$.
The same goes for $g(X) = \bigl||XA| - |XB|\bigr|$, changing ellipse with hyperbola.
I've seen a proof to this (or a similar theorem) using partial derivative and gradients, which I don't know how to use. I'd like to find a more elementary proof. I know that the fibers of $f$ (or $g$) are confocal ellipses (or hyperbolas) which partition the plane. So the points "inside" an ellipse have smaller $f$ than the points on the ellipse and points "between" the branches of a hyperbola have greater $g$ than those ones on the hyperbola.
Even if it made sense, I can't prove that a tangent line to a conic stays "outside"/"between" that conic (except for the tangent point)... A line tangent to a conic intersect it only at one point (because it is algebraic curve of second degree), but I can't say more so far.
Let's prove first of all that the bisector of the external angle at $T$ of triangle $ABT$ has only point $T$ in common with the ellipse. Consider any point $P\ne T$ on the bisector and point $B'$, reflection of $B$ around the bisector (see diagram below). Notice that $ATB'$ are aligned and $APB'$ form a triangle, so by triangle inequality you have: $$ AP+BP=AP+PB'> AB'=AT+TB, $$ proving that $P$ is outside the ellipse.
Now we want to prove that any other line $r$ through $T$, different from the bisector considered above, has at least one point inside the ellipse. That is obvious if foci $A$ and $B$ lie on different sides of $r$, because in that case there is a point of segment $AB$ belonging to $r$.
If $A$ and $B$ are on the same side of $r$ (see diagram below), let $B'$ be the reflection of $B$ around $r$ and $P$ the point where $BB'$ intersects $r$. Notice that $ATB'$ are not aligned, for in that case $r$ would be the bisector of the external angle at $T$ of triangle $ABT$. By triangle inequality we then have $$ AP+BP=AB'<AT+TB'=AT+BT, $$ which shows that $P$ is inside the ellipse.