Ekuation

Math

Derivative Calculator

The Derivative Calculator accepts any single-variable mathematical expression and returns the exact symbolic derivative with a step-by-step derivation showing every differentiation rule applied. Computes first through fifth-order derivatives, displays results as formatted LaTeX, and plots both f(x) and f'(x) on an interactive graph with an optional tangent line at a user-selected point.

Enter a math expression using standard notation. Use * for multiplication, ^ for exponents.

Variable of differentiation. For partial derivatives, change to y, z, etc.

Numerically evaluate f(x) and f'(x) at a specific x-value and show the tangent line.

Derivative Calculator Tips

Click to show tips

Try an Example

Pick a scenario to see how the calculator works, then adjust the values

Power Rule

Differentiate a polynomial using the power rule.

Key values: f(x) = x^3 - 2x^2 + x · 1st derivative

Chain Rule

Differentiate a composite function with sin(x^2).

Key values: f(x) = sin(x^2) · Chain rule applied

Product Rule with Tangent

Differentiate exp(x)*cos(x) and evaluate the tangent at x = 0.

Key values: f(x) = exp(x)*cos(x) · Tangent at x = 0

Second Derivative

Compute the second derivative to analyze concavity.

Key values: f(x) = x^4 - 6x^2 + 4 · 2nd derivative

Documentation

What Is a Derivative?

A derivative measures the instantaneous rate of change of a function with respect to its variable. Geometrically, the derivative at a point equals the slope of the tangent line to the function’s graph at that point.

The formal definition uses limits:

f(x)=limh0f(x+h)f(x)hf'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}

Derivatives are fundamental to calculus and appear throughout science, engineering, economics, and machine learning. They answer the question: how fast is this quantity changing right now?

How to Use This Calculator

  1. Enter an expression in the input field. Use standard math notation:x^3 - 2*x^2 + x, sin(x^2), exp(x) * cos(x).
  2. Select the variable of differentiation (default is x). Change toy, t, etc. for partial or physics-style derivatives.
  3. Choose the derivative order (1st through 5th).
  4. Click Calculate to see the symbolic derivative, step-by-step solution, and interactive graph.
  5. Optionally, enable Evaluate at a point to see the numeric value of f(x) and f'(x) at a specific x-value, along with the tangent line on the graph.

Differentiation Rules Reference

Basic Rules

RuleFormulaExample
Constantddx[c]=0\frac{d}{dx}[c] = 0ddx[5]=0\frac{d}{dx}[5] = 0
Powerddx[xn]=nxn1\frac{d}{dx}[x^n] = nx^{n-1}ddx[x3]=3x2\frac{d}{dx}[x^3] = 3x^2
Constant Multipleddx[cf(x)]=cf(x)\frac{d}{dx}[c \cdot f(x)] = c \cdot f'(x)ddx[5x2]=10x\frac{d}{dx}[5x^2] = 10x
Sum/Differenceddx[f±g]=f±g\frac{d}{dx}[f \pm g] = f' \pm g'ddx[x2+x]=2x+1\frac{d}{dx}[x^2 + x] = 2x + 1
Productddx[fg]=fg+fg\frac{d}{dx}[f \cdot g] = f'g + fg'ddx[xsin(x)]=sin(x)+xcos(x)\frac{d}{dx}[x \cdot \sin(x)] = \sin(x) + x\cos(x)
Quotientddx ⁣[fg]=fgfgg2\frac{d}{dx}\!\left[\frac{f}{g}\right] = \frac{f'g - fg'}{g^2}ddx ⁣[sin(x)x]=xcos(x)sin(x)x2\frac{d}{dx}\!\left[\frac{\sin(x)}{x}\right] = \frac{x\cos(x) - \sin(x)}{x^2}
Chainddx[f(g(x))]=f(g(x))g(x)\frac{d}{dx}[f(g(x))] = f'(g(x)) \cdot g'(x)ddx[sin(x2)]=2xcos(x2)\frac{d}{dx}[\sin(x^2)] = 2x\cos(x^2)

Trigonometric Derivatives

FunctionDerivative
sin(x)\sin(x)cos(x)\cos(x)
cos(x)\cos(x)sin(x)-\sin(x)
tan(x)\tan(x)sec2(x)\sec^2(x)
sec(x)\sec(x)sec(x)tan(x)\sec(x)\tan(x)
csc(x)\csc(x)csc(x)cot(x)-\csc(x)\cot(x)
cot(x)\cot(x)csc2(x)-\csc^2(x)

Exponential and Logarithmic Derivatives

FunctionDerivative
exe^xexe^x
bxb^xbxln(b)b^x \ln(b)
ln(x)\ln(x)1x\frac{1}{x}
logb(x)\log_b(x)1xln(b)\frac{1}{x \ln(b)}

Higher-Order Derivatives

The second derivative reveals concavity and inflection points; higher derivatives appear in Taylor series and physics (acceleration, jerk). This calculator computes up to the 5th derivative. For the full treatment of concavity tests, Taylor series connection, and physics examples, see the Higher-Order Derivative Calculator guide.

Partial Derivatives

Partial derivatives measure change with respect to one variable while holding others constant. Change the variable field to compute partials — other symbols are treated as constants automatically. For gradient vectors, Clairaut's theorem, and applications, see the Partial Derivative Calculator guide.

Real-World Examples

1. Physics: Velocity from Position

A particle’s position is given by s(t) = t3 − 3t2 + 2t meters. The velocity is the derivative: v(t) = ds/dt = 3t2 − 6t + 2 m/s. At t = 2 seconds: v(2) = 12 − 12 + 2 = 2 m/s. The acceleration is the second derivative: a(t) = 6t − 6. At t = 2: a(2) = 6 m/s2.

