Derivative
calculator.
Type a function to get its derivative, every step, and the slope at any point.
- f(2)
- 2
- Slope f′(2)
- 9
- Concavity
- Concave up
At x = 2, f is rising: a small step h in x changes f by about 9 × h. f″ is positive, so the slope is increasing and the curve bends upward.
Graph
Drag the brass point along the curveThe graph shows f(x) = x³ − 3x, its tangent at x = 2 with slope 9 and the curve of f′(x) = 3x² − 3. Between x = −5 and x = 5: local maximum at (−1, 2); inflection point at (0, 0); local minimum at (1, −2).
Working
- 1Sum rule: differentiate each term on its ownf(x) = x3 − 3x
- 2Power ruleddx(x3) = 3x2
- 3Constant multiple ruleddx(3x) = 3
- 4Combine the terms and simplifyf′(x) = 3x2 − 3
- 5Put in x = 2f′(2) = 9
- 6Tangent line, y = f′(x₀)(x − x₀) + f(x₀)y = 9(x − 2) + 2, so y = 9x − 16
- 7Answerf′(x) = 3x2 − 3, and f′(2) = 9
- 8Check: estimate the same value from nearby points (five-point difference)≈ 9, which agrees with the exact value
Keyboard shortcuts
- In the function box, type sqrt, pi or ^ and they turn into √, π and a power. / starts a stacked fraction.
- ↑ and ↓ in the point box move x by 0.1. Hold Shift for 1.
- Tab to the brass point on the graph, then use ← and → to slide it along the curve.
- ← and → switch between f′, f″, f‴ and f⁽⁴⁾, and between decimal places.
- Ctrl or ⌘ with the mouse wheel zooms the graph. Reset view brings it back.
Turning and inflection points
| Point | ||
|---|---|---|
| local maximum | −1 | 2 |
| inflection point | 0 | 0 |
| local minimum | 1 | −2 |
1 local maximum, 1 local minimum and 1 inflection point between x = −5 and x = 5. Maxima and minima are where f′ changes sign; inflection points are where f″ does.
Values near x = 2
| −0.5 | 1.375 | −2.25 |
|---|---|---|
| 0 | 0 | −3 |
| 0.5 | −1.375 | −2.25 |
| 1 | −2 | 0 |
| 1.5 | −1.125 | 3.75 |
| 2 | 2 | 9 |
| 2.5 | 8.125 | 15.75 |
| 3 | 18 | 24 |
| 3.5 | 32.375 | 33.75 |
| 4 | 52 | 45 |
| 4.5 | 77.625 | 57.75 |
All four derivatives at x = 2
| Derivative | At x = 2 | Formula |
|---|---|---|
| f′(x) | 9 | 3x2 − 3 |
| f″(x) | 12 | 6x |
| f‴(x) | 6 | 6 |
| f⁽⁴⁾(x) | 0 | 0 |
Taylor polynomial of degree 4 at x = 2, the polynomial that matches f and these derivatives there:
2 + 9(x − 2) + 6(x − 2)² + (x − 2)³
Slopes at several points
Type or paste a column of x values. Each row gets f, f′ and f″ for the function above.
| # | x |
|---|---|
| 1 | |
| 2 | |
| 3 | |
| 4 |
Values at each x
| f(x) | f″(x) | Reading | ||
|---|---|---|---|---|
| 0Falling, f″ = 0 | 0 | −3f″(x) 0 | 0 | Falling, f″ = 0 |
| 1Flat tangent, concave up | −2 | 0f″(x) 6 | 6 | Flat tangent, concave up |
| 2Rising, concave up | 2 | 9f″(x) 12 | 12 | Rising, concave up |
| 3Rising, concave up | 18 | 24f″(x) 18 | 18 | Rising, concave up |
How it’s worked out
The derivative of f at x is the slope of the curve at that point. You get it as the limit of the slope between two points h apart, as h shrinks to zero:
- f(x) is your function, the formula you type in the box.
- h is a small step along the x-axis. The fraction is the slope of the line through two nearby points on the curve.
- f′(x), read “f prime of x”, is what that slope settles on. It is a new function: put in any x and it gives the slope there.
Nobody works out that limit by hand for every function. Instead you use a few rules, proved once from the limit, and apply them piece by piece. The tool does the same. It reads your formula as a tree of sums, products, powers and functions, applies the matching rule at each branch, then expands and collects like terms. The table shows the rules and the result the tool gives for each one.
| Rule | f(x) | f′(x) |
|---|---|---|
| Power rule | ||
| Root as a power | ||
| Exponential | ||
| Natural log | ||
| Sine | ||
| Product | ||
| Chain |
For a quotient the answer is longer, so it gets its own line. For f(x) = x/(x² + 1) the tool gives
The two fractions share a denominator and are left separate. Added together they give , the same function written as one fraction.
Written with u and v for two parts of a formula, the three rules that do most of the work are:
The second derivative f″ is the derivative of f′. It tells you how the slope itself is changing, so its sign says which way the curve bends. The tool repeats the rules up to the fourth derivative.
Once you pick a point x₀, the tangent line is the straight line that touches the curve there with the same slope:
Here x₀ is your point, f(x₀) is the height of the curve there and f′(x₀) is the slope. The last step in the working checks the exact value against a five-point estimate built from f at x₀ − 2h, x₀ − h, x₀ + h and x₀ + 2h. If you use a function with no rule here, such as floor or gamma, that estimate is the answer and it is labeled as one. Angles in sin, cos and tan are in radians.
Worked examples
A product rule question on a problem set
Maya has to find the slope of f(x) = x² sin x at x = 1. With u = x² and v = sin x, the product rule gives u′v + uv′:
At x = 1 that is cos 1 + 2 sin 1 ≈ 2.2232. The curve is at height 0.8415, so the tangent line is y = 2.2232x − 1.3818. If her answer key prints 2x sin x + x² cos x, it is the same function with the terms in a different order.
The biggest box from a square sheet
Jordan cuts a square of side x cm from each corner of a 10 cm by 10 cm card and folds up the sides. The box has volume V(x) = x(10 − 2x)², which expands to 4x³ − 40x² + 100x cubic centimeters. The derivative is
At a 1 cm cut, V′(1) = 32: the volume is still growing by about 32 cm³ for each extra centimeter, so a bigger cut helps. Searching from 0 to 5 finds where V′ = 0. At x = ≈ 1.6667 cm the box holds its largest volume, about 74.07 cm³. The other zero, x = 5, is the cut that leaves no base at all, so V = 0 there. The second derivative, , is negative at , which confirms the maximum.
Marginal cost at a bakery
A bakery models the daily cost of baking x loaves as C(x) = 0.02x³ − 1.5x² + 60x + 500 dollars. The derivative C′(x) is the marginal cost, the extra cost of one more loaf at that output:
At 40 loaves, C′(40) = 36, so loaf number 41 adds about $36.00. The second derivative is . It changes sign at x = 25, the inflection point. That is where marginal cost is lowest, about $22.50 per loaf. Past 25 loaves each extra loaf costs a little more than the last.
Reading your result
The formula is the exact derivative, typeset with stacked fractions and roots. Products are expanded and like terms collected, so the form can differ from your textbook while being the same function. Put any x into both forms to check: they give the same number.
The slope at your point is f′(x₀). A positive value means f is rising there; a negative value means it is falling. Its size is the rate: for f(x) = x³ − 3x at x = 2 the slope is 9, so a small step h in x changes f by about 9h. The tangent line is that same approximation drawn as a line.
Concavity comes from f″(x₀). Positive means the curve bends upward like a cup; negative means it bends down like a cap. For x³ − 3x at x = 2, f″(2) = 12, so it is concave up there.
Turning points are listed where f′ changes sign. Stewart’s second derivative test (section 4.3) classifies them: f′ = 0 with f″ > 0 is a local minimum, and f′ = 0 with f″ < 0 is a local maximum. When f″ is also 0 the test says nothing, so the tool uses the first derivative test instead and compares the sign of f′ just left and right of the point. Inflection points are where f″ changes sign.
An estimate label means no exact rule exists for part of your function. The value comes from a five-point difference. On a smooth stretch of curve it agrees with the true slope to many decimal places, but it is less precise for f‴ and f⁽⁴⁾. At a jump, such as floor(x) at a whole number, or a sharp corner, no derivative exists, and the calculator says so instead of giving a number. Move the point off the jump to get a slope.
Common mistakes
- Multiplying the derivatives in a product. The derivative of x² sin x is not 2x cos x. The product rule needs both terms: 2x sin x + x² cos x.
- Dropping the inner derivative. The derivative of sin(x²) is 2x cos(x²), not cos(x²). The chain rule multiplies by the derivative of the inside.
- Getting the quotient rule backwards. The top is u′v − uv′, in that order. Swapping it flips the sign of the whole answer.
- Using degrees. The rule that sin x has derivative cos x only holds when x is in radians. A slope worked out in degrees is off by a factor of .
- Treating an exponential like a power. The power rule does not apply when x is in the exponent. The derivative of is , not .
- Asking for a slope where none exists. |x| has a corner at 0 and √x has a vertical tangent at 0, so neither has a derivative there. The tool says so instead of giving a number.
- Calling every flat point a maximum or minimum. x³ has f′(0) = 0 but keeps rising on both sides. Check the sign of f′ on each side, or f″.
Questions people ask
Sources
- Stewart, Calculus: Early Transcendentals, 8th ed., chapter 3 (Differentiation Rules), sections 3.1 to 3.6
- Stewart, Calculus: Early Transcendentals, 8th ed., sections 4.1 and 4.3 (maximum and minimum values; the first and second derivative tests)
- NIST Digital Library of Mathematical Functions, section 5.4 (special values of the gamma function)
- Burden and Faires, Numerical Analysis, 9th ed., section 4.1: Numerical Differentiation (five-point formulas)