Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

Tangent Line Calculator

How to use
  1. Type the function in the f(x)f(x) box, for example x22\dfrac{x^2}{2} or sin⁡(x)\sin(x). Learn more about finding the tangent line
  2. Type the point in At x₀. The tangent line touches the curve at (x0,f(x0))(x_0, f(x_0)).
  3. Read the equation y=mx+cy = 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
  4. The line is drawn on the graph in amber; drag or zoom to look closely at the point where it touches.

Tangent line
Tangent line
y=2x−2\displaystyle y = 2x - 2
Point of contact
(2, 2)\displaystyle (2,\ 2)
How it was found

The point: f(2)=2f(2) = 2.

The slope: f′(x)=xf'(x) = x, so f′(2)=2f'(2) = 2.

Point and slope give y−2=2 (x−2)y - 2 = 2\,(x - 2), that is y=2x−2y = 2x - 2.

Drawn by the tool
tangent: y=2x−2\text{tangent: } y = 2x - 2read-only
f(x)=x22f\left(x\right)=\frac{{x}^{2}}{2}
tangent: y=2x−2\text{tangent: } y = 2x - 2


Finding the tangent line

DemoFind a tangent line
Step 0 of 4
Type a function of xx and a point x0x_0. The calculator finds the point of contact (x0,f(x0))(x_0, f(x_0)), the slope m=f′(x0)m = f'(x_0), and the equation of the tangent line in the form y=mx+cy = 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 x0x_0 where ff 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 00.
  • Where the curve is steepest, the tangent is steepest too.
  • At x0=0x_0 = 0 for sin⁡(x)\sin(x) the tangent is y=xy = x, which is why sin⁡x≈x\sin x \approx x for small xx.

  • If ff is not defined at x0x_0, 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)m = f'(x_0). For f(x)=x22f(x) = \frac{x^2}{2} at x0=2x_0 = 2: the point is (2,2)(2, 2), the derivative f′(x)=xf'(x) = x gives slope 22, and the tangent line is y=2x−2y = 2x - 2.
The tangent to y=x22y = \frac{x^2}{2} at (2,2)(2, 2): y=2x−2y = 2x - 2.

The equation step by step

    The tangent line through (x0,y0)(x_0, y_0) with slope mm is written most easily in point-slope form:

    y−y0=m (x−x0).y - y_0 = m\,(x - x_0).


    For f(x)=x3−2xf(x) = x^3 - 2x at x0=1x_0 = 1:

  • The point: y0=f(1)=1−2=−1y_0 = f(1) = 1 - 2 = -1, so the point is (1,−1)(1, -1).
  • The slope: f′(x)=3x2−2f'(x) = 3x^2 - 2, so m=f′(1)=1m = f'(1) = 1.
  • The line: y−(−1)=1⋅(x−1)y - (-1) = 1\cdot(x - 1), that is y=x−2y = x - 2.

  • Type the same function and point into the calculator to check each number.

Horizontal tangents

Where f′(x0)=0f'(x_0) = 0 the tangent line is horizontal: y=f(x0)y = f(x_0). 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)=x34−1.5xf(x) = \frac{x^3}{4} - 1.5x, the derivative 3x24−1.5\frac{3x^2}{4} - 1.5 is zero at x=±2x = \pm\sqrt{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 x34−1.5x\frac{x^3}{4} - 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=x3y = x^3 at x=0x = 0 has the tangent y=0y = 0, and the curve crosses it.

A tangent line can also meet the curve again elsewhere. The tangent to y=x3y = x^3 at x=1x = 1 is y=3x−2y = 3x - 2, which meets the curve a second time at x=−2x = -2. What makes it a tangent is what happens at the point, not far away.
y=x3y = x^3: the tangent at 00 crosses the curve; the tangent at 11 meets it again at −2-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).f(x) \approx f(x_0) + f'(x_0)(x - x_0).


For x\sqrt{x} at x0=4x_0 = 4: f(4)=2f(4) = 2 and f′(4)=14f'(4) = \frac{1}{4}, so x≈2+x−44\sqrt{x} \approx 2 + \frac{x - 4}{4}. At x=4.2x = 4.2 that gives 2.052.05, while 4.2=2.0494…\sqrt{4.2} = 2.0494\ldots — very close. The further from x0x_0, the larger the gap between the line and the curve.
x\sqrt{x} and its tangent at x=4x = 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≠0m \ne 0, the normal has slope −1m-\frac{1}{m}:

y−y0=−1m(x−x0).y - y_0 = -\frac{1}{m}(x - x_0).


For x22\frac{x^2}{2} at (2,2)(2, 2) the tangent has slope 22, so the normal has slope −12-\frac{1}{2}: y=−x2+3y = -\frac{x}{2} + 3. At a horizontal tangent the normal is the vertical line x=x0x = x_0.

Common mistakes

  • Using f′(x)f'(x) instead of f′(x0)f'(x_0). The slope of the tangent is a number, the derivative's value at the point, not the derivative formula.
  • Forgetting the point. y=mxy = m x passes through the origin; the tangent must pass through (x0,f(x0))(x_0, f(x_0)).
  • Sign errors in point-slope form. y−y0=m(x−x0)y - y_0 = m(x - x_0); with x0=−1x_0 = -1 that is x+1x + 1, not x−1x - 1.
  • Expecting a tangent at a corner. ∣x∣|x| has no tangent line at 00.