# Derivative Calculator (Step by Step)

URL: https://speedycalculator.com/calculators/math/derivative/
Last updated: 2026-11-25

> The derivative calculator differentiates a function of x step by step with the power, product, quotient and chain rules, shows which rule handles each term, and gives the slope f′(a) at any point with a numerical check.

## Inputs

- Function f(x)
- Point a

## Results

- Derivative f′(x)
- Slope f′(a) at the point
- Second derivative f″(x)
- Numerical check of f′(a)
- Steps

## Formula

```
d/dx[xⁿ] = n·xⁿ⁻¹,  d/dx[eˣ] = eˣ,  d/dx[ln x] = 1/x
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)
```

## Explanation

A derivative measures how fast a function changes. If f(x) gives the position of a car, f′(x) gives its speed. If f(x) is a curve, f′(a) is the slope of the tangent line where x = a. Type a function of x below and this calculator writes out its derivative, names the rule used for each term and works out the slope at a point if you give one. It is a handy way to check homework, and the steps are there so you can follow the reasoning instead of copying an answer.

### How to use the Derivative Calculator

- Type your function with x as the variable, for example 2x^3 + sin(2x), x^2 e^x or ln(x^2 + 1). Write powers with ^ and put brackets around anything inside a function.
- Enter a point a if you want the slope at a particular x. Numbers and expressions such as pi/4 both work. Leave it empty for the derivative alone.
- Read f′(x) at the top, then the steps underneath to see which rule handled each term.
- Use the second derivative f″(x) for concavity, acceleration or the second derivative test.

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

### How it works

The function is first turned into a tree of operations, the same structure you would sketch when deciding which rule to apply first. The calculator then walks that tree. Sums are split term by term and constant factors are pulled out. A product uses the product rule, a fraction with x in the top and the bottom uses the quotient rule, and any function wrapped around something other than plain x gets the chain rule. A power with x in both the base and the exponent, such as x^x, is handled with logarithmic differentiation. Finally the result is tidied: numbers are multiplied together, like terms are collected, and factors such as ×1 or x^1 disappear. As a safety check, f′(a) is compared with a central difference, [f(a + h) − f(a − h)]/(2h), worked out from f itself with a tiny step h.

### Worked example: f(x) = 2x³ + sin(2x)

Split the sum and handle each term on its own.

- For 2x³ the constant 2 stays where it is and the power rule brings the 3 down: 2 × 3x² = 6x².
- For sin(2x) the outer function is sine, whose derivative is cosine, and the inner function is u = 2x with u′ = 2. The chain rule multiplies them: cos(2x) × 2 = 2cos(2x).
- Add the pieces: f′(x) = 6x² + 2cos(2x).
- At x = 1: f′(1) = 6 + 2cos(2) = 6 + 2 × (−0.4161468) = 5.167706327. The tangent line at x = 1 rises about 5.17 units for every unit you move to the right.
- Differentiate once more for f″(x) = 12x − 4sin(2x), so f″(1) = 12 − 4 × 0.9092974 = 8.3628103. It is positive, so the curve bends upward there.

### Derivative rules used

RuleFormulaExamplePower ruled/dx[xⁿ] = n·xⁿ⁻¹d/dx[x⁵] = 5x⁴Constant multipled/dx[k·f] = k·f′d/dx[7x²] = 14xSum rule(f + g)′ = f′ + g′d/dx[x² + x] = 2x + 1Product rule(uv)′ = u′v + uv′d/dx[x²·sin x] = 2x·sin x + x²·cos xQuotient rule(u/v)′ = (u′v − uv′)/v²d/dx[x/(x² + 1)] = (1 − x²)/(x² + 1)²Chain ruled/dx[f(g(x))] = f′(g(x))·g′(x)d/dx[e^(3x)] = 3e^(3x)Exponentiald/dx[aˣ] = aˣ·ln ad/dx[2ˣ] = 2ˣ·ln 2Logarithmd/dx[ln x] = 1/xd/dx[ln(x² + 1)] = 2x/(x² + 1)Trigonometricsin′ = cos, cos′ = −sin, tan′ = sec²d/dx[tan x] = sec² xInverse trigasin′ = 1/√(1 − x²), atan′ = 1/(1 + x²)d/dx[atan(3x)] = 3/(9x² + 1)

### How to type functions

Write multiplication with * or simply put things side by side: 3x, 2(x + 1) and x sin(x) all work. Use ^ for powers, sqrt( ) for square roots and cbrt( ) for cube roots. The calculator knows sin, cos, tan, sec, csc, cot, asin, acos, atan, sinh, cosh, tanh, exp, ln, log (base 10), log2 and abs, along with the constants pi and e. A function name followed by a space takes the next simple term as its argument, so sin 2x means sin(2x), but brackets are always clearer. Angles inside trig functions are in radians, which is the convention calculus uses.

### What the tidying step does not do

The simplifier collects like terms, multiplies out brackets when that makes the answer shorter and cancels powers of the same base. It does not apply trigonometric identities, so it may print cos²(x) − sin²(x) where a textbook writes cos(2x). Both are correct. Long second derivatives are shown as they come out, and absolute values are only differentiated where they are smooth. If your teacher wants a factored form, use the result here as a check and do the factoring by hand.

## Worked example

Inputs: Function f(x): 2x^3 + sin(2x); Point a: 1.

Results: **Derivative f′(x) = 6x^2 + 2cos(2x)**; Slope f′(1) = 5.167706327; Second derivative f″(x) = 12x − 4sin(2x).

## Key terms

- **Derivative**: The instantaneous rate of change of a function, written f′(x) or dy/dx.
- **Tangent line**: The straight line that touches a curve at one point and has the same slope as the curve there.
- **Chain rule**: The rule for a function inside another function: multiply the derivative of the outside by the derivative of the inside.
- **Second derivative**: The derivative of the derivative. Its sign tells you whether a curve bends up or down.
- **Central difference**: A numerical estimate of the slope, [f(a + h) − f(a − h)]/(2h), for a small step h.

## FAQ

**What is the derivative of x^x?**
Write x^x as e^(x·ln x) and differentiate. The result is x^x·(ln(x) + 1), and the steps label this logarithmic differentiation.

**Why does my answer look different from the textbook?**
A derivative can be written in many equal ways. 2sin(x)cos(x) and sin(2x) are the same function, for example. Pick a value of x and evaluate both, or enter it as the point a and compare.

**Are angles in degrees or radians?**
Radians. The derivative of sin(x) is cos(x) only when x is measured in radians. In degrees an extra factor of π/180 would appear.

**What does the numerical check mean?**
It estimates the slope from f alone, by evaluating f just left and just right of a and dividing the rise by the run. If it agrees with f′(a), the symbolic result is right at that point.

**What happens at a corner, such as x = 0 for**
x|? | A corner has no single slope. The calculator reports that f′(a) is not defined there, or that the two methods disagree.

**How do I get the third derivative?**
Copy the second derivative into the function box. The new f′(x) is the third derivative of your original function, and the new f″(x) is the fourth.


## Sources

- [OpenStax: Calculus Volume 1](https://openstax.org/details/books/calculus-volume-1)
- [MIT OpenCourseWare: 18.01 Single Variable Calculus](https://ocw.mit.edu/courses/18-01-single-variable-calculus-fall-2006/)
- [NIST Digital Library of Mathematical Functions](https://dlmf.nist.gov/)
