Derivative Calculator

Published on: April 6, 2025
Final Answer: Free | Full Steps: Plus

This Derivative Calculator differentiates a function and shows the working line by line. It first works out which rule the function is built from, because a sum, a product, a quotient and a composition each need a different move, and only then does it apply that rule the way the dedicated rule calculators on this site do. Nested pieces are differentiated inside their own steps. Following the same pattern every time makes it clear why a rule was chosen, not just what it produced.

Step-by-step method

  1. Set up the problem.
  2. Identify the main rule that applies.
  3. Work through the steps of that rule.
  4. Simplify and write the final derivative.

Formula: Constant Rule

The derivative of a number on its own is 0, because a constant never changes.

\(\frac{d}{dx}c = 0\)

Formula: Variable Rule

The derivative of x with respect to x is 1, because x goes up at the same rate as itself.

\(\frac{d}{dx}x = 1\)

Formula: Power Rule

This rule differentiates x raised to a power n. Bring the power down in front, then take 1 off the power.

\(\frac{d}{dx}{x}^{n} = n\,{x}^{n - 1}\)

Formula: Constant Multiple Rule

A number multiplying a function stays in front, and only the function is differentiated.

\(\frac{d}{dx}\left(c\cdot f\left(x\right)\right) = c\cdot \frac{d}{dx}f\left(x\right)\)

Formula: Sum Rule

The derivative of a sum is the sum of the derivatives, so each term is differentiated on its own and the results are added.

\(\frac{d}{dx}\left(f\left(x\right) + g\left(x\right)\right) = \frac{d}{dx}f\left(x\right) + \frac{d}{dx}g\left(x\right)\)

Formula: Difference Rule

The derivative of a difference is the difference of the derivatives, so each term is differentiated on its own and the results are subtracted.

\(\frac{d}{dx}\left(f\left(x\right) - g\left(x\right)\right) = \frac{d}{dx}f\left(x\right) - \frac{d}{dx}g\left(x\right)\)

Formula: Product Rule

This rule differentiates two functions multiplied together. Take the derivative of the first times the second, then add the first times the derivative of the second.

\(\frac{d}{dx}\left(f\left(x\right) \cdot g\left(x\right)\right) = f'\left(x\right)g\left(x\right) + f\left(x\right)g'\left(x\right)\)

Formula: Quotient Rule

This rule differentiates one function divided by another. Take the bottom times the derivative of the top, subtract the top times the derivative of the bottom, then divide by the bottom squared.

\(\frac{d}{dx}\left(\frac{f\left(x\right)}{g\left(x\right)}\right) = \frac{f'\left(x\right)g\left(x\right) - f\left(x\right)g'\left(x\right)}{\left[g\left(x\right)\right]^{2}}\)

Formula: Chain Rule

This rule differentiates a function inside another function. Differentiate the outer function, then multiply by the derivative of the inner function.

\(\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}\)

Formula: Derivative of ln(x)

The derivative of the natural logarithm of x is 1 over x.

\(\frac{d}{dx}\left(\ln\left(x\right)\right) = \frac{1}{x}\)

Formula: Derivative of e to the x

The function e to the x is its own derivative.

\(\frac{d}{dx}\left(e^{x}\right) = e^{x}\)

Formula: Derivative of a to the x

For any positive base a, the derivative of a to the x is a to the x times the natural logarithm of a.

\(\frac{d}{dx}\left(a^{x}\right) = a^{x} \ln\left(a\right)\)

Formula: Derivative of sin(x)

The derivative of sin(x) is cos(x).

\(\frac{d}{dx}\left(\sin{\left(x \right)}\right) = \cos{\left(x \right)}\)

Formula: Derivative of cos(x)

The derivative of cos(x) is minus sin(x).

\(\frac{d}{dx}\left(\cos{\left(x \right)}\right) = - \sin{\left(x \right)}\)

Formula: Derivative of tan(x)

The derivative of tan(x) is sec squared of x.

\(\frac{d}{dx}\left(\tan{\left(x \right)}\right) = \sec^{2}{\left(x \right)}\)

Formula: Derivative of sec(x)

The derivative of sec(x) is tan(x) times sec(x).

\(\frac{d}{dx}\left(\sec{\left(x \right)}\right) = \tan{\left(x \right)} \sec{\left(x \right)}\)

Formula: Derivative of csc(x)

The derivative of csc(x) is minus cot(x) times csc(x).

\(\frac{d}{dx}\left(\csc{\left(x \right)}\right) = - \cot{\left(x \right)} \csc{\left(x \right)}\)

