What the derivative of a function tells you
The derivative of a function f measures how fast f(x) changes as x changes. At any point, it equals the slope of the tangent line to the graph. If f(t) is the position of a car at time t, then f′(t) is its velocity; if C(q) is the cost of producing q items, C′(q) is the marginal cost.
You will see three common notations. They all mean the same thing:
f′(x) (“f prime of x”) is Lagrange's notation. dy/dx is Leibniz's notation, which is handy when y is defined by an equation such as y = x². The operator d/dx[…] means “take the derivative of what's in the brackets with respect to x”.
Method 1: Find the derivative from the definition
The derivative is defined as a limit of slopes of secant lines, taken as the two points move together:
Using this definition directly is called differentiating “from first principles”. It always follows the same four steps:
- Step 1: Write out f(x + h) by replacing every x with (x + h).
- Step 2: Subtract f(x) and simplify. Every term without an h should cancel.
- Step 3: Divide by h. Factor h out of the numerator first if needed.
- Step 4: Let h → 0. Whatever is left is f′(x).
Here is the method applied to f(x) = x² + 3x. Step 1:
Step 2: subtract f(x) = x² + 3x. The x² and 3x terms cancel:
Steps 3 and 4: divide by h, then let h approach 0:
So f′(x) = 2x + 3. This method is worth doing a few times, because it shows why the rules work. In practice, though, nobody uses it for every problem: the differentiation rules below give the same answers in a fraction of the time.
Method 2: A step-by-step process using the rules
This six-step process handles every function built from powers, roots, exponentials, logarithms and trig functions:
- Step 1: Rewrite. Turn roots and fractions into powers (√x = x^(1/2), 3/x² = 3x^(−2)) and simplify anything that can be simplified.
- Step 2: Find the outermost operation. Ask what the last thing you'd do is if you evaluated the function by hand: add, multiply, divide, raise to a power, or apply a function such as sin.
- Step 3: Apply the rule that matches that operation (see the table below).
- Step 4: Repeat for the inner pieces. Each rule leaves you with smaller derivatives to find; handle them the same way.
- Step 5: Simplify. Collect like terms, factor where it helps, and write the answer neatly.
- Step 6: Check. Plug in a value, or compare with a numerical estimate or a calculator.
Step 2 is where most mistakes happen. In sin(x²), the last operation is taking the sine, so the chain rule comes first. In x²·sin(x), the last operation is multiplying, so the product rule comes first.
Which differentiation rule should you use?
| The function looks like | Rule | Derivative |
|---|---|---|
For each rule explained in detail, with its own examples and the derivatives of every trig and inverse trig function, see our guide to derivative rules.
Rewrite before you differentiate
A minute spent rewriting often turns a quotient rule or chain rule problem into a simple power rule problem. These rewrites come up constantly:
For example, d/dx[1/x³] by the quotient rule takes several lines. Rewritten as x^(−3), the power rule gives −3x^(−4) = −3/x⁴ immediately.
Finding the derivative at a point (and the tangent line)
To find the slope at a specific point, find f′(x) first, then substitute. Never substitute first: f(2) is a constant, and the derivative of a constant is 0. Take f(x) = x³ − 2x at x = 2:
The slope of the graph at x = 2 is 10. Since f(2) = 8 − 4 = 4, the tangent line passes through (2, 4), and point–slope form gives its equation:
Second and higher-order derivatives
The second derivative f″(x) is the derivative of f′(x). It measures how the slope itself is changing: f″ > 0 means the graph curves upward (concave up), and for a position function, f″ is acceleration. To find it, simply differentiate the simplified first derivative again.
Simplify f′(x) fully before differentiating again; it makes the second step much shorter. Third and higher derivatives work the same way.
The second derivative is also how you tell a local maximum from a local minimum. To find and classify those points for any function, use the critical points calculator.
How to check your derivative
A quick numerical check catches most mistakes. Pick a value such as x = 1 and compute the symmetric difference quotient with a small step, for example h = 0.001:
For f(x) = x² + 3x, this gives (4.005001 − 3.995001) / 0.002 = 5.000, which matches f′(1) = 2(1) + 3 = 5. If the two numbers disagree, recheck your work. You can also graph f and f′ together: wherever f is increasing, f′ should be positive, and wherever f has a peak or valley, f′ should be zero.
To compare every step with your own working, enter the function in the derivative calculator.
Common mistakes to avoid
- Stopping the chain rule too early: d/dx[cos(5x)] is −5 sin(5x), not −sin(5x).
- Differentiating a product factor by factor: d/dx[x·eˣ] is eˣ + x·eˣ, not 1·eˣ.
- Swapping the quotient rule numerator: it is f′g − fg′, in that order.
- Using the power rule on exponentials: d/dx[2ˣ] is 2ˣ ln 2, not x·2ˣ⁻¹. The power rule needs the variable in the base, not the exponent.
- Substituting a number before differentiating, which always gives 0.
- Forgetting that the derivative of a constant, including π, e and ln 2, is 0.