2. Economics: Marginal Cost

A company’s total cost function is C(q) = 0.01q2 + 5q + 100 dollars, where q is the quantity produced. The marginal cost is C'(q) = 0.02q + 5. At q = 200 units: MC = 0.02(200) + 5 = $9 per unit. This tells the company the cost of producing one additional unit.

3. Machine Learning: Gradient Descent

In machine learning, the loss function L(w) = (w − 3)2 + 2 measures model error. The gradient is dL/dw = 2(w − 3). Gradient descent updates w by moving in the opposite direction of the gradient: wnew = w − α·dL/dw. If w = 5 and α = 0.1: wnew = 5 − 0.1·4 = 4.6.

4. Engineering: Circuit Analysis

The voltage across a capacitor is V(t) = e−t·sin(2t) volts. The rate of voltage change is dV/dt = e−t(−sin(2t) + 2cos(2t)). At t = 0: dV/dt = 0 + 2 = 2 V/s.

5. Biology: Population Growth

A bacterial population follows P(t) = 100e0.1t organisms, where t is in hours. The growth rate is dP/dt = 10e0.1t. At t = 10 hours: dP/dt = 10e1 27.2 organisms/hour.

6. Optimization: Finding Extrema

To find the maximum of f(x) = −x2 + 6x − 5, set f'(x) = 0: −2x + 6 = 0, so x = 3. The second derivative f''(x) = −2 < 0, confirming a maximum. The maximum value is f(3) = −9 + 18 − 5 = 4.

Common Mistakes

  1. Forgetting the chain rule on composites. d/dx[sin(x2)] is NOT cos(x2). You must multiply by the derivative of the inner function: 2x·cos(x2).
  2. Confusing product rule with chain rule. d/dx[x·sin(x)] requires the product rule, not the chain rule. The chain rule applies to composites like sin(x2), not products.
  3. ln(x) vs log10(x). In calculus, “log” typically means natural log (base e), and its derivative is 1/x. The derivative of log10(x) is 1/(x·ln(10)).
  4. Treating constants as variables. In ∂f/∂x of f(x,y) = x2y, the y is a constant. The result is 2xy, not 2x + x2.
  5. Not simplifying before differentiating. Simplifying first can prevent errors. For example, (x2 − 1)/(x − 1) simplifies to x + 1 before differentiation, giving a cleaner derivative of 1.

Frequently Asked Questions

Is this derivative calculator free?

Yes, completely free including step-by-step solutions. Unlike Symbolab and Wolfram Alpha, there is no paywall for step-by-step derivations. No sign-up required.

What functions are supported?

All standard mathjs functions: sin, cos, tan (and their inverses), sinh, cosh, tanh (and their inverses), exp, log (natural), log10, sqrt, cbrt, abs, and any combination of these through the chain rule. Not supported: gamma, erf, and Bessel functions.

Can it handle multivariable functions?

Yes. Change the variable field to differentiate with respect to any variable. All other symbols are automatically treated as constants, computing a partial derivative.

Why does my result look unsimplified?

Algebraic simplification is inherently difficult. The calculator applies standard simplification rules, but some complex expressions may not fully reduce. The result is always mathematically correct. Try rewriting your expression in a different form for a more compact output.

What is the difference between d/dx and ∂/∂x?

d/dx denotes the ordinary derivative for single-variable functions. ∂/∂x denotes a partial derivative in multivariable context, where other variables are held constant. This calculator handles both: if your expression has only one variable, it computes d/dx; if it has multiple, it computes ∂/∂x.

Can it compute implicit derivatives?

The main calculator handles explicit functions f(x). For implicit differentiation (e.g., x2 + y2 = 1), use the partial derivative approach: compute ∂H/∂x and ∂H/∂y where H = x2 + y2 − 1, then dy/dx = −(∂H/∂x) / (∂H/∂y).

A Brief History of Derivatives

Isaac Newton and Gottfried Wilhelm Leibniz independently developed the concept of the derivative in the late 17th century. Newton called them “fluxions” and used dot notation, while Leibniz introduced the dy/dx notation still used today. Their work laid the foundation for calculus, enabling advances in physics, engineering, and economics that continue to shape modern science and technology.


References

  • OpenStax. “Differentiation Rules.” Calculus Volume 1, Section 3.3. https://openstax.org/books/calculus-volume-1/pages/3-3-differentiation-rules
  • Wikipedia. “Derivative.” https://en.wikipedia.org/wiki/Derivative
  • Mathematics LibreTexts (OpenStax). “The Chain Rule.” Section 3.6. https://math.libretexts.org/Bookshelves/Calculus/Calculus_(OpenStax)/03%3A_Derivatives/3.06%3A_The_Chain_Rule
  • Mathematics LibreTexts (OpenStax). “Derivatives of Exponential and Logarithmic Functions.” Section 3.9. https://math.libretexts.org/Bookshelves/Calculus/Calculus_(OpenStax)/03%3A_Derivatives/3.09%3A_Derivatives_of_Exponential_and_Logarithmic_Functions
  • Abelson, H. & Sussman, G.J. Structure and Interpretation of Computer Programs (SICP), MIT Press. “Symbolic Differentiation.” §2.3.2.

Disclaimer

This calculator is provided for educational and informational purposes only. While the symbolic computation engine (mathjs) is well-tested, results should be verified for critical applications. The simplification algorithm may not always produce the most compact form of the derivative. For professional or research use, consult a full computer algebra system such as Mathematica, Maple, or SageMath.

Specialized Calculators

Choose from 4 specialized versions of this calculator, each optimized for specific use cases and calculation methods.

Related Calculators

6 Calculators

More Math calculators

Calculator Search

Search and find calculators