Formula: Derivative of cot(x)

The derivative of cot(x) is minus csc squared of x.

\(\frac{d}{dx}\left(\cot{\left(x \right)}\right) = - \csc^{2}{\left(x \right)}\)

Formula: Derivative of sinh(x)

The derivative of sinh(x) is cosh(x).

\(\frac{d}{dx}\left(\sinh{\left(x \right)}\right) = \cosh{\left(x \right)}\)

Formula: Derivative of cosh(x)

The derivative of cosh(x) is sinh(x), with no minus sign.

\(\frac{d}{dx}\left(\cosh{\left(x \right)}\right) = \sinh{\left(x \right)}\)

Formula: Derivative of tanh(x)

The derivative of tanh(x) is sech squared of x.

\(\frac{d}{dx}\left(\tanh{\left(x \right)}\right) = \operatorname{sech}^{2}{\left(x \right)}\)

Formula: Derivative of arcsin(x)

The derivative of arcsin(x) is 1 over the square root of 1 minus x squared.

\(\frac{d}{dx}\left(\arcsin{\left(x \right)}\right) = \frac{1}{\sqrt{1 - x^{2}}}\)

Formula: Derivative of arccos(x)

The derivative of arccos(x) is minus 1 over the square root of 1 minus x squared.

\(\frac{d}{dx}\left(\arccos{\left(x \right)}\right) = - \frac{1}{\sqrt{1 - x^{2}}}\)

Formula: Derivative of arctan(x)

The derivative of arctan(x) is 1 over x squared plus 1.

\(\frac{d}{dx}\left(\arctan{\left(x \right)}\right) = \frac{1}{x^{2} + 1}\)

Formula: Logarithmic Differentiation

For a power whose base and exponent both contain x, take ln of both sides, differentiate, then multiply back by the original function.

\(\frac{d}{dx}\left(f\left(x\right)^{g\left(x\right)}\right) = f\left(x\right)^{g\left(x\right)} \cdot \frac{d}{dx}\left(g\left(x\right) \ln\left(f\left(x\right)\right)\right)\)

Useful Tips to Remember

Rewrite the function in a form that is easy to differentiate first, such as turning roots and fractions into powers. Choose the right rule for each part: the power rule for powers, the product or quotient rule for products and quotients, and the chain rule for a function inside a function. Simplify the final derivative. The derivative gives the gradient of the function at every point.

Required knowledge

Where Are Derivatives Used?

A derivative measures how fast a quantity changes at an instant, which is the gradient of its graph at a single point. Speed is the derivative of position, acceleration is the derivative of speed, and marginal cost is the derivative of total cost. Engineers use derivatives to design safe structures, economists use them to find the output that maximises profit, and doctors use them to model how quickly a drug leaves the body. Setting a derivative equal to zero finds the highest and lowest points, which is the basis of optimisation.

  • Finding speed and acceleration from position
  • Maximising profit or minimising cost in business
  • Optimising shapes to use the least material
  • Modelling how quickly medicines or populations change
  • Training machine learning models with gradient descent

Derivative Practice Problems

Example 1 differentiates the polynomial \(4x^3 - 2x + 7\), and Example 2 differentiates \(x^2\cos x\), which needs the product rule. Try choosing the right rule yourself before checking each step. For two more free worked examples, check out the Derivative Notes.

The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. For more practice, the notes page goes further with extra worked examples and fuller explanations of the ideas behind each step. Use them together to check your answers and to understand why each step works.

See Example 1 Hide Example 1

Problem

