How to find a derivative: the rules, with worked examples
To find a derivative, you apply a small set of rules to each part of a function: bring the power down and reduce it by one for terms like x³, use known results for functions like sin x, and combine them with the product, quotient and chain rules. The result, f′(x), gives the slope of the graph at every point. The derivative calculator applies the same rules symbolically, and this guide shows how to do it by hand.
What a derivative measures
A derivative is a rate of change. If f(x) is the position of a car at time x, f′(x) is its speed. On a graph, the derivative at a point is the slope of the tangent line there: positive where the curve is rising, negative where it is falling and zero at a peak or a dip. The second derivative, f″(x), is the derivative of the derivative; it tells you how the slope itself is changing, which shows whether the curve bends upward or downward.
The limit definition
The slope between two points is rise over run. The derivative shrinks the run towards zero:
f′(x) = lim as h → 0 of (f(x + h) − f(x)) / h
Try it with f(x) = x² at x = 3. With h = 0.1, the slope is (3.1² − 9) / 0.1 = 6.1. With h = 0.01 it is 6.01, and with h = 0.001 it is 6.001. The values close in on 6. Doing the algebra in general gives ((x + h)² − x²) / h = 2x + h, which becomes 2x as h shrinks, so the derivative of x² is 2x, and at x = 3 that is 6.
The basic rules
Nobody uses the limit every time. A few results cover most functions:
- Constant: the derivative of a number is 0.
- Power rule: the derivative of xⁿ is n·xⁿ⁻¹, so x³ becomes 3x² and x becomes 1. It works for negative and fractional powers too: √x = x^½ becomes ½x^(−½).
- Sums and multiples: differentiate term by term and keep constant factors, so 5x² − 2x becomes 10x − 2.
- Standard functions: sin x becomes cos x, cos x becomes −sin x, eˣ stays eˣ, and ln x becomes 1/x.
Product, quotient and chain rules
When functions are combined, three rules tell you how:
- Product rule: (uv)′ = u′v + uv′.
- Quotient rule: (u/v)′ = (u′v − uv′) / v².
- Chain rule: for a function inside another, differentiate the outside, keep the inside unchanged, then multiply by the derivative of the inside.
The chain rule is the one people forget. The derivative of sin(x²) is not cos(x²) but cos(x²) × 2x.
Worked examples
- x³ − 2x + sin x gives 3x² − 2 + cos x, using the power rule and the sine result term by term.
- x² sin x is a product: 2x·sin x + x²·cos x.
- (3x² + 1)⁴ needs the chain rule: 4(3x² + 1)³ × 6x = 24x(3x² + 1)³.
- x / (x + 1) is a quotient: (1·(x + 1) − x·1) / (x + 1)² = 1 / (x + 1)².
The calculator parses what you type, applies these rules and lightly simplifies the result. That simplifier is deliberately modest, so for the last example it shows (x + 1 − x) / (x + 1)², which is equal to the tidy answer but not tidied. It also gives the second derivative and, at a point you choose, the function's value, the slope and the tangent line. For the first example at x = 1, the slope is 1 + cos 1 ≈ 1.5403, the second derivative is 6 − sin 1 ≈ 5.1585, so the curve bends upward there, and the tangent line is y ≈ 1.5403x − 1.6988.
Finding maxima and minima
Because the slope is zero at a peak or a dip, setting f′(x) = 0 finds them. Suppose you have 20 m of fencing for a rectangle and want the largest area. With one side x, the other is 10 − x, so the area is A = x(10 − x) = 10x − x². Then A′ = 10 − 2x, which is zero at x = 5, and A″ = −2 is negative, so it is a maximum: a 5 × 5 square with an area of 25 m². The graphing calculator lets you see where a curve flattens out, and the reverse process, integration, is covered in What an integral means: area, accumulation and the fundamental theorem with the integral calculator.
Sources and further reading
The claims in this guide rest on these references, which were checked when the guide was last updated. Spotted an error? The contact page says how to report it.