Every standard calculus textbook discusses the geometric interpretation of the tangent line to a curve at a given point. However, we define the tangent line differently. The tangent line to a curve at a given point is the line which provides the best local approximation of all the lines passing through the given point. In this post, we clarify the meaning of this definition mathematically and describe a method to find the equation of the tangent line to a curve.

#### Definition of tangent line to a curve

Let \(f\) and \(g\) be a real-valued functions definable on a closed real interval \([a,b]\) with \(a < b\). Let \(c\) be a real number between \(a\) and \(b\). Define the error function \(E\) by $$E(x) = f(x) – g(x).$$ Let \(h\) be a real-valued function definable on \([a,b]\) such that $$\lim_{x \to c} h(x) = 0.$$ We say that \(g\) gives the best local approximation to \(f\) with respect to \(h\) at \(c\) if the following conditions hold:

- \(E(c) = 0\). In other words, \(f\) and \(g\) agree on \(c\).
- \(\lim_{x \to c} \displaystyle \frac{E(x)}{h(x)} = 0\), provided this limit exists. In other words, the error is negligible when compared with \(h(x)\) at \(c\).

By definition, the tangent line to a curve \(f\) at \(c\) is a linear function \(g(x) = mx+b\) which gives the best local approximation to \(f\) with respect to the function \(x-c\) at \(c\).

#### The equation of the tangent line to a curve

**Result**. Let \(f\) be a real-valued function definable on a closed real interval \([a,b]\) with \(a < b\). Let \(c\) be a real number between \(a\) and \(b\). The equation of the tangent line to the curve \(f\) at \(c\) is as follows: $$T(x) = m(x-c) + f(c),$$ where $$ m = \lim_{x \to c} \frac{f(x)-f(c)}{x-c}.$$

The proof is as follows: Let $$T(x) = mx+b$$ be the equation of the desired tangent line. First of all \(T\) and \(f\) must agree on \(c\). Therefore, we may set the equation of \(T\) as follows: $$T(x) = m(x-c) + f(c).$$ Observe that the error function \(E\) is $$\frac{E(x)}{x-c} = \frac{f(x) – T(x)}{x-c}$$ $$\frac{f(x) – f(c) – m(x-c)}{x-c} = $$ $$\frac{f(x)-f(c)}{x-c} – m.$$ Now, the condition \(\lim_{x \to c} \displaystyle \frac{E(x)}{h(x)} = 0\) implies that $$ m = \lim_{x \to c} \frac{f(x)-f(c)}{x-c}.$$

**Remark**. It is clear that \(\lim_{x \to c} \displaystyle \frac{f(x)-f(c)}{x-c}\) is approximately equal to the average rate of change of the function \(f\) over the intervals \([c,x]\) or \([x,c]\), where \(x\) is near to \(c\).

**Exercise**. Find the tangent line of the function \(f(x) = x^2\) at \(x = 2\).

**Solution**. Note that \(f(2) = 4\) and $$m = \lim_{x \to 2} \frac{f(x) – f(2)}{x-2} = $$ $$\lim_{x \to 2} (x+2) = 4.$$ The equation of the tangent line to \(f\) at \(x = 2\) is $$y = 4(x-2) + 4 = 4x – 4.$$

**Exercise**. Find the tangent line to the curve \(f(x) = \sin x\) at \(x = 0\).

**Remark**. Let \(f\) be a real-valued function definable on a closed real interval \([a,b]\) with \(a < b\). Let \(c\) be a real number between \(a\) and \(b\). The slope of the tangent line, i.e., $$ m = \lim_{x \to c} \frac{f(x)-f(c)}{x-c}$$ is the base for the definition of the derivative of the function \(f\) at the point \(c\).