Skip to main content
CalcChef

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

A number, or a constant such as pi/2, e or 1/3

Derivative at x = 1
f'(1) ≈ 2

Value of f at this point
f(1) = 1
Tangent line
y = 2x - 1

The slope is accurate to the 6 significant digits shown.

Working out the formula for f'(x)…

-0.52.56.8-0.5
Solid line: f(x). Dashed line: the tangent at x = 1.

Numerical estimate: slopes on both sides of the point are worked out at smaller and smaller steps and extrapolated to a step of zero, after checking that f is continuous there and that the two sides agree. Shown to at most 6 significant digits, fewer when the error estimate supports fewer; a slope is shown as 0 only when it is no larger than ten times its error estimate.

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 typedAt x =RuleExact f′(a)Tool showsTangent line
x^23d/dx xⁿ = n·xⁿ⁻¹66y = 6x - 9
x^32d/dx xⁿ = n·xⁿ⁻¹1212y = 12x - 16
3x^2 + 2x - 526x + 21414y = 14x - 17
sin(x)0cos x11y = x
cos(x)1−sin x−sin 1-0.841471y = -0.841471x + 1.38177
exp(x)1eˣe2.71828y = 2.71828x
log(x)21/x1/20.5y = 0.5x - 0.306853
sqrt(x)41/(2√x)1/40.25y = 0.25x + 1
1/x2−1/x²−1/4-0.25y = -0.25x + 1
2^x32ˣ·ln 28 ln 25.54518y = 5.54518x - 8.63553
sin(x)^212 sin x cos xsin 20.909297y = 0.909297x - 0.201224
x^2*sin(x)22x sin x + x² cos x4 sin 2 + 4 cos 21.9726y = 1.9726x - 0.308015
exp(x)-18.5eˣe^-18.59.23745 × 10^-9y = (9.23745 × 10^-9)·x + 1.8013 × 10^-7
x^2-1e-92x-2 × 10^-9-2 × 10^-9y = (-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 typedAt x =Tool says
abs(x)0The 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)1f 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)0f 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/x0f 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)0The slope grows without bound as the step shrinks (a vertical tangent), so there is no finite derivative here.
sqrt(abs(x))0The slope goes to +∞ on one side and −∞ on the other (a cusp), so there is no finite derivative here.
sqrt(x)0f 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 typedAt x =Correct answer
1/(x^2+1e-16)00
sqrt(x^2+1e-20)00
x+1e-9*sign(x)0No derivative (a jump)
sin(x)1e14cos(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 tools