Derivative Calculator
Check your function in the derivative calculator, with rule steps, a graph and derivatives up to fifth order.
Math keyboard
Examples
This is the selected derivative. Evaluate it at a point below, or follow the rule steps.
See worked chain-rule examplesParsed function
Check the original domain: a simplified formula can still have excluded points.
Rule steps
Evaluate at
Change the point or add values for other variables.
Tangent line—
The secant uses a+h; the centered slope uses a−h and a+h.
Function, derivative and slope graph
Drag to pan, use the buttons to zoom, or toggle individual lines.
Point samples
| x | Function value | First derivative / tangent slope | Selected derivative value |
|---|
History
Calculations stay in this browser. History is saved only after you choose Save; device storage is optional.
How do I check the function before differentiating?
Missing parentheses can change your derivative calculator result. I check the parsed expression first: grouping determines the power, quotient or trigonometric argument. Enter a function, choose the variable and select an order from one to five. The result, rule steps and graph are calculated locally in your browser. Move the slider beside the answer to slide the tangent along the curve; its point and slope update the values below.
The starting function is a labelled example, x^3 − 3*x. Replace it with your expression, or choose another example. The mathematics keyboard inserts ordinary text; it does not guess missing arguments. Editing the function clears the previous derivative and disables exports until you differentiate again. That prevents a valid-looking answer from being attached to an unfinished expression.
I keep the original function beside its derivative because simplification can hide important restrictions. For x/x, the displayed derivative is zero wherever the original quotient exists. At x = 0, the original function is undefined, so the point values and graph retain that hole. A simplified answer does not grant permission to evaluate the original function at every real number.
How do I enter a function in the derivative calculator?
Write powers with ^, multiplication with * and division with /. Implicit products such as 2x and 2(x+1) are accepted. I still prefer explicit multiplication when checking a long expression. Adjacent single-letter variables need a separator: write x*y rather than xy. Functions need parentheses, so sin(x) is accepted while sin x is rejected. Decimal coefficients in the function accept a point or comma, such as 1.5*x or 1,5*x. The point, interval, graph bounds and parameter fields accept either a decimal point or comma.
Exponentiation takes priority over a leading minus. Therefore −x^2 means −(x^2), with derivative −2*x. In contrast, (−x)^2 has derivative 2*x. Powers associate to the right: x^2^3 means x^(2^3), not (x^2)^3. Signed exponents are supported, including x^−2. The parsed-function panel shows these choices with explicit grouping rather than asking you to remember the precedence silently.
Angles are radians. Both ln and log mean the natural logarithm in this tool; use log10 for base ten. Constants pi and e are available, and scientific notation such as 1e-7 keeps small decimal coefficients exact during symbolic calculation. A decimal is converted to a rational coefficient rather than rounded to a few places. Numerical point values and plotted coordinates still use floating-point arithmetic.
Which rules do I use to find a derivative?
| Function | Derivative | Where it applies |
|---|---|---|
| c | 0 | All real x |
| x^n | n*x^(n−1) | Depends on n |
| sin(x) | cos(x) | All real x |
| cos(x) | −sin(x) | All real x |
| exp(x) | exp(x) | All real x |
| ln(x) | 1/x | x > 0 |
| log10(x) | 1/(x*ln(10)) | x > 0 |
| sqrt(x) | 1/(2*sqrt(x)) | x > 0 |
The power rule differentiates x^n to n*x^(n−1), subject to the domain of the expression. For a composite power u(x)^n, that result must be multiplied by u′(x). I read the chain rule as an instruction to account for every inner change. It applies to sin(x^2), ln(x^2+1) and sqrt(3*x+1), as well as to more deeply nested expressions.
A product needs both terms: (u*v)′ = u′*v + u*v′. A quotient needs (u′*v − u*v′)/v^2 and requires a nonzero denominator. The steps panel identifies these rules and displays the expression before and after each application. For higher derivatives, the order number marks the stage.
Other variables are held constant during symbolic differentiation. If you differentiate x^2*y with respect to x, the answer is 2*x*y. To evaluate at x = 2 with y = 3, enter y=3 in the parameter field; the slope is 12. Missing parameter values are reported explicitly. The tool never assigns zero to an unspecified variable merely to produce a graph.
How do I find the tangent line and secant slope?
At a valid point a, the tangent slope is the first derivative f′(a). The line has equation y = f(a) + f′(a)*(x−a). Selecting the second or fifth derivative does not change this definition: the tangent always uses the first derivative. The selected derivative has its own value card and graph line, so curvature information is not accidentally described as a slope.
A forward secant uses a second point a+h: its slope is (f(a+h)−f(a))/h. The centered numerical slope uses (f(a+h)−f(a−h))/(2*h). For x^2 at a = 2 and h = 0.1, f(a) = 4, the tangent slope is 4, the forward secant is 4.1 and the centered value is 4. The tangent equation becomes y = 4 + 4*(x−2), or 4*x−4.
For the starting cubic at a = 1, f(a) = −2 and f′(a) = 0. With h = 0.1, the forward secant is 0.31 and the centered estimate is 0.01. Neither is exactly the derivative. I compare several reasonable intervals rather than treating one numerical agreement as proof. Very small intervals can amplify subtraction error; an interval crossing a domain boundary can make the comparison meaningless.
Where is the derivative defined?
Logarithms require positive real arguments; a real square root requires a nonnegative argument. The derivative of sqrt(x) is unavailable at zero even though the function value exists there. For abs(x), the derivative is −1 on the negative side and 1 on the positive side, with no derivative at the cusp x = 0. For sqrt(x^4), the real identity x^2 is applied before differentiation, so the first derivative at zero is 0 and the second is 2. The steps show this identity; sqrt(x^2) remains abs(x), with its cusp at zero.
Nested powers need care. The real expression (x^2)^0.5 is abs(x), not x. At x = −2 its derivative is −1, so flattening the nested powers would give the wrong answer. Negative bases with noninteger exponents are not evaluated by this engine as real roots, even when a special rational exponent could admit a real interpretation. Rewrite such a problem deliberately and check the intended domain separately.
An unavailable value can also reflect a removable exception in an intermediate derivative formula. The tool checks the original expression and all preceding derivative stages before a numerical value is accepted. This conservative check is useful, but it is not a theorem proving nondifferentiability. Tan values with |cos(argument)| below 10^−14 are treated as unavailable to avoid drawing through numerical approximations to poles.
How do I use the graph and save my calculation?
The solid violet curve represents the function; the dashed violet curve represents the selected derivative. Toggle each curve, the gold tangent and the dotted secant independently. Zoom with the buttons or wheel, drag to pan, and pinch on touch screens. The graph uses a bounded set of samples and breaks detected gaps and steep jumps. It is not an exhaustive singularity detector, and the vertical range may crop extreme values near poles.
Six nearby point samples provide a text alternative to the picture and can be downloaded as CSV. Download PNG captures the current graph. Copy result includes the function, variable, derivative order, point values and limitations; Copy LaTeX copies the symbolic derivative. Printing keeps the result readable. Save calculation adds an entry to this tab; only the separate device-storage checkbox makes saved entries persist after closing it.
Expression length is limited to 500 characters, with additional token, tree-depth and rational-coefficient guards. Point magnitudes cannot exceed 1,000,000; h must be between 0.00000001 and 100. These are software limits, not mathematical limits on differentiation. I reject a malformed or excessively large expression rather than returning an incomplete answer. No calculation or history entry is sent to a server.
What are the derivatives of these example functions?
The following cases check independent behaviours: precedence, exact coefficients, composite differentiation and the distinction between a formula and a point value. I evaluate the original expression before comparing numerical derivatives. The point samples help compare exact derivatives with nearby numerical slopes.
The standard power, product, quotient and chain rules follow the treatment in OpenStax Calculus: the chain rule. Its exponential and logarithmic derivatives section explains the logarithm convention and chain factors. For expression grouping, read Chain rule and parentheses. For numerical slopes and holes, read Tangents, secants and real-domain restrictions.
| Expression | Point / order | Expected derivative value |
|---|---|---|
| −x^2 | x = 2 | −4 |
| x/3 | x = 2 | 1/3 |
| sin(x^2) | x = 0.5 | cos(0.25) ≈ 0.9689124217 |
| (x^2)^0.5 | x = −2 | −1 |
| x/x | x = 0 | Unavailable |
| x^5, fifth derivative | x = 2 | 120 |
Which functions and derivative orders are supported?
Enter sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, ln, log, log10, exp, sqrt or abs with an argument in parentheses. Arcsin, arccos and arctan are accepted aliases. The selected variable is x, y, t or z; other single-letter symbols act as constants. This calculator supports explicit functions, not equations with an equals sign, implicit differentiation or mixed partial derivatives.
Quick answers
Can I calculate higher derivatives?
Yes. Select an order from one to five. The tangent continues to use the first derivative; the selected derivative is shown separately.
Does log mean base ten?
No. Both log and ln are natural logarithms here. Enter log10(x) for a base-ten logarithm.
Why is a derivative value unavailable?
The original expression or a relevant derivative formula may be undefined there, or a parameter is missing. Some formula exceptions are removable; the tool does not prove differentiability.
Can other variables appear in the function?
Yes. They are held constant during differentiation. Assign their numerical values explicitly before evaluating points or plotting.
Is my function saved automatically?
No. History requires Save calculation. Persistence on this device is a separate optional choice.
Guides
Updated