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
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.
- Product rule. d/dx[u·v] = u′·v + u·v′. Here u = x² and v = sin(x).
- Power rule. d/dx[xⁿ] = n·xⁿ⁻¹. With n = 2: d/dx[x²] = 2x.
- Trigonometric rule. d/dx[sin(x)] = cos(x).
- Combine. d/dx[x² sin(x)] = 2x sin(x) + x² cos(x)
Steps for the second derivative f″
- Sum rule. d/dx[2x sin(x) + x² cos(x)] is the sum of the derivatives of its 2 terms. Differentiate each term.
- Constant multiple rule. d/dx[c·g] = c·g′. Here c = 2 and g = x sin(x).
- Product rule. d/dx[u·v] = u′·v + u·v′. Here u = x and v = sin(x).
- Power rule. d/dx[x] = 1.
- Trigonometric rule. d/dx[sin(x)] = cos(x).
- Combine. d/dx[x sin(x)] = sin(x) + x cos(x)
- Combine. d/dx[2x sin(x)] = 2 sin(x) + 2x cos(x)
- Product rule. d/dx[u·v] = u′·v + u·v′. Here u = x² and v = cos(x).
- Power rule. d/dx[xⁿ] = n·xⁿ⁻¹. With n = 2: d/dx[x²] = 2x.
- Trigonometric rule. d/dx[cos(x)] = −sin(x).
- Combine. d/dx[x² cos(x)] = 2x cos(x) − x² sin(x)
- Combine. d/dx[2x sin(x) + x² cos(x)] = 2 sin(x) + 4x cos(x) − x² sin(x)
Worked examples
| Function f(x) | Derivative f′(x) | Rules used |
|---|---|---|
| x³ + 2x | 3x² + 2 | Sum 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^x | x^x · (ln(x) + 1) | General power rule, Power rule |
Differentiation rules the calculator applies
| Rule | Formula | Example f(x) | Example f′(x) |
|---|---|---|---|
| Constant rule | d/dx[c] = 0 | 7 | 0 |
| Power rule | d/dx[xⁿ] = n·xⁿ⁻¹ | x⁵ | 5x⁴ |
| Constant multiple rule | d/dx[c·f] = c·f′ | 4x³ | 12x² |
| Sum rule | d/dx[f + g] = f′ + g′ | x² + 3x | 2x + 3 |
| Product rule | d/dx[f·g] = f′·g + f·g′ | x e^x | e^x + x e^x |
| Quotient rule | d/dx[f/g] = (f′·g − f·g′)/g² | sin(x)/x | (x cos(x) − sin(x))/x² |
| Chain rule | d/dx[f(g(x))] = f′(g(x))·g′(x) | (3x + 1)⁴ | 12(3x + 1)³ |
| Exponential rule | d/dx[eᵘ] = eᵘ·u′ and d/dx[aᵘ] = aᵘ·ln(a)·u′ | 2^x | 2^x ln(2) |
| Logarithm rule | d/dx[ln u] = u′/u and d/dx[log u] = u′/(u·ln 10) | ln(5x) | 1/x |
| Trigonometric rule | sin → cos, cos → −sin, tan → sec², sec → sec·tan, csc → −csc·cot, cot → −csc² | tan(x) | sec²(x) |
| Inverse trigonometric rule | asin → 1/√(1 − u²), acos → −1/√(1 − u²), atan → 1/(1 + u²) | asin(x) | 1/sqrt(1 − x²) |
| Hyperbolic rule | sinh → cosh, cosh → sinh, tanh → 1/cosh² | tanh(x) | 1/cosh²(x) |
| General power rule | d/dx[uᵛ] = uᵛ·(v′·ln u + v·u′/u) | x^x | x^x · (ln(x) + 1) |
How to type a function
| You type | Read as |
|---|---|
| 2x | 2x |
| x(x+1) | x · (x + 1) |
| x^2 sin x | x² sin(x) |
| sin^2 x | sin²(x) |
| 1/2x | (1/2) · x |
| -x^2 | −x² |
| 2^-x | 2^(−x) |
| log10(x) | log(x) |
| e^(2x) | e^(2x) |
| pi x | π x |
| arctan(x) | atan(x) |
How to find a derivative with steps
- 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.
- 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.
- 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.
- 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
- OpenStax, Calculus Volume 1, Chapter 3: Derivatives (power, product, quotient and chain rules; trigonometric, inverse and exponential functions)
- NIST Digital Library of Mathematical Functions, §4.13: derivatives of the logarithm and exponential
- NIST Digital Library of Mathematical Functions, §4.26: derivatives of the trigonometric functions
- NIST Digital Library of Mathematical Functions, §4.34: derivatives of the hyperbolic functions
More free tools
- Polynomial CalculatorAdd, subtract, multiply and divide polynomials, find roots, factor and differentiate, with exact fractions and step-by-step working.
- Complex Number CalculatorAdd, subtract, multiply and divide complex numbers exactly, then find the modulus, argument, polar form, powers, square roots and roots of unity.
- Half-Life CalculatorSolve for the remaining amount, initial amount, elapsed time or half-life, with decay constant and mean lifetime. Switch to doubling time for growth.
- Scientific Notation ConverterConvert any number to scientific, E and engineering notation or back to standard form, round to significant figures, and count the sig figs you typed.
- Prime Factorization CalculatorCheck if a number is prime and get its prime factors, factor tree, divisors, divisor count and sum, Euler’s totient, and the next and previous prime.
- Quadratic Equation SolverSolve ax² + bx + c = 0 step by step: discriminant, exact and decimal roots (real or complex), vertex, factored form, completing the square and a graph.
More: Algebra and number theoryAll math & numbersAll toolsHome & DIY calculators