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
Check these values
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.
Your result
How it was worked out
How to use this calculator
- Choose what you want, for example Tangent line to y = f(x) at a point.
- Type the function with
xas the variable, for examplex^3 - 3xorsin(x). - Type the x-value of the point. You can use a number, a fraction such as
1/2, or a value such aspi/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. 2xand3(x + 1)mean multiplication.x^2is x squared.- Functions:
sin,cos,tan,asin,acos,atan,sqrt,abs,ln,log,exp. They need brackets:sin(x), notsin x. You can also typesec,cscandcot. - Constants:
piande. Soe^xandexp(x)are the same. - Angles are in radians.
lnis the natural logarithm.logis the logarithm to base 10. - A power applies before a minus sign:
-x^2means −(x²).1/2xis 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.