Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Derivative Calculator

See which differentiation rule applies at each stage, from the outermost operation inward.

Examples

About the Derivative Calculator

The derivative f′(x)f'(x) measures the instantaneous rate of change of ff: the slope of the tangent line at each point. It is built from a small set of rules applied to the structure of the expression.

This calculator parses your function into a tree, applies the matching rule at every node and records it as a step. The result is simplified and then cross-checked against an independent differentiator at several sample points before it is shown.

Choose an order up to the fifth derivative, and optionally a value of x at which to evaluate the result.

What is a derivative, really?

The derivative of a function measures how fast its output changes as its input changes. Geometrically it is the slope of the tangent line, the straight line that just touches the graph at a point and points in the same direction as the curve there. For a straight line the slope is the same everywhere, but for a curve such as y=x2y = x^2 it changes from point to point, so the derivative is itself a function: ddxx2=2x\frac{d}{dx}x^2 = 2x says the slope is 2 at x=1x = 1, 6 at x=3x = 3 and −4-4 at x=−2x = -2.

Formally the derivative is a limit of difference quotients, f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h}. The quotient is the slope of a secant line through two nearby points on the graph, and letting hh shrink to zero turns the secant into the tangent. Computing that limit directly every time would be slow, so in practice derivatives are found with a small set of rules that were each proved once from the limit definition. The calculator applies exactly those rules and shows which one is used at each step.

Derivatives appear wherever rates matter: velocity is the derivative of position, acceleration is the derivative of velocity, marginal cost is the derivative of total cost, and the rate of a chemical reaction is the derivative of a concentration.

This calculator handles derivatives with respect to xx. For functions of several variables use the partial derivative calculator, and for equations that mix xx and yy use implicit differentiation.

How to use the Derivative Calculator

  1. Enter the function of x, for example x^2 sin(x) or e^(3x)/x. You can also type d/dx in front.
  2. Choose the order: first, second, up to fifth derivative.
  3. Optionally enter a value of x to evaluate the derivative there, then press Differentiate.

Formulas

Power rule

ddxxn=nxn−1\frac{d}{dx}x^n = n x^{n-1}

Product rule

(uv)′=u′v+uv′(uv)' = u'v + uv'

Quotient rule

(uv)′=u′v−uv′v2\left(\frac{u}{v}\right)' = \frac{u'v - uv'}{v^2}

Chain rule

ddxf(g(x))=f′(g(x))⋅g′(x)\frac{d}{dx}f(g(x)) = f'(g(x))\cdot g'(x)

Common derivatives

(sin⁡x)′=cos⁡x, (ex)′=ex, (ln⁡x)′=1x(\sin x)' = \cos x,\ (e^x)' = e^x,\ (\ln x)' = \frac1x

Worked example: x² sin(x)

The worked example differentiates f(x)=x2sin⁡xf(x) = x^2 \sin x. The function is a product of u=x2u = x^2 and v=sin⁡xv = \sin x, so the calculator applies the product rule (uv)′=u′v+uv′(uv)' = u'v + uv'. It finds u′=2xu' = 2x with the power rule and v′=cos⁡xv' = \cos x from the standard trigonometric derivatives, then combines them into f′(x)=2xsin⁡x+x2cos⁡xf'(x) = 2x \sin x + x^2 \cos x. The answer is then compared numerically with a difference quotient at several points to confirm it.

The solution below is generated by the same engine that powers the calculator above.

Final answer

f′(x)=2xsin⁡(x)+x2cos⁡(x)f'(x) = 2x \sin\left( x\right)+{x}^{2} \cos\left( x\right)

How we read your problem

Find the derivative of x² sin(x) with respect to x.

ddx[x2sin⁡(x)]\frac{d}{dx}\left[{x}^{2} \sin\left( x\right)\right]

Step-by-step solution

  1. Product rule: (uv)′ = u′v + uv′

    ddx[x2sin⁡(x)]=2xsin⁡(x)+x2cos⁡(x)\frac{d}{dx}\left[{x}^{2} \sin\left( x\right)\right] = 2x \sin\left( x\right)+{x}^{2} \cos\left( x\right)
  2. d/dx[sin x] = cos x

    ddx[sin⁡(x)]=cos⁡(x)\frac{d}{dx}\left[\sin\left( x\right)\right] = \cos\left( x\right)
  3. Power rule: d/dx[xⁿ] = n·xⁿ⁻¹

    ddx[x2]=2x\frac{d}{dx}\left[{x}^{2}\right] = 2x
  4. Combine and simplify

    f′(x)=2xsin⁡(x)+x2cos⁡(x)f'(x) = 2x \sin\left( x\right)+{x}^{2} \cos\left( x\right)

