Derivative calculator
Type a function of x, such as x^3 − 2x + sin(x), and get its derivative, simplified. Add a value of x to also see the derivative at that point and the equation of the tangent line.
Use ^ for powers, * for times (optional: 3x), sqrt, sin, cos, tan, exp, log (= ln), pi and e.
Fill in the fields; the answer appears here straight away.
How it's worked out
How it works
-
Enter the values
Type the numbers or the formula. Decimals may use a point or a comma. No idea? Click Fill in an example.
-
Instant answer
The answer appears as you type, with the most important intermediate values.
-
See the working
Under "How it's worked out" you see the steps, handy for checking your own calculation.
How to write functions
Use ^ for powers, * for multiplication (optional: 3x works), sqrt() for the square root and sin, cos, tan, exp, log (natural log) and pi. For example x^2 * exp(-x) or sqrt(1 + x^2).
Derivative rules
The calculator applies the same rules you learn at school: the power rule (xⁿ becomes n·xⁿ⁻¹), the product rule, the quotient rule and the chain rule. The derivative of sin(x²) is 2x·cos(x²).
Higher derivatives and tangent lines
Choose the second or third derivative for concavity or acceleration. With a value for x you get f′(x) at that point and the tangent line y = f′(a)(x − a) + f(a). Differentiation is done symbolically by math.js, in your browser. For the area under a curve, use the integral calculator.
Worked example
For f(x) = x³ − 2x² + sin(x) the derivative is f′(x) = 3x² − 4x + cos(x). At x = 1 that is 3 − 4 + cos(1) = −1 + 0.5403 = −0.4597, and since f(1) = −1 + sin(1) ≈ −0.1585, the tangent line is y = −0.4597(x − 1) − 0.1585. That is the example the calculator starts with.
Common derivatives
| f(x) | f′(x) |
|---|---|
| xⁿ | n · xⁿ⁻¹ |
| sin(x) | cos(x) |
| cos(x) | −sin(x) |
| eˣ | eˣ |
| ln(x) | 1/x |
| x² · e⁻ˣ | (2x − x²) · e⁻ˣ |
The last line uses the product rule, and sin(x²) with the chain rule gives 2x · cos(x²).
Finding maxima and minima
Where f′ is zero, the graph has a horizontal tangent: a possible maximum, minimum or saddle. The second derivative decides: positive means a minimum, negative a maximum. For f(x) = x³ − 3x, f′ = 3x² − 3 = 0 at x = ±1, and f″ = 6x is positive at 1 (minimum) and negative at −1 (maximum). A quadratic derivative can be solved with the quadratic equation solver; the area under the original curve with the integral calculator.
Frequently asked questions
Does it show the derivative as a formula or only a number?
As a formula, simplified, and also in calculator notation you can paste elsewhere. With a value of x you additionally get the number f′(x) at that point.
How do I write natural logs, roots and exponentials?
Use `log(x)` for the natural logarithm, `sqrt(x)` for the square root and `exp(x)` or `e^x` for exponentials. Multiplication signs are optional, so `3x` works.
What is the tangent line?
The straight line that touches the graph at the chosen point, with the slope f′(a): y = f′(a)(x − a) + f(a). It appears when you fill in a value for x.
Can it do partial or implicit derivatives?
No. This calculator differentiates a function of one variable. For another letter than x, such as t, the Dutch pages have a version where you pick the variable.