Skip to main content
ponderloop

Derivative Calculator With Steps

The derivative of x² sin(x) is f′(x) = 2x sin(x) + x² cos(x), found with the product rule. At x = 1 the slope is 2.223244275. Type any function of x and the tool shows the derivative, the rule used at each step, the second derivative and the slope at a point you choose.

Updated By ponderloop editorial · How we checkRuns in your browser: nothing you enter is uploadedHow this tool works

Use ^ for powers and write 2x, x(x+1) or x^2 sin(x). Functions: sin cos tan sec csc cot asin acos atan sinh cosh tanh exp ln log sqrt abs; constants e and pi. Results update as you type. Nothing is uploaded.

f(x) = x² sin(x)

f′(x) = 2x sin(x) + x² cos(x)

At x = 1 the slope of f is f′(1) = 2.223244275 (decimal values to 10 significant digits).

Second derivative
f″(x) = 2 sin(x) + 4x cos(x) − x² sin(x)
f(1)
0.8414709848
f′(1)
2.223244275
f″(1)
3.002680208
Tangent line at x = 1
y = 2.223244275x − 1.381773291

    The working

    One step per rule, parts of a rule indented. The last Combine line is the simplified result. The simplified form is correct but not always the shortest.

    1. Product rule. d/dx[u·v] = u′·v + u·v′. Here u = x² and v = sin(x).
    2. Power rule. d/dx[xⁿ] = n·xⁿ⁻¹. With n = 2: d/dx[x²] = 2x.
    3. Trigonometric rule. d/dx[sin(x)] = cos(x).
    4. Combine. d/dx[x² sin(x)] = 2x sin(x) + x² cos(x)
    Steps for the second derivative f″
    1. Sum rule. d/dx[2x sin(x) + x² cos(x)] is the sum of the derivatives of its 2 terms. Differentiate each term.
    2. Constant multiple rule. d/dx[c·g] = c·g′. Here c = 2 and g = x sin(x).
    3. Product rule. d/dx[u·v] = u′·v + u·v′. Here u = x and v = sin(x).
    4. Power rule. d/dx[x] = 1.
    5. Trigonometric rule. d/dx[sin(x)] = cos(x).
    6. Combine. d/dx[x sin(x)] = sin(x) + x cos(x)
    7. Combine. d/dx[2x sin(x)] = 2 sin(x) + 2x cos(x)
    8. Product rule. d/dx[u·v] = u′·v + u·v′. Here u = x² and v = cos(x).
    9. Power rule. d/dx[xⁿ] = n·xⁿ⁻¹. With n = 2: d/dx[x²] = 2x.
    10. Trigonometric rule. d/dx[cos(x)] = −sin(x).
    11. Combine. d/dx[x² cos(x)] = 2x cos(x) − x² sin(x)
    12. Combine. d/dx[2x sin(x) + x² cos(x)] = 2 sin(x) + 4x cos(x) − x² sin(x)

    Worked examples

    Each row is this calculator’s own output. The last column lists the rules named in its working.
    Function f(x)Derivative f′(x)Rules used
    x³ + 2x3x² + 2Sum rule, Power rule, Constant multiple rule
    x² sin(x)2x sin(x) + x² cos(x)Product rule, Power rule, Trigonometric rule
    x/(x + 1)1/(x + 1)²Quotient rule, Power rule, Sum rule, Constant rule
    sin(3x)3 cos(3x)Chain rule, Constant multiple rule, Power rule
    ln(x² + 1)2x/(x² + 1)Chain rule, Sum rule, Power rule, Constant rule
    e^x cos(x)e^x cos(x) − e^x sin(x)Product rule, Exponential rule, Power rule, Trigonometric rule
    atan(2x)2/(4x² + 1)Chain rule, Constant multiple rule, Power rule
    sqrt(1 − x²)−x/sqrt(1 − x²)Chain rule, Sum rule, Constant rule, Constant multiple rule, Power rule
    x^xx^x · (ln(x) + 1)General power rule, Power rule

    Differentiation rules the calculator applies

    The example column is the tool’s output for the function shown.
    RuleFormulaExample f(x)Example f′(x)
    Constant ruled/dx[c] = 070
    Power ruled/dx[xⁿ] = n·xⁿ⁻¹x⁵5x⁴
    Constant multiple ruled/dx[c·f] = c·f′4x³12x²
    Sum ruled/dx[f + g] = f′ + g′x² + 3x2x + 3
    Product ruled/dx[f·g] = f′·g + f·g′x e^xe^x + x e^x
    Quotient ruled/dx[f/g] = (f′·g − f·g′)/g²sin(x)/x(x cos(x) − sin(x))/x²
    Chain ruled/dx[f(g(x))] = f′(g(x))·g′(x)(3x + 1)⁴12(3x + 1)³
    Exponential ruled/dx[eᵘ] = eᵘ·u′ and d/dx[aᵘ] = aᵘ·ln(a)·u′2^x2^x ln(2)
    Logarithm ruled/dx[ln u] = u′/u and d/dx[log u] = u′/(u·ln 10)ln(5x)1/x
    Trigonometric rulesin → cos, cos → −sin, tan → sec², sec → sec·tan, csc → −csc·cot, cot → −csc²tan(x)sec²(x)
    Inverse trigonometric ruleasin → 1/√(1 − u²), acos → −1/√(1 − u²), atan → 1/(1 + u²)asin(x)1/sqrt(1 − x²)
    Hyperbolic rulesinh → cosh, cosh → sinh, tanh → 1/cosh²tanh(x)1/cosh²(x)
    General power ruled/dx[uᵛ] = uᵛ·(v′·ln u + v·u′/u)x^xx^x · (ln(x) + 1)

    How to type a function

    The second column shows how the calculator reads the input, so you can check it matches what you meant.
    You typeRead as
    2x2x
    x(x+1)x · (x + 1)
    x^2 sin xx² sin(x)
    sin^2 xsin²(x)
    1/2x(1/2) · x
    -x^2−x²
    2^-x2^(−x)
    log10(x)log(x)
    e^(2x)e^(2x)
    pi xπ x
    arctan(x)atan(x)

    How to find a derivative with steps

    1. Type the function. Enter a function of x, for example x^2 sin(x). Use ^ for powers, / for division, parentheses for grouping, and names such as sin, ln, sqrt and e^x.
    2. Read the derivative. The result appears as you type: for the example, f′(x) = 2x sin(x) + x² cos(x). Check the line “Read as” to confirm the calculator understood your input.
    3. Follow the steps. Open “The working”. Each step names the rule (for the example: Product rule, Power rule, Trigonometric rule) and shows the part it applies to, then a Combine line gives the simplified result.
    4. Get the slope at a point. Enter a value such as 1, -1/2 or pi/4 in the point box to see f(a), f′(a), f″(a) and the tangent line.

    Frequently asked questions

    How does the calculator show its steps?
    It differentiates the function you typed exactly as you wrote it and records one step per rule. For x² sin(x) it names Product rule, Power rule, Trigonometric rule, then a Combine step gives 2x sin(x) + x² cos(x). Nested parts, such as the inside of a chain rule, are indented one level.
    What can I type?
    Powers with ^, + − × ÷, parentheses and implicit multiplication (2x, x · (x + 1), x² sin(x)). Constants are e and pi. Functions are sin, cos, tan, sec, csc, cot, asin, acos, atan, sinh, cosh, tanh, exp, ln, log (base 10), sqrt and abs. A function can be written without parentheses when its argument is simple: sin x^2 means sin(x²), and sin^2 x means sin(x)². Note that 1/2x is read left to right as (1/2)x, so its derivative is 1/2.
    Is the answer fully simplified?
    Not always. The simplifier folds exact numbers, collects like terms and powers, cancels common factors and multiplies out polynomials, but it has no trigonometric identities and does not factor. The result is correct but may be longer than a textbook answer: for (2x + 1)/(x² + 3) the second derivative comes out as ((−4x − 2) · (x² + 3)² + 8x⁵ + 8x⁴ + 24x² − 72x)/(x² + 3)⁴, and cos²(x) − sin²(x) is the derivative of sin(x) cos(x) where a book would write cos(2x).
    How is the second derivative found?
    The calculator simplifies the first derivative and then differentiates that again, with its own list of steps under “Steps for f″”. For x² sin(x) the second derivative is 2 sin(x) + 4x cos(x) − x² sin(x).
    How do I get the slope or tangent line at a point?
    Enter the point in the second box. For x² sin(x) at x = 1 the slope is f′(1) = 2.223244275 and the tangent line is y = 2.223244275x − 1.381773291. Values are decimals to 10 significant digits; the derivative itself stays exact.
    What happens where a function has no derivative?
    The derivative of abs(x) is x/abs(x), which is undefined at 0, and the tool says so: f′(0) shows “undefined”. It does not check differentiability in general, so for functions with corners or breaks look at where the formula divides by zero or leaves the domain.
    Can it do other logarithm bases, integrals or partial derivatives?
    Not directly. Log means base 10 and ln means base e; for another base write ln(x)/ln(b), for example ln(x)/ln(2), whose derivative is 1/(x ln(2)). It differentiates one variable, x, and does not integrate, differentiate implicitly or take partial derivatives.
    Is anything uploaded?
    No. The parser, the differentiation rules and the simplifier all run in your browser, and what you type is not sent or stored anywhere.

    How it works

    The input is read by a small recursive-descent parser into a tree of numbers, x, constants, sums, products, quotients, powers and functions. Numbers are exact fractions, so 0.5 is 1/2 and no rounding happens until a value at a point is shown. Differentiation walks the tree and applies one rule per node (constant, power, constant multiple, sum, product, quotient, chain, exponential, logarithm, trigonometric, inverse trigonometric, hyperbolic, and the general power rule uᵛ by logarithmic differentiation), writing a step for each. The simplifier then folds numbers, collects like terms and powers, cancels common factors and writes negative powers as fractions; it assumes a cancelled factor is not zero and it knows no trigonometric identities, so the output is correct but not always the shortest form. Values at a point use double-precision arithmetic, shown to 10 significant digits. The engine is tested on dozens of functions by comparing f′ and f″ with central-difference estimates computed independently of the engine.

    Sources

    More: Algebra and number theoryAll math & numbersAll toolsHome & DIY calculators