Skip to content
Calculus Solver

Derivative Calculator

Type a function to see its derivative and the rule used at every stage, from the first derivative up to the tenth. Use it to check homework, study for a test, or see where a long product or chain rule went wrong.

Your expression will be shown here as it will be read.

Solved entirely in your browser. Nothing you type is sent to a server or stored, and no account is needed.

Try an example

What is a derivative?

A curve with tangent lines at three points: rising, flat at the peak, and falling

The derivative of a function measures its instantaneous rate of change. Geometrically, f′(a) is the slope of the tangent line to the graph of y = f(x) at x = a. In physics, the derivative of position is velocity; in economics, the derivative of cost is marginal cost.

Formally, the derivative is defined as a limit of difference quotients. In practice nobody evaluates that limit each time: a small set of rules, applied in the right order, differentiates every function built from powers, exponentials, logarithms and trigonometric functions.

f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}

Differentiation rules the calculator uses

Every step in a solution names one of these rules. Learning to spot which one applies is most of the work.

  • Power rule

    ddx xn=n xn−1\frac{d}{dx}\,x^{n} = n\,x^{n-1}

    Works for any real exponent, including roots such as √x = x^(1/2) and reciprocals such as 1/x² = x^(−2).

  • Constant multiple and sum rules

    ddx[c f+g]=c f′+g′\frac{d}{dx}\big[c\,f + g\big] = c\,f' + g'

    Differentiate term by term and keep constant factors in front.

  • Product rule

    (fg)′=f′g+fg′(fg)' = f'g + fg'

    Used when two non-constant factors are multiplied.

  • Quotient rule

    (fg)′=f′g−fg′g2\left(\frac{f}{g}\right)' = \frac{f'g - fg'}{g^{2}}

    The order in the numerator matters: derivative of the top first.

  • Chain rule

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

    Differentiate the outer function, keep the inside, then multiply by the derivative of the inside.

  • Exponentials and logarithms

    (ex)′=ex,(ax)′=axln⁡a,(ln⁡x)′=1x(e^{x})' = e^{x},\quad (a^{x})' = a^{x}\ln a,\quad (\ln x)' = \frac{1}{x}

    For u(x)^v(x), where both base and exponent vary, the calculator uses logarithmic differentiation.

  • Trigonometric functions

    (sin⁡x)′=cos⁡x,(cos⁡x)′=−sin⁡x,(tan⁡x)′=sec⁡2x(\sin x)' = \cos x,\quad (\cos x)' = -\sin x,\quad (\tan x)' = \sec^{2} x

    Inverse trig functions are covered too, e.g. (arctan x)′ = 1/(1 + x²).

How this calculator works

Your input is parsed into an expression tree, which the live preview shows so you can confirm it was read the way you meant. The calculator then walks the tree from the outside in. At each node it applies exactly one rule (sum, product, quotient, power, chain, or a table derivative) and records that step with the intermediate result.

Each intermediate result is simplified exactly, using fractions rather than decimals: like terms are combined, powers of the same base merged, and values such as sin(π/6) = 1/2 evaluated. When expanding a product gives a shorter answer, the expanded form is shown; otherwise the factored form is kept.

For higher-order derivatives the process repeats on the simplified previous result, and every order gets its own list of steps. Finally the answer is compared against a numerical finite-difference estimate at several sample points as an independent check.

For the full details, including how answers are verified, see how the solver works.

Worked examples

Work through these by hand first, then enter them above to compare each step.

Example 1

Polynomial: power, constant multiple and sum rules

ddx(3x4−5x2+7x−2)\frac{d}{dx}\left(3x^{4} - 5x^{2} + 7x - 2\right)
  1. Differentiate term by term (sum rule), keeping each constant coefficient in front.

    3⋅4x3−5⋅2x+7⋅1−03\cdot 4x^{3} - 5\cdot 2x + 7\cdot 1 - 0
  2. Multiply out the coefficients.

Answer

12x3−10x+712x^{3} - 10x + 7

Example 2

Product rule

ddx(x2ex)\frac{d}{dx}\left(x^{2}e^{x}\right)
  1. Let f = x² and g = eˣ, so f′ = 2x and g′ = eˣ.

    (fg)′=f′g+fg′=2x ex+x2ex(fg)' = f'g + fg' = 2x\,e^{x} + x^{2}e^{x}
  2. Factor out eˣ (optional).

Answer

ex(x2+2x)e^{x}\left(x^{2} + 2x\right)

