Derivative Calculator
Enter f(x) and a point x = a to get f′(a), f(a), the tangent line and its graph, plus the formula for f′(x). Flags corners, jumps and vertical tangents. How it works
Use the Derivative Calculator
About the Derivative Calculator
The derivative of x³ at x = 2 is 12, and the tangent line there is y = 12x − 16. This derivative calculator estimates f′(a) for a function of x at the point you choose, gives f(a) and the tangent line, and says when no derivative exists, as for abs(x) at 0. It also writes the formula f′(x), such as 3 * x ^ 2 for x^3, and draws f with its tangent.
Derivatives at a point
| f(x) as typed | At x = | Rule | Exact f′(a) | Tool shows | Tangent line |
|---|---|---|---|---|---|
| x^2 | 3 | d/dx xⁿ = n·xⁿ⁻¹ | 6 | 6 | y = 6x - 9 |
| x^3 | 2 | d/dx xⁿ = n·xⁿ⁻¹ | 12 | 12 | y = 12x - 16 |
| 3x^2 + 2x - 5 | 2 | 6x + 2 | 14 | 14 | y = 14x - 17 |
| sin(x) | 0 | cos x | 1 | 1 | y = x |
| cos(x) | 1 | −sin x | −sin 1 | -0.841471 | y = -0.841471x + 1.38177 |
| exp(x) | 1 | eˣ | e | 2.71828 | y = 2.71828x |
| log(x) | 2 | 1/x | 1/2 | 0.5 | y = 0.5x - 0.306853 |
| sqrt(x) | 4 | 1/(2√x) | 1/4 | 0.25 | y = 0.25x + 1 |
| 1/x | 2 | −1/x² | −1/4 | -0.25 | y = -0.25x + 1 |
| 2^x | 3 | 2ˣ·ln 2 | 8 ln 2 | 5.54518 | y = 5.54518x - 8.63553 |
| sin(x)^2 | 1 | 2 sin x cos x | sin 2 | 0.909297 | y = 0.909297x - 0.201224 |
| x^2*sin(x) | 2 | 2x sin x + x² cos x | 4 sin 2 + 4 cos 2 | 1.9726 | y = 1.9726x - 0.308015 |
| exp(x) | -18.5 | eˣ | e^-18.5 | 9.23745 × 10^-9 | y = (9.23745 × 10^-9)·x + 1.8013 × 10^-7 |
| x^2 | -1e-9 | 2x | -2 × 10^-9 | -2 × 10^-9 | y = (-2 × 10^-9)·x - 1 × 10^-18 |
For every row the tool says the slope is accurate to the 6 significant digits shown. log(x) is the natural logarithm, and angles are in radians.
Points with no derivative, and what the tool says
| f(x) as typed | At x = | Tool says |
|---|---|---|
| abs(x) | 0 | The slope from the left (about -1) and the slope from the right (about 1) are different, so f has a corner here and no derivative. |
| floor(x) | 1 | f is not continuous at x = 1: the values just beside the point do not approach f(1) (a jump or a gap), so there is no derivative here. |
| sign(x) | 0 | f is not continuous at x = 0: the values just beside the point do not approach f(0) (a jump or a gap), so there is no derivative here. |
| 1/x | 0 | f is not a finite real number at x = 0 (it is undefined, infinite, or too large to store there), so it has no derivative at this point. |
| cbrt(x) | 0 | The slope grows without bound as the step shrinks (a vertical tangent), so there is no finite derivative here. |
| sqrt(abs(x)) | 0 | The slope goes to +∞ on one side and −∞ on the other (a cusp), so there is no finite derivative here. |
| sqrt(x) | 0 | f has no real value just left of x = 0, so a two-sided derivative does not exist there. |
Where the tool cannot decide
| f(x) as typed | At x = | Correct answer |
|---|---|---|
| 1/(x^2+1e-16) | 0 | 0 |
| sqrt(x^2+1e-20) | 0 | 0 |
| x+1e-9*sign(x) | 0 | No derivative (a jump) |
| sin(x) | 1e14 | cos(10^14) |
For each row the tool shows Cannot decide and asks you to check by hand. The first three have features far smaller than the steps it samples; at 1e14 the nearest numbers a computer can store are too far apart to follow sin.
Frequently asked questions
- How do you find the derivative at a point step by step?
- Differentiate, then substitute. For f(x) = 3x² + 2x − 5, f′(x) = 6x + 2, so f′(2) = 14. The tool writes the formula, f′(x) = 6 * x + 2, but not the rule-by-rule steps: type 3x^2 + 2x - 5 and 2 and it shows 14, with f(2) = 11.
- How do you find the equation of the tangent line?
- Use y = f′(a)(x − a) + f(a). For x² at a = 1, f(1) = 1 and f′(1) = 2, so y = 2(x − 1) + 1 = 2x − 1. The tool shows this line under the result.
- Does it give the derivative formula f′(x)?
- Yes, where the rules cover the function: x^2 gives 2 * x, ln(x) gives 1 / x and sin(x)^2 gives 2 * cos(x) * sin(x). floor, sign and similar functions have no rule, so only the number at the point appears. To see how f′ changes, try several points: x^3 gives 12 at x = 2 and 27 at x = 3, which matches f′(x) = 3x².
- Why does it say there is no derivative?
- Because the slopes from the left and the right differ (a corner: abs(x) at 0, about -1 and 1), f jumps (floor(x) at 1, sign(x) at 0), f is undefined there (1/x at 0), the slope grows without bound (a vertical tangent: cbrt(x) at 0; a cusp: sqrt(abs(x)) at 0), or f has no real values on one side (sqrt(x) at 0). When the slope estimates never settle, it says it cannot decide instead.
- How accurate is the numerical derivative?
- The slope comes with an error estimate, and the tool prints only the digits that estimate supports, at most 6, with a sentence saying how many. exp(x) at 10 shows 22026.5, accurate to the 6 digits shown. Far from 0 fewer digits survive: x at 1,000,000,000,000 shows 1 with only 4 digits supported, and sin(x) there shows 0.79145. Small slopes keep their size: x^2 at -1e-9 shows -2 × 10^-9. A slope is shown as 0 only when it is no larger than ten times its error estimate, and the tool then says it cannot tell 0 from a smaller slope.
- What functions and syntax can I type?
- Use x as the variable with + - * / ^ and brackets; 2x is read as 2*x. Functions include sin, cos, tan and their inverses, sinh, cosh, tanh, exp, log (natural), log10, log2, sqrt, cbrt, abs, floor and ceil, with the constants pi and e. Trigonometric functions take radians.
Related Tools
View all toolsSlope Calculator
Enter two points for the slope (also as a fraction), y-intercept, distance, angle and line equation, or find a missing coordinate from a point and a slope.
Integral Calculator
Enter f(x) and the limits a and b to get the definite integral as a number, by Simpson's rule with 1,000 intervals. Net signed area, no antiderivative.
Limit Calculator
Limit of f(x) as x approaches a number, +∞ or −∞: f(c) where f is continuous, otherwise an estimate from samples. Shows one-sided limits, ±∞ and jumps.
Midpoint Calculator
Midpoint of two points in 2D or 3D by ((x₁ + x₂)/2, (y₁ + y₂)/2), or a missing end point by B = 2M − A, with the working shown and exact sums.
Linear Regression Calculator
Least-squares line y = mx + b for your (x, y) data, with Pearson r, R², the number of points used and predictions of y from x or x from y.
Logarithm Calculator
Log of a positive number to base 10, base 2, base e (ln) or any base above 0 except 1, shown to 10 significant digits.