Derivative Calculator: Compute Derivatives Step by Step
Derivatives are a cornerstone of calculus, measuring the rate at which a function changes. Whether you're a student learning calculus, an engineer analyzing systems, or a researcher modeling data, our Derivative Calculator computes derivatives of mathematical functions and shows the step-by-step solution using standard differentiation rules. Use our Derivative Calculator to estimate your costs.
What Is a Derivative?
The derivative of a function at a point represents the slope of the tangent line at that point. Geometrically, it measures how steep the function is. Physically, it represents the rate of change: velocity is the derivative of position with respect to time, acceleration is the derivative of velocity, and marginal cost is the derivative of total cost with respect to quantity.
The calculator supports differentiation rules including: power rule (d/dx x^n = nx^(n-1)), product rule (d/dx (uv) = u'v + uv'), quotient rule (d/dx (u/v) = (u'v - uv')/v²), chain rule (d/dx f(g(x)) = f'(g(x)) × g'(x)), and trigonometric, exponential, and logarithmic derivatives.
Using the Derivative Calculator
Enter your function using standard mathematical notation. Use x as the variable. Supported operations include +, -, *, /, ^ (power), sqrt(), sin(), cos(), tan(), log(), ln(), exp(). The calculator shows the derivative and a step-by-step breakdown of each differentiation rule applied.
You can also evaluate the derivative at a specific point by entering an x value. The calculator computes the instantaneous rate of change at that point and shows the equation of the tangent line.
Differentiation Rules
Power Rule
The most commonly used rule: d/dx (x^n) = n × x^(n-1). For example, d/dx (x^5) = 5x^4, and d/dx (1/x) = d/dx (x^(-1)) = -x^(-2) = -1/x².
Product Rule
Used when two functions are multiplied: d/dx (f(x) × g(x)) = f'(x)g(x) + f(x)g'(x). Example: d/dx (x² × sin(x)) = 2x sin(x) + x² cos(x).
Chain Rule
Used for composed functions: d/dx (f(g(x))) = f'(g(x)) × g'(x). Example: d/dx (sin(x²)) = cos(x²) × 2x. The chain rule is essential for differentiating any function inside another function.
Trigonometric Derivatives
d/dx sin(x) = cos(x), d/dx cos(x) = -sin(x), d/dx tan(x) = sec²(x), d/dx sec(x) = sec(x)tan(x).
Applications of Derivatives
- Optimization: Find maximum and minimum values by setting derivative to zero. Used in business for profit maximization and cost minimization.
- Physics: Velocity and acceleration are derivatives of position. Force is the derivative of potential energy.
- Economics: Marginal cost, marginal revenue, and elasticity of demand are all derivative-based concepts.
- Engineering: Rates of change in electrical circuits, fluid dynamics, and structural analysis all rely on derivatives.
- Machine learning: Gradient descent, the core optimization algorithm in neural networks, uses derivatives to minimize loss functions.
Real-World Example
A company's profit function is P(x) = -2x² + 100x - 500, where x is the number of units produced:
- Derivative: P'(x) = -4x + 100 (marginal profit)
- Maximum profit occurs at P'(x) = 0: -4x + 100 = 0, x = 25 units
- Maximum profit: P(25) = -2(25)² + 100(25) - 500 = -1,250 + 2,500 - 500 = $750
- At x=25, derivative P'(25) = 0 — each additional unit neither increases nor decreases profit
If the company currently produces 20 units, P'(20) = 20 > 0, meaning increasing production by 1 unit increases profit by approximately $20.
Start Calculating
Use our Derivative Calculator below to compute derivatives and understand rates of change. Also check our Integral Calculator for integration and our Graphing Calculator for visualizing functions.
Worked Examples: Central vs Forward Difference
The calculator evaluates your function at neighboring points and divides by the step size. With central difference it uses f(x+h) and f(x-h) over a span of 2h, while forward difference uses f(x+h) and f(x) over a span of h. The classic example f(x) = x³ at x = 2 with h = 0.001 shows both methods clearly. The function values are f(2) = 8, f(2.001) = 8.012006, and f(1.999) = 7.988006. The central difference is (8.012006 minus 7.988006) divided by 0.002, or 12.000001 — effectively the exact answer, since the true derivative 3x² equals 12 at x = 2. The forward difference is (8.012006 minus 8) divided by 0.001, or 12.006, which overshoots by 0.006 because it samples only one side of the point.
A second example shows the pattern is general. For f(x) = e^x at x = 0 with h = 0.001, the values are f(0) = 1, f(0.001) = 1.0010005, and f(-0.001) = 0.9990005. The central difference gives (1.0010005 minus 0.9990005) divided by 0.002, about 1.0000002, matching the exact derivative e^0 = 1. The forward difference gives (1.0010005 minus 1) divided by 0.001, about 1.0005 — a small error that grows with h.
How to get reliable results:
- Choose the step size deliberately. Too large and the approximation error grows with h; too small and floating-point rounding starts to dominate. A value near 0.001 is a good starting point for most functions.
- Prefer central difference when you need accuracy. It is second-order accurate, so its error shrinks like h², while forward difference error shrinks only like h — roughly ten times slower for a typical step size.
- Verify against a known derivative. For x³ the exact derivative 3x² is easy to check by hand, so comparing the numerical output to the analytic answer builds confidence in both the method and your expression syntax.
- Watch your syntax. The calculator reads ^ for powers and * for multiplication, so "2*x^3 + sin(x)" works while "2x^3 + sin x" does not.
Related Calculators
Use our Derivative Calculator Guide together with related tools such as Area Calculator, Combination Calculator, Derivative Calculator to plan more accurately. Each calculator runs instantly in your browser with step-by-step guidance.
Written by the CalcMaster Pro Editorial Team — financial, health, and DIY tools reviewed for accuracy. All calculators run on standard, widely accepted formulas. Always confirm final numbers with a qualified professional for decisions that require official figures.