Type the point in At x₀. The tangent line touches the curve at (x0,f(x0)).
Read the equation y=mx+c under Tangent line, and the point of contact. How it was found shows the point, the slope and the point-slope form. Learn more about choosing the point
The line is drawn on the graph in amber; drag or zoom to look closely at the point where it touches.
Type a function of x and a point x0. The calculator finds the point of contact (x0,f(x0)), the slope m=f′(x0), and the equation of the tangent line in the form y=mx+c. The line is drawn on the graph so you can see it touch the curve.
Change the function or the point and everything follows at once. How it was found lists the three steps: the point, the slope from the derivative, and the line through the point with that slope.
Choosing the point
DemoDifferent functions, different points
Step 0 of 4
Any x0 where f is defined and smooth gives a tangent line. A few points are worth trying:
At a top or bottom of the curve the tangent is horizontal: its slope is 0.
Where the curve is steepest, the tangent is steepest too.
At x0=0 for sin(x) the tangent is y=x, which is why sinx≈x for small x.
If f is not defined at x0, or has no slope there, the calculator says so instead of drawing a line.
What a tangent line is
The tangent line to a curve at a point is the straight line that touches the curve there and has the same direction as the curve at that point. Zoom in far enough on a smooth curve and it looks straight; the tangent line is that straight line.
Its slope is the derivative at the point: m=f′(x0). For f(x)=2x2 at x0=2: the point is (2,2), the derivative f′(x)=x gives slope 2, and the tangent line is y=2x−2.
The tangent to y=2x2 at (2,2): y=2x−2.
The equation step by step
The tangent line through (x0,y0) with slope m is written most easily in point-slope form:
y−y0=m(x−x0).
For f(x)=x3−2x at x0=1:
The point: y0=f(1)=1−2=−1, so the point is (1,−1).
The slope: f′(x)=3x2−2, so m=f′(1)=1.
The line: y−(−1)=1⋅(x−1), that is y=x−2.
Type the same function and point into the calculator to check each number.
Horizontal tangents
Where f′(x0)=0 the tangent line is horizontal: y=f(x0). That happens at the tops and bottoms of a smooth curve, and finding the horizontal tangents is the first step in finding a function's highest and lowest points.
For f(x)=4x3−1.5x, the derivative 43x2−1.5 is zero at x=±2, so the curve has horizontal tangents at those two points, the local top and the local bottom.
Horizontal tangents at the top and bottom of 4x3−1.5x.
A tangent can cross the curve
"Touching" does not mean the line stays on one side. At an inflection point, where the curve changes the way it bends, the tangent line passes through the curve: y=x3 at x=0 has the tangent y=0, and the curve crosses it.
A tangent line can also meet the curve again elsewhere. The tangent to y=x3 at x=1 is y=3x−2, which meets the curve a second time at x=−2. What makes it a tangent is what happens at the point, not far away.
y=x3: the tangent at 0 crosses the curve; the tangent at 1 meets it again at −2.
The tangent line as an approximation
Near the point of contact, the tangent line stays close to the curve, so it can stand in for the function: this is linear approximation,
f(x)≈f(x0)+f′(x0)(x−x0).
For x at x0=4: f(4)=2 and f′(4)=41, so x≈2+4x−4. At x=4.2 that gives 2.05, while 4.2=2.0494… — very close. The further from x0, the larger the gap between the line and the curve.
x and its tangent at x=4 stay close near the point.
The normal line
The normal line at a point is perpendicular to the tangent line there. If the tangent has slope m=0, the normal has slope −m1:
y−y0=−m1(x−x0).
For 2x2 at (2,2) the tangent has slope 2, so the normal has slope −21: y=−2x+3. At a horizontal tangent the normal is the vertical line x=x0.
Common mistakes
Using f′(x) instead of f′(x0). The slope of the tangent is a number, the derivative's value at the point, not the derivative formula.
Forgetting the point.y=mx passes through the origin; the tangent must pass through (x0,f(x0)).
Sign errors in point-slope form.y−y0=m(x−x0); with x0=−1 that is x+1, not x−1.
Expecting a tangent at a corner.∣x∣ has no tangent line at 0.
Related tools
To see the derivative of the whole function, not just its value at one point, use the Derivative Calculator. To watch a secant line turn into the tangent, see the Tangent Line visualizer. For several curves and lines at once, use the Graphing Calculator.