Derivatives — the rate of change
The derivative built from the ground up: genesis (Fermat's tangent problem, Newton's fluxions, Leibniz's dx), the difference quotient and the limit, the derivative from the definition step by step, differentiability versus continuity (proof), the rules of differentiation with a derivation of the product rule, the chain rule, derivatives of elementary functions, higher-order derivatives, monotonicity and convexity, Fermat's theorem and Lagrange's mean value theorem, Taylor's formula, economic applications (profit maximisation, elasticity), partial derivatives and the gradient in 3D, and the generalisation to ℝⁿ. Every concept and every example with its own figure.
The derivative measures the rate of change — the instantaneous speed with which the value of a function responds to a change in its argument. In economics it is marginal cost, marginal revenue, and elasticity; in econometrics it is the gradient of the objective function, whose vanishing determines the estimators. This chapter builds the differential calculus from the historical tangent problem, through the difference quotient and the rules of differentiation, up to Taylor’s formula and partial derivatives and the gradient in the space $\mathbb{R}^n$. Every concept and every example is given its own figure, and the key theorems a proof.
The genesis of the concept of a derivative
The derivative grew out of two seemingly distant questions that turned out to be the same problem. The first was the tangent problem: how to draw a line touching a curve at a single point? In the seventeenth century Pierre de Fermat noticed that at an extremum the tangent is horizontal, and he determined it by comparing the values of the function at points separated by an infinitely small quantity. The second was the question of instantaneous velocity: if we know the position of a body as a function of time, how fast is it moving at a given instant — and not merely on average over an interval?
Both questions lead to the same construction. The average velocity over a time interval is the ratio of the distance travelled to the time — geometrically, the slope of a secant of the position graph. The instantaneous velocity arises when the time interval shrinks to zero and the secant becomes a tangent.
Isaac Newton called the instantaneous rate of change a fluxion, and Gottfried Wilhelm Leibniz introduced the notation $\tfrac{dy}{dx}$ as a ratio of infinitely small increments — notation we still use today. A rigorous foundation came only with the limit in Cauchy’s sense, and it is where the definition begins.
Definition of the derivative
The derivative of a function $f$ at a point $x_0$ is the limit of the difference quotient
$$ f'(x_0)=\lim_{h\to 0}\frac{f(x_0+h)-f(x_0)}{h}, $$provided this limit exists and is finite; we then say the function is differentiable at $x_0$. The quotient $\tfrac{f(x_0+h)-f(x_0)}{h}$ is the slope of the secant through the points $\big(x_0,f(x_0)\big)$ and $\big(x_0+h,f(x_0+h)\big)$.
Geometrically the derivative $f'(x_0)$ is the slope of the tangent to the graph at the point $\big(x_0,f(x_0)\big)$: the limiting position of the secants as the second point slides toward the first.
The derivative from the definition — a full computation
Let us compute the derivative of $f(x)=x^2$ at the point $x_0=2$ directly from the definition. We form the difference quotient:
$$ \frac{f(2+h)-f(2)}{h}=\frac{(2+h)^2-4}{h}=\frac{4+4h+h^2-4}{h}=\frac{4h+h^2}{h}=4+h. $$As $h\to 0$ the expression $4+h$ tends to $4$. Hence $f'(2)=4$ — the secants with slopes $4+h$ rotate to a tangent of slope $4$. The same computation for an arbitrary $x_0$ would give $f'(x_0)=2x_0$, i.e. the rule $(x^2)'=2x$.
Differentiability versus continuity
Differentiability is a condition stronger than continuity: every differentiable function is continuous, but not conversely.
- Rewriting the increment. For $h\ne 0$ we write $f(x_0+h)-f(x_0)=\dfrac{f(x_0+h)-f(x_0)}{h}\cdot h$.
- Passing to the limit. The first factor tends to the finite number $f'(x_0)$, and the second to $0$, so the product tends to $f'(x_0)\cdot 0=0$.
- Conclusion. Hence $f(x_0+h)\to f(x_0)$, i.e. $f$ is continuous at $x_0$. $\;$
Rules of differentiation
There is no need to compute the limit each time — operations on functions have their counterparts in operations on derivatives.
For differentiable $f,g$ and a constant $c$:
$$ (c)'=0,\qquad (x^n)'=n x^{n-1},\qquad (f+g)'=f'+g',\qquad (c f)'=c f', $$$$ (fg)'=f'g+fg',\qquad \Big(\frac{f}{g}\Big)'=\frac{f'g-fg'}{g^2},\qquad (g\circ f)'(x)=g'\big(f(x)\big)\,f'(x). $$- Add-and-subtract trick. In the numerator of the difference quotient of the product we insert an intermediate term: $$\frac{f(x+h)g(x+h)-f(x)g(x)}{h}=\frac{f(x+h)-f(x)}{h}\,g(x+h)+f(x)\,\frac{g(x+h)-g(x)}{h}.$$
- Limits of the factors. As $h\to 0$ the first quotient tends to $f'(x)$, the factor $g(x+h)\to g(x)$ (since $g$ is continuous, being differentiable), and the second quotient to $g'(x)$.
- Conclusion. Hence $(fg)'(x)=f'(x)g(x)+f(x)g'(x)$. $\;$
The chain rule
The derivative of a composition is the product of the rates of change. If $u=g(x)$ changes at rate $g'(x)$, and $f$ responds to $u$ at rate $f'(u)$, then the composition changes at a rate equal to the product of these rates.
For $h(x)=(3x+1)^5$ we take $f(u)=u^5$ and $g(x)=3x+1$. Then $f'(u)=5u^4$ and $g'(x)=3$, so
$$ h'(x)=f'\big(g(x)\big)\,g'(x)=5(3x+1)^4\cdot 3=15(3x+1)^4. $$Derivatives of elementary functions
Two of these rules deserve their own figure. The function $e^x$ is its own derivative: at every point the slope of the tangent equals the height of the graph. This distinguishes it among all functions and makes it the foundation of growth models.
The derivative of the sine is the cosine: where the sine grows fastest (at zero), the cosine attains its maximum $1$; where the sine reaches a peak, its rate of change — and hence the cosine — is zero.
Higher-order derivatives, monotonicity, and convexity
The derivative of the derivative is the second derivative $f''(x)$. The first derivative describes growth, the second describes convexity:
- $f'(x)\gt 0$ — increasing function; $f'(x)\lt 0$ — decreasing;
- $f''(x)\gt 0$ — convex function (the curve bends upward); $f''(x)\lt 0$ — concave.
A point at which the second derivative changes sign is an inflection point — the boundary between the concave and convex parts.
Fermat’s theorem and the classification of extrema
The condition $f'(x_0)=0$ is necessary but not sufficient — the second derivative decides. Let us trace this on a complete example. For $f(x)=x^3-3x$ we have
$$ f'(x)=3x^2-3=3(x-1)(x+1),\qquad f''(x)=6x. $$The derivative vanishes at $x=\pm 1$. Since $f''(1)=6\gt 0$, there is a local minimum at $x=1$; since $f''(-1)=-6\lt 0$, there is a local maximum at $x=-1$.
Lagrange’s mean value theorem
If $f$ is continuous on $[a,b]$ and differentiable on $(a,b)$, then there exists a point $c\in(a,b)$ such that
$$ f'(c)=\frac{f(b)-f(a)}{b-a}. $$Thus there is a point at which the tangent is parallel to the secant joining the endpoints of the graph.
This theorem links global behaviour (the average change over an interval) with local behaviour (the instantaneous rate) and underlies the proofs of many theorems of analysis. Intuitively: if the average speed on a trip was $90$ km/h, then at some instant the speedometer read exactly $90$.
Taylor’s formula
Higher-order derivatives allow a function to be approximated by a polynomial. Taylor’s formula at a point $x_0$ reads
$$ f(x)\approx f(x_0)+f'(x_0)(x-x_0)+\frac{f''(x_0)}{2}(x-x_0)^2+\dots $$The first term is a constant approximation, the first two give the tangent (a linear approximation), and three give a parabola matched in curvature. The more terms, the better the approximation near $x_0$. In econometrics this is exactly how nonlinear models are linearised around a point.
Applications in economics and econometrics
Profit maximisation
A firm seeks the output $Q$ maximising profit $\pi(Q)$. The necessary condition is the vanishing of the derivative (marginal revenue equals marginal cost), $\pi'(Q^*)=0$, and the sufficient condition for a maximum is a negative second derivative, $\pi''(Q^*)\lt 0$.
Elasticity and log-linear models
The price elasticity of demand, $\varepsilon=\dfrac{dQ}{dP}\cdot\dfrac{P}{Q}$, measures the percentage response of quantity to a percentage change in price. For this reason econometrics often uses the log-linear model
$$ \ln Y=\beta_0+\beta_1\ln X+\varepsilon, $$in which the coefficient $\beta_1$ is the elasticity, because
$$ \beta_1=\frac{d\ln Y}{d\ln X}=\frac{dY/Y}{dX/X}. $$The derivative of the logarithm converts absolute changes into relative (percentage) ones — hence the naturalness of this form in modelling.
Partial derivatives and the gradient
In econometrics functions usually depend on several variables — output on capital and labour, the sum of squared residuals on all the parameters $\beta$. The partial derivative $\tfrac{\partial f}{\partial x}$ measures the rate of change when we move only one variable, holding the rest constant.
For $z=f(x,y)$ the partial derivatives $\tfrac{\partial f}{\partial x}$ and $\tfrac{\partial f}{\partial y}$ are the slopes of the surface along the $x$ and $y$ axes. Together they determine the tangent plane to the surface — the two-dimensional counterpart of the tangent line:
$$ z=f(x_0,y_0)+\frac{\partial f}{\partial x}(x-x_0)+\frac{\partial f}{\partial y}(y-y_0). $$Collected into a vector, the partial derivatives form the gradient $\nabla f=\big(\tfrac{\partial f}{\partial x},\tfrac{\partial f}{\partial y}\big)$. The gradient points in the direction of fastest growth of the function and is perpendicular to the level curves — it is what drives the optimisation algorithms (gradient methods) used in estimation.
The gradient in $\mathbb{R}^n$ and the fourth dimension.
For a function $f\colon\mathbb{R}^n\to\mathbb{R}$ the gradient is a vector of $n$ partial derivatives, $\nabla f=\big(\tfrac{\partial f}{\partial x_1},\dots,\tfrac{\partial f}{\partial x_n}\big)$. The condition for an extremum reads the same as in one variable, except that it concerns all directions at once: $\nabla f=\mathbf{0}$, i.e. the tangent (hyper)plane is horizontal. This is exactly the condition that minimises the sum of squared residuals in the least squares method, where the objective depends on many parameters. The geometry in $\mathbb{R}^4$ and higher cannot be drawn, but the calculus is identical — the gradient and the condition $\nabla f=\mathbf{0}$ work in every dimension, and a four-dimensional surface can be examined “layer by layer,” fixing one coordinate and analysing three-dimensional slices.
Application — case study: a profit-maximising monopolist
Consider a monopolistic firm that, as the sole supplier, sets the price through its level of output. Let the inverse demand function be $P=100-2Q$ and total cost $TC=20Q+200$ (marginal cost $MC=20$, fixed cost $200$). Total revenue is $TR=PQ=100Q-2Q^2$, and profit
$$ \pi(Q)=TR-TC=100Q-2Q^2-(20Q+200)=-2Q^2+80Q-200. $$The necessary condition for a maximum is the vanishing of the derivative:
$$ \pi'(Q)=-4Q+80=0 \;\Longrightarrow\; Q^\*=20. $$The second derivative $\pi''(Q)=-4\lt 0$ confirms a maximum. Hence the price $P^\*=100-2\cdot 20=60$ and profit $\pi(20)=600$. Equivalently, $\pi'(Q)=MR-MC$, where marginal revenue $MR=100-4Q$; the condition $\pi'=0$ is the famous rule “marginal revenue = marginal cost” ($100-4Q=20$).
This case study shows the core of mathematical microeconomics: optimal decisions are determined by the first-order condition $\pi'=0$, whose economic content is the equalisation of marginal quantities. The same logic — setting the derivative (gradient) to zero — underlies estimation in econometrics.
Further reading
Polish textbooks
- G. M. Fichtenholz, Differential and Integral Calculus, vol. I, PWN.
- W. Krysicki, L. Włodarski, Analiza matematyczna w zadaniach, vol. I, PWN.
World and economics classics
- W. Rudin, Principles of Mathematical Analysis, McGraw-Hill, 1976.
- A. C. Chiang, K. Wainwright, Fundamental Methods of Mathematical Economics, McGraw-Hill, 2005.
Articles and historical sources
- N. Guicciardini, Newton’s method and Leibniz’s calculus, in: A History of Analysis (ed. H. N. Jahnke), AMS, 2003.
Summary
The derivative is the limit of the difference quotient — the instantaneous rate of change and the slope of the tangent. From the historical problems of the tangent and of velocity grew the apparatus of differentiation rules, mean value theorems, and Taylor’s formula, while the generalisation to partial derivatives and the gradient lets us optimise functions of several variables in $\mathbb{R}^n$ — the core of estimation in econometrics.
- G. M. Fichtenholz, Differential and Integral Calculus, vol. I
- W. Rudin, Principles of Mathematical Analysis
- Python:
sympy.diff(f, x)— symbolic derivative;sympy.series(f, x, 0, n)— Taylor - R:
D(expression, "x"),numDeriv::grad()— derivatives and gradient