Tangent Line, Normal Line and Linear Approximation
The tangent line to y=f(x) at x=a, where f is differentiable, is y=f(a)+f'(a)(x-a). The normal line is the perpendicular through the same point, with slope -\dfrac{1}{f'(a)} when f'(a)\ne 0. Near a the tangent also approximates the function itself, which is the idea behind differentials and linear approximation.
Tangent line: 3 steps
The derivative at a point is the slope of the tangent there, so finding the line takes three steps.
Find the point. Compute f(a). The point of tangency is (a,\,f(a)).
Find the slope. Differentiate with the basic rules and evaluate: m=f'(a).
Write the line in point-slope form.y-f(a)=f'(a)(x-a), or equivalently y=f(a)+f'(a)(x-a).
The normal line passes through the same point and is perpendicular to the tangent. Perpendicular slopes multiply to -1, so its slope is -\dfrac{1}{f'(a)}:
y=f(a)-\frac{1}{f'(a)}(x-a).
Example: f(x)=x^3-2x+1 at x=2
Step 1, the point.f(2)=2^3-2\cdot 2+1=8-4+1=5, so the point is (2,5).
Step 2, the slope.f'(x)=3x^2-2, so f'(2)=3\cdot 4-2=10.
Step 3, the tangent.y-5=10(x-2)\ \Longrightarrow\ y=10x-20+5=10x-15.
The normal. Its slope is -\dfrac{1}{10}: y-5=-\frac{1}{10}(x-2)\ \Longrightarrow\ y=-\frac{x}{10}+\frac15+5=-\frac{x}{10}+\frac{26}{5}.
Both lines must pass through (2,5). Check: 10\cdot 2-15=5 and -\dfrac{2}{10}+\dfrac{26}{5}=5.
Special cases
The formulas change when the slope is 0 or infinite.
Horizontal tangent, f'(a)=0. The tangent is y=f(a). The normal slope -\dfrac{1}{0} is undefined, so the normal is the vertical line x=a. Points with a horizontal tangent are the critical points where maxima and minima can occur.
Vertical tangent. If f is continuous at a and the slope grows without bound, the tangent is the vertical line x=a and the normal is horizontal, y=f(a). The formula y=f(a)+f'(a)(x-a) cannot write a vertical line, so you state it directly.
No tangent. At a corner the one-sided slopes differ, so there is no single tangent line. The article on when a derivative does not exist covers these cases.
Tangent with a given slope
Sometimes the slope is given and the point is unknown. Find the tangent to f(x)=x^2-3x that is parallel to the line y=2x+1.
Parallel lines have equal slopes, so the tangent must have slope 2. Solve f'(x)=2: 2x-3=2\ \Longrightarrow\ x=\frac52.
The point of tangency has x=\dfrac52 and f\!\left(\frac52\right)=\frac{25}{4}-\frac{15}{2}=\frac{25}{4}-\frac{30}{4}=-\frac54.
Now use point-slope form with m=2: y+\frac54=2\left(x-\frac52\right)\ \Longrightarrow\ y=2x-5-\frac54=2x-\frac{25}{4}.
For a tangent perpendicular to a line of slope m, solve f'(x)=-\dfrac1m instead.
Curves given implicitly
When the curve is defined by an equation, the slope at a point comes from implicit differentiation. The point must satisfy the equation, so you need both coordinates (x_0,y_0). With the slope m in hand, the same formula applies: y-y_0=m(x-x_0). For the circle x^2+y^2=25 at (3,4), the slope found there is -\dfrac34, so y-4=-\dfrac34(x-3), which simplifies to y=-\dfrac34x+\dfrac{25}{4}.
Differentials
The differential of y=f(x) is
dy=f'(x)\,dx.
Here dx is a small change in x, the same thing as \Delta x for the independent variable. The differential dy is the change in y along the tangent line when x changes by dx. The quantity \Delta y=f(x+dx)-f(x) is the actual change along the curve. For a small dx the two are close, \Delta y\approx dy, and that closeness is exactly what the limit definition of the derivative says.
With these meanings, \dfrac{dy}{dx}=f'(x) really is a quotient of two quantities, which is why Leibniz notation is so convenient.
Linear approximation
Use the tangent line as a function. The linearization of f at a is
L(x)=f(a)+f'(a)(x-a).
Close to a, f(x)\approx L(x). Written with a step h=x-a, this says f(a+h)\approx f(a)+f'(a)h, or \Delta y\approx dy. Choose a near the target value, at a point where f(a) and f'(a) are easy to compute.
Example 1: \sqrt{4.1}. Take f(x)=\sqrt x and a=4. Then f(4)=2, and since f'(x)=\dfrac{1}{2\sqrt x}, f'(4)=\dfrac14. So
\sqrt{4.1}\approx 2+\frac14(0.1)=2.025.
The true value is 2.024846\ldots, so the estimate is slightly too large.
Example 2: 1.02^5. Take f(x)=x^5 and a=1. Then f(1)=1 and f'(x)=5x^4, so f'(1)=5. Therefore
1.02^5\approx 1+5(0.02)=1.10.
The true value is 1.104080\ldots, so this estimate is too small.
Quantity
Linear estimate
True value
Error
\sqrt{4.1}
2.025
2.024846\ldots
over by about 0.00015
1.02^5
1.10
1.104080\ldots
under by about 0.0041
The direction of the error depends on how the curve bends. The square root bends downward, so its tangent lies above it and the estimate is too high. The fifth power bends upward near x=1, so its tangent lies below it and the estimate is too low. This is the subject of concavity.
The approximation also worsens as \lvert x-a\rvert grows. For smooth functions the error typically grows like (x-a)^2, so halving the distance cuts the error to about a quarter.
Mistakes to avoid
Using f(a) as the slope. The slope is f'(a). In the example, f(2)=5 is the height of the point, and f'(2)=10 is the slope.
Forgetting the shift. The line is y=f(a)+f'(a)(x-a). Writing y=f'(a)x or y=f(a)+f'(a)x leaves out the -a, so the line misses the point.
Reciprocal without the minus sign. The normal slope is -\dfrac{1}{f'(a)}, not \dfrac{1}{f'(a)}.
Try it:Open x^3-2*x+1 at the point x=2. The link fills in the field “Value / tangent at a point” under the graph. It reports f(2)=5 and f'(2)=10, draws the dashed tangent line and prints “Tangent line at this point: at (2, 5): y = 5 + 10·(x - 2) ⇒ y = 10·x − 15”, which is y=10x-15. The checkbox “tangent line” hides or shows the dashed line. The calculator draws the tangent only for the first derivative (order 1) and does not draw the normal line; you get the normal from the slope by hand. For the linear approximation, sqrt(x) at x=4 gives the tangent y=0.25x+1, and 0.25\cdot 4.1+1=2.025.
Frequently asked questions
Can a tangent line cross the curve?
Yes. “Tangent” is a local statement: the line matches the curve’s direction at one point, and it may meet the curve elsewhere. The tangent y=10x-15 from the example also meets y=x^3-2x+1 at x=-4, because x^3-12x+16=(x-2)^2(x+4). A tangent can even cross the curve at the point of tangency itself, which happens at an inflection point.
What is the difference between dy and \Delta y?
The differential dy is the change along the tangent line, and \Delta y is the change along the curve. For \sqrt x at x=4 with dx=0.1, we get dy=\dfrac14\cdot 0.1=0.025 and \Delta y=\sqrt{4.1}-2\approx 0.024846. They agree closely for small dx and drift apart as dx grows.
Why is linear approximation used if we can compute exactly?
A line is far easier to work with than most functions, so replacing a curve by its tangent near a working point simplifies equations in physics and engineering. A well-known case is \sin x\approx x for small angles in radians. Differentials also estimate error: if x is measured with a small error dx, then dy=f'(x)\,dx estimates the resulting error in y.