Math & Statistics

Derivative Calculator

Type a function to get its derivative, with each differentiation rule explained step by step. Choose first to fourth order, evaluate the slope at a point and get the tangent line. Every answer is checked numerically before it is shown.

Free, runs in your browserUpdated October 2026
f =

Use ^ for powers. Multiplication can be written with * or a space (2x, x sin(x)). Functions: sin, cos, tan, sec, csc, cot, asin, acos, atan, sinh, cosh, tanh, sqrt, exp or e^x, ln, log10, abs. Other letters such as a or k are treated as constants.

Examples
Derivative
–
Check–
Rules used–
Value at point–
Tangent line–
Steps
    Derivative calculator diagram: d/dx of x³ sin(x) by the product rule equals 7.402203301 at x = π/2
    How the Derivative Calculator works: Derivatives with the rules and steps shown, plus the slope and tangent at a point.

    How to use the derivative calculator

    How to use the derivative calculator: enter a function, choose the order and a point, read the derivative
    Numbered steps on the Derivative Calculator. Follow them in order.
    1. Type your function using ^ for powers, such as x^3 sin(x).
    2. Choose the first, second, third or fourth derivative.
    3. Optionally enter a point, such as pi/2, to get the slope and tangent line.
    4. Read the derivative, then follow the steps and the rules used.

    Type the function in the box. You can write multiplication with a star or simply leave a space, so x^3 sin(x), 2x e^(3x) and ln(x^2 + 1) all work. Pick the variable and the order of the derivative you want. To get the slope at a specific point, enter a value such as 2 or pi/4 in the "Evaluate at" box, and the calculator also gives the equation of the tangent line there.

    The steps name the differentiation rule used for each part of the function: the power rule, the product rule, the quotient rule, the chain rule, or the exponential and logarithm rules. The symbolic work is done by the open-source nerdamer algebra library in your browser. Before any result is shown, the derivative calculator compares it with a high-accuracy numerical derivative at a dozen test points. If they do not agree, you see a message instead of a wrong answer.

    Differentiation rules

    Power rule: d/dx[xn] = n·xn−1
    Product rule: (uv)′ = u′v + uv′
    Quotient rule: (u/v)′ = (u′v − uv′) / v²
    Chain rule: d/dx[f(g(x))] = f′(g(x))·g′(x)
    d/dx[ex] = ex   d/dx[ln x] = 1/x   d/dx[ax] = ax ln a

    Worked example: product rule

    Differentiate f(x) = x³ sin(x). It is a product, so take u = x³ and v = sin(x). Then u′ = 3x² and v′ = cos(x). The product rule gives f′(x) = 3x² sin(x) + x³ cos(x).

    At x = π/2, sin(π/2) = 1 and cos(π/2) = 0, so f′(π/2) = 3(π/2)² = 3π²/4 ≈ 7.4022. The function value there is (π/2)³ ≈ 3.8758, so the tangent line is y ≈ 7.4022x − 7.7516.

    Worked example: chain rule

    For f(x) = sin(x² + 1), the outer function is sin(u) and the inner function is u = x² + 1. The derivative of the outer function is cos(u) and the inner derivative is 2x, so f′(x) = 2x cos(x² + 1).

    Table of common derivatives

    f(x)f′(x)
    c (constant)0
    xnn xn−1
    √x1 / (2√x)
    ekxk ekx
    ln x1/x
    sin xcos x
    cos x−sin x
    tan xsec² x
    arctan x1 / (1 + x²)
    arcsin x1 / √(1 − x²)

    Second and higher derivatives

    The second derivative is the derivative of the first derivative. It measures how the slope itself changes: a positive second derivative means the graph is concave up, and a negative one means it is concave down. In physics, if f(t) is position, f′(t) is velocity and f″(t) is acceleration. Choose an order up to four in the selector. Each successive derivative is checked against a numerical derivative of the one before it.

    Slope and tangent line

    The value f′(a) is the slope of the curve at x = a. The tangent line at that point is y = f(a) + f′(a)(x − a). Enter a point in "Evaluate at" to see both. Values such as pi/3 or sqrt(2) are accepted, and when the exact value is short it is shown along with the decimal.

    Notes and limits

    ln(x) and log(x) both mean the natural logarithm, and log10(x) is the base 10 logarithm. Results can look different from a textbook because the same derivative can be written in many equivalent forms. The calculator simplifies when it can confirm that the simpler form is equal. Implicit differentiation, piecewise functions and derivatives of functions with several variables at once are not covered here. For derivatives with respect to one variable while holding others constant, use the partial derivative calculator.

    Frequently asked questions

    How do you find the derivative of a function?

    Break the function into pieces and apply the rules: the power rule for xn, the product rule for products, the quotient rule for fractions and the chain rule for a function inside another function. Add the derivatives of separate terms.

    What is the derivative of x squared?

    By the power rule, d/dx[x²] = 2x. In general, the derivative of xn is n xn−1.

    When do I use the chain rule?

    Use it whenever one function is inside another, such as sin(3x), ex² or (2x + 1)5. Differentiate the outer function, keep the inside unchanged, then multiply by the derivative of the inside.

    What does the second derivative tell you?

    It shows how the slope is changing. A positive second derivative means the curve bends upward (concave up), and a negative one means it bends downward. At a critical point it helps decide between a minimum and a maximum.

    Is log(x) the natural log here?

    Yes. ln(x) and log(x) are both treated as the natural logarithm. Type log10(x) for the common base 10 logarithm, whose derivative is 1/(x ln 10).