Common Derivatives
Most differentiation in practice is pattern matching: memorize a short table of derivatives plus a few combination rules, and you can differentiate nearly any function that appears in statistics or disease modeling by inspection.
Reference table
| Function | Derivative |
|---|---|
| (constant) | |
Combination rules
Constant multiple:
Sum (and difference):
The power rule holds for any real , so it also covers roots () and reciprocals ().
Worked example: differentiating a polynomial
Let . Differentiate term by term using the power, constant-multiple, and sum rules:
At : .
Computing it
R
D(expression(x^n), "x") # x^n * (n * (1/x)) == n*x^(n-1)
D(expression(exp(x)), "x") # exp(x)
D(expression(log(x)), "x") # 1/x
D(expression(sin(x)), "x") # cos(x)
D(expression(3*x^4 - 5*x^2 + 7*x - 2), "x")
# 3 * (4 * x^3) - 5 * (2 * x) + 7 == 12x^3 - 10x + 7
Python
import sympy as sp
x, a, n = sp.symbols("x a n")
sp.diff(x**n, x) # n*x**n/x == n*x**(n-1)
sp.diff(a**x, x) # a**x*log(a)
sp.diff(sp.log(x), x) # 1/x
sp.diff(sp.tan(x), x) # tan(x)**2 + 1 == sec^2 x
sp.diff(3*x**4 - 5*x**2 + 7*x - 2, x) # 12*x**3 - 10*x + 7
Julia
using Symbolics
@variables x a
Symbolics.derivative(exp(x), x) # exp(x)
Symbolics.derivative(log(x), x) # 1 / x
Symbolics.derivative(sin(x), x) # cos(x)
Symbolics.derivative(3x^4 - 5x^2 + 7x - 2, x) # 7 + 12(x^3) - 10x
Why it matters for statistics
These building blocks recur throughout biology: the exponential’s derivative governs early outbreak growth and the first-order elimination of a drug from the bloodstream, while the log’s derivative appears every time we differentiate a log-likelihood to fit a model. These few rules cover the derivatives you meet constantly: polynomial regression terms, the in exponential growth and logistic models, and the at the heart of every log-likelihood. Knowing them cold lets you derive score equations and standard errors without reaching for software.