How to Calculate Derivatives
The derivative of a function gives the instantaneous rate of change at any point. It is defined as the limit:
\[f'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}\]That limit can be evaluated directly for simple functions, but in practice a handful of rules cover nearly every derivative you will encounter in a calculus course. The most important are the power rule, constant multiple rule, sum rule, product rule, quotient rule, and chain rule.
The power rule
For any function of the form f(x) = x raised to a constant power n:
\[\frac{d}{dx} x^n = n \cdot x^{n-1}\]Bring the exponent down as a coefficient, then reduce the exponent by one. This single rule handles polynomials, roots, and reciprocals.
To differentiate f(x) = x to the fifth:
\[f'(x) = 5x^4\]Roots work the same way after rewriting them as fractional exponents. For f(x) = the square root of x:
\[f(x) = x^{1/2} \qquad f'(x) = \frac{1}{2}x^{-1/2} = \frac{1}{2\sqrt{x}}\]Negative exponents follow the pattern too. For f(x) = 1/x, rewrite as x to the negative one:
\[f(x) = x^{-1} \qquad f'(x) = -1 \cdot x^{-2} = \frac{-1}{x^2}\]Constant multiple and sum rules
Constants pass through the derivative operator unchanged. If c is a constant:
\[\frac{d}{dx}[c \cdot f(x)] = c \cdot f'(x)\]So the derivative of 7x cubed is 7 times 3x squared, which is 21x squared.
The derivative of a sum is the sum of the derivatives:
\[\frac{d}{dx}[f(x) + g(x)] = f'(x) + g'(x)\]These two rules together let you differentiate any polynomial term by term. For f(x) = 3x to the fourth minus 5x squared plus 2x minus 9:
\[f'(x) = 12x^3 - 10x + 2\]The constant term (-9) disappears because the derivative of any constant is zero. A constant function has no rate of change.
The product rule
When two functions are multiplied together, their derivative is not simply the product of the individual derivatives. Instead:
\[\frac{d}{dx}[f(x) \cdot g(x)] = f'(x) \cdot g(x) + f(x) \cdot g'(x)\]Differentiate the first and multiply by the second, then add the first multiplied by the derivative of the second.
For h(x) = x squared times sin(x), let f(x) = x squared and g(x) = sin(x):
\[h'(x) = 2x \cdot \sin(x) + x^2 \cdot \cos(x)\]The quotient rule
For a function written as a fraction f(x)/g(x):
\[\frac{d}{dx}\left[\frac{f(x)}{g(x)}\right] = \frac{f'(x) \cdot g(x) - f(x) \cdot g'(x)}{[g(x)]^2}\]Differentiate the numerator and multiply by the denominator, subtract the numerator times the derivative of the denominator, then divide by the denominator squared. For h(x) = sin(x) / x:
\[h'(x) = \frac{\cos(x) \cdot x - \sin(x) \cdot 1}{x^2} = \frac{x\cos(x) - \sin(x)}{x^2}\]Many textbooks suggest rewriting quotients as products with negative exponents and using the product rule instead, since the quotient rule is easy to misapply. Both methods give the same result.
The chain rule
The chain rule handles compositions of functions, where one function is nested inside another. If y = f(g(x)):
\[\frac{dy}{dx} = f'(g(x)) \cdot g'(x)\]Differentiate the outer function (leaving the inner function unchanged), then multiply by the derivative of the inner function.
For y = (3x + 1) to the fourth, the outer function is “something to the fourth” and the inner function is 3x + 1. Apply the power rule to the outer layer and multiply by the derivative of the inner layer:
\[\frac{dy}{dx} = 4(3x + 1)^3 \cdot 3 = \textbf{12(3x + 1)^3}\]A more involved example: y = sin(x squared). The outer function is sin(something) and the inner function is x squared:
\[\frac{dy}{dx} = \cos(x^2) \cdot 2x = 2x\cos(x^2)\]The chain rule also combines with the product rule. For y = x times e to the (x squared), apply the product rule first, then use the chain rule on the exponential term:
\[\frac{dy}{dx} = 1 \cdot e^{x^2} + x \cdot e^{x^2} \cdot 2x = e^{x^2}(1 + 2x^2)\]Table of common derivatives
| Function | Derivative |
|---|---|
| c (constant) | 0 |
| x to the n | n times x to the (n - 1) |
| e to the x | e to the x |
| ln(x) | 1/x |
| sin(x) | cos(x) |
| cos(x) | -sin(x) |
| tan(x) | sec squared (x) |
| a to the x | a to the x times ln(a) |
The exponential function e to the x is unique: it is its own derivative. That property is why e appears so frequently in calculus, differential equations, and mathematical modeling.
Geometric meaning
The derivative at a point equals the slope of the tangent line to the curve at that point. If f(x) = x squared, then f’(x) = 2x. At x = 3, the slope of the tangent line is f’(3) = 6. The tangent line passes through the point (3, 9) with a slope of 6, so its equation is y = 6x - 9.
This connection between derivatives and slopes is what makes differentiation useful beyond pure algebra. Velocity is the derivative of position with respect to time. Acceleration is the derivative of velocity. Marginal cost in economics is the derivative of total cost with respect to quantity. In each case, the derivative measures how fast something changes. The slope calculator computes the slope between two discrete points; the derivative generalizes that idea to a continuous curve.
Common mistakes
Forgetting the chain rule is the most frequent error. When differentiating (2x + 5) to the third, students often write 3(2x + 5) squared and stop, omitting the factor of 2 from the inner derivative. The correct answer is 6(2x + 5) squared.
Another common mistake is applying the product rule where it is not needed, or failing to apply it where it is. The function 5x cubed requires only the power rule and constant multiple rule. The function x squared times ln(x) requires the product rule because two distinct functions of x are multiplied together.
Finally, sign errors in the quotient rule are frequent because of the subtraction in the numerator. Writing the terms in the wrong order flips the sign of the entire result. If you find the quotient rule error-prone, rewrite the fraction as a product and use the product rule with negative exponents instead.
CalculateY