Example 3

Quotient rule

ddx x2+1x−1\frac{d}{dx}\,\frac{x^{2} + 1}{x - 1}
  1. With f = x² + 1 and g = x − 1, we have f′ = 2x and g′ = 1.

    2x(x−1)−(x2+1)⋅1(x−1)2\frac{2x(x - 1) - (x^{2} + 1)\cdot 1}{(x - 1)^{2}}
  2. Expand the numerator: 2x² − 2x − x² − 1 = x² − 2x − 1.

Answer

x2−2x−1(x−1)2\frac{x^{2} - 2x - 1}{(x - 1)^{2}}

Example 4

Chain rule

ddx sin⁡(3x2+1)\frac{d}{dx}\,\sin\left(3x^{2} + 1\right)
  1. The outer function is sin(u) with inner function u = 3x² + 1, so u′ = 6x.

    cos⁡(3x2+1)⋅6x\cos\left(3x^{2} + 1\right)\cdot 6x

Answer

6xcos⁡(3x2+1)6x\cos\left(3x^{2} + 1\right)

Example 5

Second derivative

d2dx2(x3ln⁡x)\frac{d^{2}}{dx^{2}}\left(x^{3}\ln x\right)
  1. First derivative (product rule):

    3x2ln⁡x+x3⋅1x=3x2ln⁡x+x23x^{2}\ln x + x^{3}\cdot\frac{1}{x} = 3x^{2}\ln x + x^{2}
  2. Differentiate again (product rule on the first term, power rule on the second):

    6xln⁡x+3x2⋅1x+2x=6xln⁡x+5x6x\ln x + 3x^{2}\cdot\frac{1}{x} + 2x = 6x\ln x + 5x

Answer

6xln⁡x+5x6x\ln x + 5x

Common mistakes

  • Forgetting the inner derivative

    d/dx sin(3x) is 3cos(3x), not cos(3x). Whenever the argument is anything other than plain x, the chain rule adds a factor.

  • Multiplying derivatives in a product

    (fg)′ is not f′·g′. For x²·sin x that shortcut gives 2x·cos x, which is wrong; the product rule gives 2x sin x + x² cos x.

  • Swapping the quotient rule numerator

    f′g − fg′ and fg′ − f′g differ by a sign. Remember “low d-high minus high d-low”.

  • Ambiguous input

    1/2x is read as (1/2)·x, and sin x^2 as sin(x²). Use parentheses, such as 1/(2x) or (sin x)^2, and check the preview before solving.

  • log versus ln

    Like most computer algebra systems, the calculator reads log(x) as the natural log ln(x). For base 10, type log10(x) or log(x, 10).

Limitations

  • Implicit differentiation (for example dy/dx from x² + y² = 25) is not supported; enter an explicit function instead.
  • Other letters are treated as constants, which gives a partial derivative with respect to the chosen variable. Mixed or multivariable derivatives are not available.
  • Piecewise, floor, ceiling and factorial functions are not supported.
  • The derivative of |x| is shown as x/|x|, which is undefined at x = 0. That is correct, but it is easy to overlook.
  • Answers can be written differently from your textbook (factored versus expanded, sec²x versus 1 + tan²x) and still be equal.

Frequently asked questions

How do I find a second or third derivative?

Choose the order from the Order menu (up to the 10th derivative). The solution shows the steps for each order separately, so you can follow how the first derivative feeds into the second.

Can the derivative calculator do partial derivatives?

Yes, in a limited way. Pick the variable you are differentiating with respect to; every other letter is treated as a constant. For example, with variable x, d/dx (a x² y) = 2axy. It does not compute mixed partials in one step.

Why doesn't my answer match the textbook exactly?

Derivatives can be written in many equivalent ways. The calculator chooses a compact form, which may be expanded where your book factors (or the reverse). Check equivalence by expanding both, or by plugging in a value of x.

Does it support implicit differentiation?

No. The calculator differentiates explicit functions y = f(x). For implicit differentiation, differentiate both sides by hand, using the calculator to check individual pieces.

How does the calculator know which rule to apply?

It looks at the outermost operation of the expression. A sum gets the sum rule, a product the product rule, a quotient the quotient rule, and a function of something other than plain x gets the chain rule. It then works inward.

Next step

Pick one of the worked examples, solve it on paper, then enter it in the calculator and compare your steps with each rule shown. Spotting where your work differs is the fastest way to improve.

Back to the calculator