Can someone provide the formal definition of the tangent line to a curve? I was recently explaining differentiation from first principles to a colleague and how differentiation can be used to obtain the tangent line to a curve at any point. While doing this, my colleague came back at me with an argument for which I had no satisfactory reply.
I was describing the tangent line to a curve at a specific point in the same way that I was taught at school - that it is a line that just touches the curve at that point and has gradient equal to the derivative of the curve at that point. My colleague then said that for a cubic curve, the line can touch the curve again at other points so I explained the concept again but restricted to a neighbourhood about the point in question.
He then came back with the argument of this definition when the "curve" in question is a straight line. He argued that in this case the definition of the tangent line as "just touching the curve at that point" is simply not true as it is coincident with the line itself and so touches at all points.
I had no comeback to this argument at all and had to concede that I should have just defined the tangent as the line passing through the point on the curve that has gradient equal to the derivative at that point.
Now this whole exchange left me feeling rather stupid as I hold a Phd in Maths myself and I could not adequately define a tangent without using the notion of differential calculus - and yet when I was taught calculus at school it was shown as a tool to calculate the gradient of a tangent line and so this becomes a circular argument.
I have given this serious thought and can find no argument to counter my colleagues observation of the inadequacy of the informal definition in the case when the curve in question is already a straight line. 
Also, if I do this again in future with another colleague how can I avoid embarrassment again? At what point did I go wrong here with my explanations? Should I have avoided the geometric view completely and gone with rate of changes instead? I am not a teacher but have taught calculus from first principles to many people over the years and would be very interested in how it should be done properly.
 A: Although this isn't the most satisfying definition for a first encounter with the idea of a 'tangent line', you could escape all problems by defining a tangent line as the best linear approximaton to a function $f$ near a point $P$. More formally, a line $L=L(x)$ through $P\big(a,f(a)\big)$ is a tangent line to the graph of $f$ at $P$ given that for any other line $K=K(x)$ through $P$, there exists a $\delta\gt0$ such that for all $x$: $$|x-a|\lt\delta \implies \big|f(x)-L(x)\big|\leqslant\big|f(x)-K(x)\big|.$$ See the paper What a Tangent Line is When it isn't a Limit, by Irl C. Bivens.
A: Building on Luis Felipe's idea, define the tangent at point $P$ of a curve as the limit of the line $PQ$ as $Q$ tends to $P$, where $Q$ is also a point on the curve. This also provides a natural introduction to the formal definition of derivatives.
A: Imagine a car driving along the curve, and at the point of interest, the car hits an oil slick and shoots off in the straight line of its travel as it hits the point.  The line of the car gives the tangent line at the point (provided the curve is differentiable at the point).  You can look at cars sliding off coming from both directions to see the tangent line in both directions.
A: 
when I was taught calculus at school it was shown as a tool to calculate the gradient of a tangent line and so this becomes a circular argument.

I think that is a red herring. The fact that the derivative was introduced as a tool to calculate the gradient of a tangent line does not mean that the idea of a tangent line necessarily has anything to do with the definition of the derivative. I'm sure you learned at some point in that PhD (well, in the undergraduate part) that it is, in fact, possible to give a formal definition of a derivative that has nothing to do with tangents, lines, or curves at all. So it's not a circular argument. The tangent was used as motivation for the derivative, but once the concept is introduced, you can dispense with the original motivation.
You might easily imagine a student in a different class who first learned of derivatives as a way to calculate speed, not gradients.
A: $\newcommand{\Reals}{\mathbf{R}}$This is a broader question than it looks, involving both mathematics (e.g., what is a curve, what structure does the ambient space have) and pedagogy (e.g., what definition best conveys a concept of differential calculus, what balance of concreteness and generality is most suitable for a given purpose).


*