Formulas used

  • Power rule

    ddxxn=nxn−1\frac{d}{dx}x^n = n x^{n-1}
  • Product rule

    (uv)′=u′v+uv′(uv)' = u'v + uv'

The derivative is built from the outside in: sums split into terms, constants factor out, products and quotients use their rules, and every composite function multiplies by the derivative of its inside (chain rule).

Verification

  • Cross-checked numerically against an independent symbolic differentiator at 8 sample points ✓

Detailed explanation

The core rules

Almost every derivative you meet in a first course comes from a handful of rules. The power rule gives ddxxn=nxn−1\frac{d}{dx}x^n = nx^{n-1} for any real nn, which covers roots too, since x=x1/2\sqrt{x} = x^{1/2} has derivative 12x\frac{1}{2\sqrt{x}}. The constant multiple and sum rules let you differentiate a polynomial term by term. The exponential rule says exe^x is its own derivative, and the logarithm rule gives ddxln⁡x=1x\frac{d}{dx}\ln x = \frac1x. The six trigonometric functions each have a standard derivative, beginning with ddxsin⁡x=cos⁡x\frac{d}{dx}\sin x = \cos x and ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin x.

Those basic derivatives are combined with three structural rules. The product rule handles f⋅gf \cdot g, the quotient rule handles fg\frac{f}{g}, and the chain rule handles a function inside another function. Recognising which structure you are looking at is most of the work, and it is why the calculator names the rule in each step title.

The chain rule in practice

The chain rule says that if y=f(g(x))y = f(g(x)) then y′=f′(g(x))⋅g′(x)y' = f'(g(x)) \cdot g'(x): differentiate the outer function, leave the inside alone, then multiply by the derivative of the inside. For sin⁡(x2)\sin(x^2) the outer function is sine and the inside is x2x^2, so the derivative is cos⁡(x2)⋅2x\cos(x^2) \cdot 2x. The calculator writes this as 2cos⁡(x2) x2\cos(x^2)\,x, which is the same expression with the factors in a different order.

The chain rule also hides inside other rules. In e3xe^{3x} the inside is 3x3x, so the derivative is 3e3x3e^{3x}, and the calculator labels this step the exponential rule with eu⋅u′e^u \cdot u'. Missing the factor from the inside function is the single most common derivative error, and comparing your result with the calculator's step for the inner function is the fastest way to find it.

Quotients and simplification

For a quotient uv\frac{u}{v} the rule is u′v−uv′v2\frac{u'v - uv'}{v^2}. The order in the numerator matters because subtraction is not commutative. Differentiating e3xx\frac{e^{3x}}{x} gives 3e3x⋅x−e3xx2\frac{3e^{3x} \cdot x - e^{3x}}{x^2}, which the calculator simplifies to (3x−1x2)e3x\left(\frac3x - \frac{1}{x^2}\right)e^{3x}. Both forms are correct, and so is e3x(3x−1)x2\frac{e^{3x}(3x - 1)}{x^2}. When your answer looks different from the one shown, plug a value such as x=1x = 1 into both; equal values at several points are strong evidence that the expressions are equivalent.

Higher derivatives and evaluating at a point

Differentiating again gives the second derivative, which measures how the slope itself is changing. A positive second derivative means the graph is concave up, bending like a cup, and a negative one means concave down. For f(x)=x3f(x) = x^3 the first derivative is 3x23x^2 and the second is 6x6x; evaluating at x=2x = 2 gives f′′(2)=12f''(2) = 12. In physics, if x3x^3 were a position, 12 would be the acceleration at time 2.

Evaluating the first derivative at a point gives the slope of the tangent line there, and with the point itself you can write the tangent line in point-slope form. This is the basis of linear approximation and of Newton's method for solving equations.

Using derivatives to find maxima and minima

A smooth function can only reach a local maximum or minimum where its derivative is zero or undefined, because at the top of a hill or the bottom of a valley the tangent line is horizontal. To optimise a function, differentiate it, set f′(x)=0f'(x) = 0, solve for xx, and test each candidate. For f(x)=x3−3xf(x) = x^3 - 3x the derivative is 3x2−33x^2 - 3, which is zero at x=−1x = -1 and x=1x = 1. The second derivative 6x6x is negative at −1-1 and positive at 11, so the graph has a local maximum at (−1,2)(-1, 2) and a local minimum at (1,−2)(1, -2).

