Toolvito

Works on this device

Tangent Line Calculator

Type a function and a point to get the tangent line there: its slope, its equation and the steps. The page finds the exact derivative for you and checks the slope with a second, numerical method.

Enter your values

Gives the slope and the equation of the tangent line, and the normal line at the same point.

Your values

Use x as the variable. Example: x^3 - 3x, sin(x), sqrt(x + 1), e^x. Write 2x or 2*x for 2 times x.

A number, a fraction such as 1/2, or a value such as pi/4 or sqrt(2).

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Calculate.

How to use this calculator

  1. Choose what you want, for example Tangent line to y = f(x) at a point.
  2. Type the function with x as the variable, for example x^3 - 3x or sin(x).
  3. Type the x-value of the point. You can use a number, a fraction such as 1/2, or a value such as pi/4.
  4. Choose Calculate. Check the line Function as read to see that the page understood your formula.

How to type a function

  • Use +, -, *, / and ^ for powers. Brackets ( ) group things.
  • 2x and 3(x + 1) mean multiplication. x^2 is x squared.
  • Functions: sin, cos, tan, asin, acos, atan, sqrt, abs, ln, log, exp. They need brackets: sin(x), not sin x. You can also type sec, csc and cot.
  • Constants: pi and e. So e^x and exp(x) are the same.
  • Angles are in radians. ln is the natural logarithm. log is the logarithm to base 10.
  • A power applies before a minus sign: -x^2 means −(x²). 1/2x is read as (1/2) × x. Use brackets for 1/(2x).
  • Anything else is refused, and the page tells you where the problem is.

The method

The slope of the tangent line at x = a is the derivative f′(a). The line is y = f(a) + f′(a) × (x − a).

The page finds the derivative by the usual rules: the sum, product, quotient, chain and power rules. It then tidies the result a little. It does not always give the shortest form.

As a check, the page also estimates the slope from four points very close to a (a central difference). If the two slopes do not agree, the page shows a warning.

  • Secant line through two points uses their change in y divided by their change in x. Enter both endpoints to get the slope, equation and y-intercept.
  • Horizontal tangent: the page looks for x-values where the derivative is 0.
  • Tangent line approximation: L(x) = f(a) + f′(a) × (x − a) is used to estimate f(x) near a.
  • Parametric curve: slope = (dy/dt) ÷ (dx/dt).
  • Polar curve: x = r cos(theta), y = r sin(theta), and then the same rule as for a parametric curve.

Worked example

Take y = x^3 − 3x at x = 2. The derivative is 3x^2 − 3. At x = 2, y = 8 − 6 = 2 and the slope is 12 − 3 = 9. The tangent line is y − 2 = 9(x − 2), which is y = 9x − 16.

The normal line at the same point has slope −1/9. It is y = −(1/9)x + 20/9.

The same curve has horizontal tangent lines where 3x^2 − 3 = 0, at x = −1 and x = 1. The lines are y = 2 and y = −2.

The tangent line at x = 2 gives the estimate 2.9 for x = 2.1. The true value is 2.961.

Limits you should know

  • The function must be written with one variable and the functions listed above. Curves given by an equation in x and y together, such as x^2 + y^2 = 25, are not supported.
  • If the function or its derivative has no real value at the point, the page says so. It does not show a huge number for a division by zero.
  • A vertical tangent line to y = f(x) is reported as a slope with no value. For parametric and polar curves, vertical tangent lines are given as x = a number.
  • Horizontal tangent points are found by testing 4,001 x-values. Two such points that lie very close together can be missed.
  • Decimal results are shown with 6 significant digits. When the function and the point use only whole numbers and fractions, the line is exact.
  • The page does not draw the curve or the line.

Related tools