\(f\left(x\right) = 4 x^{3} - 2 x + 7\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Identify the main rule that applies.
  3. Work through the steps of that rule.
  4. Simplify and write the final derivative.

Formula

Formula: Sum Rule

The derivative of a sum is the sum of the derivatives, so each term is differentiated on its own and the results are added.

\(\frac{d}{dx}\left(f\left(x\right) + g\left(x\right)\right) = \frac{d}{dx}f\left(x\right) + \frac{d}{dx}g\left(x\right)\)

Formula: Difference Rule

The derivative of a difference is the difference of the derivatives, so each term is differentiated on its own and the results are subtracted.

\(\frac{d}{dx}\left(f\left(x\right) - g\left(x\right)\right) = \frac{d}{dx}f\left(x\right) - \frac{d}{dx}g\left(x\right)\)

Step 1

Step 1 - Set up the terms in the sum and difference.

In this problem: We are given a sum and difference. The separated terms are \(4 x^{3}\), \(2 x\), \(7\).

\(f\left(x\right) = 4 x^{3} - 2 x + 7\)

Step 2

Step 2 - Write the sum rule and difference rule formulas.

In this problem: The sum rule and the difference rule say the derivative of a sum or difference is the sum or difference of the derivatives.

\(\begin{gathered} \frac{d}{dx}\left(f\left(x\right) + g\left(x\right)\right) = \frac{d}{dx}f\left(x\right) + \frac{d}{dx}g\left(x\right) \\ \frac{d}{dx}\left(f\left(x\right) - g\left(x\right)\right) = \frac{d}{dx}f\left(x\right) - \frac{d}{dx}g\left(x\right) \end{gathered}\)

Step 3

Step 3 - Split the derivative across the plus and minus signs.

In this problem: Apply the derivative to each separated term, keeping each sign.

\(\frac{d}{dx}\left(4 x^{3} - 2 x + 7\right) = \frac{d}{dx}\left(4 x^{3}\right) - \frac{d}{dx}\left(2 x\right) + \frac{d}{dx}\left(7\right)\)

Step 4a

Step 4a - Differentiate the separated term \(4 x^{3}\).

In this problem: The separated term is \(4 x^{3}\). Use the power rule to get its derivative.

\(\frac{d}{dx}\left(4 x^{3}\right) = 12 x^{2}\)

Step 4b

Step 4b - Differentiate the separated term \(2 x\).

In this problem: The separated term is \(2 x\). Use the power rule to get its derivative.

\(\frac{d}{dx}\left(2 x\right) = 2\)

Step 4c

Step 4c - Differentiate the separated term \(7\).

In this problem: The separated term is \(7\). Use the constant rule to get its derivative.

\(\frac{d}{dx}\left(7\right) = 0\)

Step 5

Step 5 - Combine and simplify.

In this problem: Combine the derivative from each separated term, keeping the signs, then simplify.

\(f'\left(x\right) = 12 x^{2} - 2 + 0 = 12 x^{2} - 2\)

Final Answer

\(f'\left(x\right) = 12 x^{2} - 2\)
See Example 2 Hide Example 2

Problem

\(f\left(x\right) = x^{2} \cos{\left(x \right)}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Identify the main rule that applies.
  3. Work through the steps of that rule.
  4. Simplify and write the final derivative.

Formula

Formula: Product Rule

This rule differentiates two functions multiplied together. Take the derivative of the first times the second, then add the first times the derivative of the second.

\(\frac{d}{dx}\left(f\left(x\right) \cdot g\left(x\right)\right) = f'\left(x\right)g\left(x\right) + f\left(x\right)g'\left(x\right)\)

Step 1

Step 1 - Set up the two factors f(x) and g(x).

In this problem: The first factor is \(x^{2}\) and the second factor is \(\cos{\left(x \right)}\).

\(\begin{gathered} f\left(x\right) = x^{2} \\ g\left(x\right) = \cos{\left(x \right)} \end{gathered}\)

Step 2

Step 2 - Write the product rule formula.

In this problem: The derivative of a product is the derivative of the first times the second, plus the first times the derivative of the second.

\(\frac{d}{dx}\left(f\left(x\right) \cdot g\left(x\right)\right) = f'\left(x\right)g\left(x\right) + f\left(x\right)g'\left(x\right)\)

Step 3

Step 3 - Differentiate the first factor.

In this problem: Differentiate \(x^{2}\) to get \(2 x\).

\(f'\left(x\right) = \frac{d}{dx}\left(x^{2}\right) = 2 x\)

Step 4

Step 4 - Differentiate the second factor.

In this problem: Differentiate \(\cos{\left(x \right)}\) to get \(- \sin{\left(x \right)}\).

\(g'\left(x\right) = \frac{d}{dx}\left(\cos{\left(x \right)}\right) = - \sin{\left(x \right)}\)

Step 5

Step 5 - Substitute into the product rule formula.

In this problem: Substitute the factors and their derivatives into the formula.

\(y'\left(x\right) = \left(2 x\right) \cdot \left(\cos{\left(x \right)}\right) + \left(x^{2}\right) \cdot \left(- \sin{\left(x \right)}\right)\)

Step 6

Step 6 - Simplify the result.

In this problem: Expand the products and combine like terms.

\(y'\left(x\right) = - x^{2} \sin{\left(x \right)} + 2 x \cos{\left(x \right)}\)

Final Answer

\(f'\left(x\right) = - x^{2} \sin{\left(x \right)} + 2 x \cos{\left(x \right)}\)

Notes and Practice Mode

Example Problems

Click one to load it into the box and solve it.