On a closed interval the largest and smallest values can also occur at the endpoints, so compare the function there as well. Many applied problems, such as minimising material for a box of fixed volume, follow exactly this pattern once the quantity to optimise has been written as a function of one variable.

How the calculator checks its answer

Symbolic differentiation can go wrong in subtle ways, especially during simplification, so the result is not simply trusted. The calculator evaluates its derivative at a set of sample points and compares it with a central difference quotient, f(x+h)−f(x−h)2h\frac{f(x + h) - f(x - h)}{2h} for a small hh, computed directly from your original function. If the two agree to within a tight tolerance at every point where the function is defined, the check passes and is listed under the answer. You can use the same idea by hand with a calculator: pick a value of xx, nudge it slightly up and down, and see whether the change in ff divided by the change in xx matches your derivative.

Common mistakes

  • Forgetting the inner derivative in the chain rule: (sin⁡3x)′=3cos⁡3x(\sin 3x)' = 3\cos 3x, not cos⁡3x\cos 3x.
  • Writing (uv)′=u′v′(uv)' = u'v'; the product rule has two terms.
  • Reversing the order of the numerator in the quotient rule.
  • Applying the power rule to axa^x; exponentials need (ax)′=axln⁡a(a^x)' = a^x \ln a.
  • Writing (uv)′=u′v′(uv)' = u'v'; the derivative of a product is not the product of the derivatives.
  • Treating a constant such as π\pi or e2e^2 as a variable and differentiating it.

Tips

  • Rewrite roots and reciprocals as powers: x=x1/2\sqrt{x} = x^{1/2}, 1x2=x−2\frac1{x^2} = x^{-2}.
  • Identify the last operation in the expression; that tells you which rule to use first.
  • Use logarithmic differentiation for functions like xxx^x.
  • Rewrite roots and reciprocals as powers before differentiating: 1x3=x−3\frac{1}{x^3} = x^{-3}.
  • Use the quotient rule only when the denominator contains xx; x25\frac{x^2}{5} is just 15x2\frac15x^2.
  • Simplify the function before differentiating when you can; x3+xx\frac{x^3 + x}{x} is simply x2+1x^2 + 1 for x≠0x \ne 0.

Frequently asked questions

What is a derivative?

It is the rate at which a function changes with respect to its variable, equal to the slope of the tangent line: f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x) = \lim_{h \to 0}\frac{f(x+h) - f(x)}{h}.

Which functions can I differentiate?

Polynomials, powers and roots, exponentials, logarithms, trigonometric and inverse trigonometric functions, hyperbolic functions, and any combination of them using +, −, ×, ÷ and composition.

How do I find a second derivative?

Choose Second derivative in the Order menu. The calculator differentiates the simplified first derivative again and shows both stages.

Can I evaluate the derivative at a point?

Yes. Enter a value such as 2 or pi/4 in the Evaluate at box to get f′(a)f'(a), the slope of the tangent at x=ax = a.

How do I know the answer is correct?

Each result is compared numerically against an independently computed derivative at 8 sample points. If they disagree, no answer is shown.

Why does my answer look different from my textbook?

Equivalent expressions can be written in many ways, for example 2xx2+1\frac{2x}{x^2+1} and 2x(x2+1)−12x(x^2+1)^{-1}. Substitute a value into both to confirm they match.

How do I use the chain rule?

Differentiate the outer function while keeping the inner expression unchanged, then multiply by the derivative of the inner expression. For sin⁡(x2)\sin(x^2) that gives cos⁡(x2)⋅2x\cos(x^2) \cdot 2x.

What does the second derivative tell me about a graph?

Its sign gives the concavity. Where f′′>0f'' > 0 the graph bends upward, where f′′<0f'' < 0 it bends downward, and where it changes sign there is an inflection point.

Where is a function not differentiable?

At corners, cusps, vertical tangents and breaks in the graph. For example ∣x∣|x| has a corner at 0, where the slopes from the left and right are −1-1 and 11, so no single tangent exists.

Differentiate your function

Type a function above to see the rule used at every step, choose higher orders, and evaluate the derivative at any point.

More math calculators