*If a curve is the graph in $\Reals^{2}$ of a differentiable real-valued function of one variable, then I'd argue the "right" definition of the tangent line to the graph at a point $x_{0}$ is the line with equation
$$
y = f(x_{0}) + f'(x_{0})(x - x_{0})
$$
through $\bigl(x_{0}, f(x_{0})\bigr)$ and having slope $f'(x_{0})$. (With minor modifications, the same concept handles the image of a regular parametric path, i.e., a differentiable mapping from an open interval into $\Reals^{2}$ whose velocity is non-vanishing.)


Under this definition, the fact that "(modulo fine print) the tangent line is the limit of secant lines" is a geometric expression of the definition rather than a theorem expressing equivalence of an analytic and a geometric definition of "tangency".


*

*If a plane curve is an algebraic set, i.e., a non-discrete zero locus of a non-constant polynomial, then one might investigate tangency at $(x_{0}, y_{0})$ by expanding the curve's defining polynomial in powers of $x - x_{0}$ and $y - y_{0}$, declaring the curve to be smooth at $(x_{0}, y_{0})$ if the resulting expansion has a non-vanishing linear part, and defining the tangent line to be the zero locus of that linear part. (Similar considerations hold for analytic curves—non-discrete zero loci of non-constant analytic functions.)


For example, if the curve has equation $x^{3} - y = 0$, the binomial theorem gives
\begin{align*}
0 &= x_{0}^{3} + 3x_{0}^{2}(x - x_{0}) + 3x_{0}(x - x_{0})^{2} + (x - x_{0})^{3} - \bigl[(y - y_{0}) + y_{0}\bigr] \\
 &= \bigl[3x_{0}^{2}(x - x_{0}) - (y - x_{0}^{3})\bigr] + 3x_{0}(x - x_{0})^{2} + (x - x_{0})^{3}.
\end{align*}
The bracketed terms on the second line are the linear part, and the tangent line at $(x_{0}, y_{0}) = (x_{0}, x_{0}^{3})$ has equation
$$
0 = 3x_{0}^{2}(x - x_{0}) - (y - x_{0}^{3}),\quad\text{or}\quad
y = x_{0}^{3} + 3x_{0}^{2}(x - x_{0}),
$$
"as expected".


*

*In "higher geometry", the "tangent space" is usually defined intrinsically. One determines the behavior of the tangent space under morphisms, and defines the "tangent space" of the image of a morphism to be the image of the intrinsic tangent space in the appropriate sense.


In the study of smooth manifolds it's common to use differential operators (a.k.a., derivations on the algebra of smooth functions). In algebraic geometry it's common to use the ideal $I$ of functions vanishing at $x_{0}$, and to define the tangent space to be the dual of the quotient $I/I^{2}$. The preceding examples are, respectively, calculus-level articulations of these two viewpoints.
These are not, however, the appropriate levels of generality to foist on calculus students. I personally stick to the analytic definition, and in fact usually assume "curves" are continuously differentiable.
A: For a more purely geometrical notion of what a tangent is, I imagine a line $T$ through a point $P$ on a curve such that for any given double cone (however thin) with $T$ as its axis and $P$ as its apex point, there is a small enough neighborhood $N$ of $P$ such that the part of the curve within that neighborhood is completely contained in that double cone. Then $T$ is tangent to the curve at $P$.

This definition mimics the idea that the tangent is a linear approximation to and resembles the curve in small neighborhoods of the point.
A: If you have a curve and a point $P$ in it, we can take a secant $L_{PQ}$ which is a line passing by $P$ and $Q$.
So $d(P,Q)\geq0$. if the curve is bounded, then exists some $C>0$ such for every  $P$ in the curve, and for every real $C>\varepsilon>0$ there exists some $Q$ such secant $L_{PQ}$ has $d(P,Q)=\varepsilon$. So, we define $L_\intercal (P)$ as the tangent at the point $ P$ with $\varepsilon=0$.

note that I'm using elemental concepts which can be clear for high school. The constant $C$ is because if you have a circle, you can't find a secant in $P$ with $d(P,Q)>2r$ where $r$ is the radius of the circle. 
A: Tangent at a point $(a,f(a))$ on a curve is the line whose slope is equal to
$$\lim_{h \to 0} \frac{f(a+h)-f(a)}{h}$$.
