Differentiation

Y. Eddie Lu, Summer 2026

ECON 8001 course index · Lecture 5 of 8

Orientation

What problem does differentiation solve?

A finite change from \(x\) to \(x+h\) can be complicated. Differentiation asks whether, at sufficiently small scales, that change has a linear leading term. The derivative is the map that converts a small input displacement into its first-order output displacement. It is the common object behind a delta, a sensitivity matrix, a gradient, and the local geometry used in optimization.

This page develops the Chapter 3 material and keeps three claims separate:

  1. partial and directional derivatives are one-dimensional tests;
  2. total differentiability is a uniform linear approximation in every small direction at once;
  3. the inverse and implicit function theorems are local results, not global ones.

Where this sits

This page uses linear maps from Linear algebra: matrices and the open-domain language from Topology. Its local results are the main tools for Optimization.

Prerequisite retrieval

For \(h\in\mathbb R^n\), \(\|h\|\) denotes the Euclidean norm. A point \(x_0\) is an interior point of \(X\subseteq\mathbb R^n\) if some open ball around \(x_0\) lies in \(X\). A linear map \(A:\mathbb R^n\to\mathbb R^m\) is represented by an \(m\times n\) matrix, and \(Ah\in\mathbb R^m\).

Retrieval check. Why does a derivative at an interior point have to be a linear map rather than merely a vector of slopes?

The first-order change must accept every input displacement \(h\in\mathbb R^n\) and return an output displacement in \(\mathbb R^m\). A linear map has exactly that domain and codomain; a vector is only the special scalar-output representation of such a map.

1. One variable: a local slope

Definition 3.1.1: derivative in one variable

Let \(X\subseteq\mathbb R\), let \(x_0\in\operatorname{int}X\), and let \(f:X\to\mathbb R\). We say that \(f\) is differentiable at \(x_0\) if the following limit, taken through \(x\in X\setminus\{x_0\}\), exists as a finite real number:

\[ f'(x_0)=\lim_{x\to x_0} \frac{f(x)-f(x_0)}{x-x_0}. \]

Equivalently, with \(h\to0\),

\[ f'(x_0)=\lim_{h\to0}\frac{f(x_0+h)-f(x_0)}{h}. \]

The interior condition makes this an ordinary two-sided derivative. A relative derivative can instead take the limit only through feasible points of \(X\), and a one-sided derivative can take \(h\downarrow0\) or \(h\uparrow0\) at a boundary. For ordinary single-variable derivatives, this page uses the two-sided interior convention.

Example: a kink and a smooth point

For \(f(x)=x^2\), the quotient at \(x_0\) is

\[ \frac{(x_0+h)^2-x_0^2}{h}=2x_0+h\longrightarrow2x_0. \]

Thus \(f'(x_0)=2x_0\). In contrast, \(f(x)=|x|\) has quotient \(1\) for \(h>0\) and \(-1\) for \(h<0\) at \(0\), so it is not differentiable there.

Rolle’s theorem (Theorem 3.1.3)

Assumptions. \(a<b\); \(f:[a,b]\to\mathbb R\) is continuous on \([a,b]\), differentiable on \((a,b)\), and \(f(a)=f(b)\).

Conclusion. There exists \(c\in(a,b)\) such that \(f'(c)=0\).

Proof strategy. Continuity on the compact interval gives a maximum and minimum. If they are unequal, one is attained inside the interval and has zero derivative. If they are equal, the function is constant.

Mean-value theorem (Theorem 3.1.4)

Assumptions. \(a<b\); \(f:[a,b]\to\mathbb R\) is continuous on \([a,b]\) and differentiable on \((a,b)\).

Conclusion. For some \(c\in(a,b)\),

\[f'(c)=\frac{f(b)-f(a)}{b-a}.\]

Apply Rolle’s theorem to \(q(x)=f(x)-\ell(x)\), where \(\ell\) is the line through \((a,f(a))\) and \((b,f(b))\). The theorem is local in its conclusion but needs regularity on the full interval. It is the one-dimensional model for turning pointwise derivative information into a statement about changes in values.

2. Total differentiability in several variables

Definition 3.2.1: total derivative

Let \(X\subseteq\mathbb R^n\), let \(x_0\in\operatorname{int}X\), and let \(f:X\to\mathbb R^m\). The function is differentiable at \(x_0\) with derivative \(A:\mathbb R^n\to\mathbb R^m\) if \(A\) is linear and

\[ \lim_{h\to0} \frac{\|f(x_0+h)-f(x_0)-Ah\|}{\|h\|}=0. \tag{D} \]

Write \(Df(x_0)=A\). Equivalently, \(f(x_0+h)=f(x_0)+Df(x_0)h+r(h)\), where \(\|r(h)\|=o(\|h\|)\).

The ratio in (D) must go to zero along every sequence \(h\to0\). It says that the error is small relative to the length of the input change. It does not merely say that the error itself goes to zero.

Example: a derivative is a sensitivity map

Let \(f:\mathbb R^2\to\mathbb R^2\) be

\[f(x_1,x_2)=(x_1^2+x_2,\;x_1x_2).\]

At \(x_0=(1,3)^{\mathsf{T}}\), its derivative maps a small shock \(h=(h_1,h_2)^{\mathsf{T}}\) to

\[Df(x_0)h= \begin{pmatrix}2&1\\3&1\end{pmatrix} \begin{pmatrix}h_1\\h_2\end{pmatrix}. \]

The first row gives the first-order response of the first output; the second row does the same for the second output. The matrix is \(2\times2\) because the map has two inputs and two outputs.

Partial derivatives need not give total differentiability

Define \(f:\mathbb R^2\to\mathbb R\) by \(f(0,0)=0\) and

\[f(x,y)=\frac{x^2y}{x^4+y^2}\quad\text{when }(x,y)\ne(0,0).\]

Both coordinate partial derivatives at \((0,0)\) equal \(0\): along either axis, \(f\) is zero. But along \(y=x^2\), \(f(x,x^2)=1/2\), so \(f\) is not even continuous at the origin, hence cannot be differentiable there. In fact every two-sided directional derivative exists. For \(v=(a,b)^{\mathsf{T}}\), if \(b\ne0\), then

\[ \begin{aligned} D_v^{\pm}f(0,0) &=\lim_{t\to0}\frac{f(ta,tb)}{t},\\ &=\lim_{t\to0}\frac{a^2b}{t^2a^4+b^2},\\ &=\frac{a^2}{b}. \end{aligned} \]

if \(b=0\), the quotient is identically zero. Directional tests still miss curved approaches.

Uniqueness

Theorem 3.2.3: uniqueness of the derivative

Assumptions. \(x_0\) is an interior point of \(X\subseteq\mathbb R^n\) and \(f:X\to\mathbb R^m\) is differentiable at \(x_0\) with derivatives \(A\) and \(B\).

Conclusion. \(A=B\).

Proof strategy. Subtract the two expansions. For each \(v\in\mathbb R^n\), put \(h=tv\) and divide by \(|t|\) as \(t\to0\). The remainders vanish, leaving \((A-B)v=0\). Since this holds for every \(v\), \(A=B\).

Total differentiability implies continuity at an interior point. The converse fails, as \(|x|\) at zero shows.

Components and the Jacobian

Theorem 3.2.4: componentwise differentiability

Assumptions. Let \(X\subseteq\mathbb R^n\) be open, let \(x_0\in X\), and let \(f=(f_1,\ldots,f_m)^{\mathsf{T}}:X\to\mathbb R^m\).

Conclusion. \(f\) is differentiable at \(x_0\) if and only if every scalar component \(f_i\), \(i=1,\ldots,m\), is differentiable at \(x_0\). Moreover, \(f\) is \(C^1\) on \(X\) if and only if every \(f_i\) is \(C^1\) on \(X\).

Definition: Jacobian and \(C^1\)

Let \(X\subseteq\mathbb R^n\) be open and \(f:X\to\mathbb R^m\). If \(f\) is differentiable at \(x\in X\), its Jacobian at \(x\) is the \(m\times n\) matrix

\[ Df(x)=\left[\frac{\partial f_i}{\partial x_j}(x)\right]. \]

Here \(i=1,\ldots,m\) indexes outputs and \(j=1,\ldots,n\) indexes inputs.

The function is \(C^1\) on \(X\) if it is differentiable at every \(x\in X\) and \(Df:X\to\mathbb R^{m\times n}\) is continuous.

Partial derivatives and the Jacobian

Assumptions. Let \(X\subseteq\mathbb R^n\) be open, let \(x_0\in X\), and let \(f:X\to\mathbb R^m\). For the converse, suppose all coordinate partial derivatives of each component exist on a neighborhood of \(x_0\) and are continuous at \(x_0\).

Conclusion. If \(f\) is differentiable at \(x_0\), all its coordinate partial derivatives exist there and \(Df(x_0)\) is its Jacobian. Under the converse assumption, \(f\) is differentiable at \(x_0\).

Continuous partials are sufficient, not necessary: differentiability can occur even when the derivative is not continuous.

3. Composition and restricted directions

Definition 3.2.6: directional derivative

Let \(X\subseteq\mathbb R^n\), let \(x_0\in\operatorname{int}X\), let \(f:X\to\mathbb R^m\), and let \(v\in\mathbb R^n\). The directional derivative in the instructor’s convention is the one-sided limit

\[D_v^+f(x_0)=\lim_{t\downarrow0}\frac{f(x_0+tv)-f(x_0)}{t},\]

when the limit exists. The parameter approaches \(0\) from the positive side, so \(v\) and \(-v\) are distinct directions.

Two-sided directional derivative and partial derivative

Let \(X\subseteq\mathbb R^n\), let \(x_0\in\operatorname{int}X\), and let \(f:X\to\mathbb R^m\). A common alternative is the two-sided directional derivative

\[ D_v^{\pm}f(x_0)=\lim_{t\to0}\frac{f(x_0+tv)-f(x_0)}{t}, \]

when it exists. Under this convention, Definition 3.2.9’s partial derivative is the special case along the \(j\)th standard basis vector \(e_j\):

\[ \begin{aligned} \frac{\partial f}{\partial x_j}(x_0) &=D_{e_j}^{\pm}f(x_0),\\ &=\lim_{t\to0} \frac{f(x_0+te_j)-f(x_0)}{t}. \end{aligned} \]

It is an \(m\times1\) vector when \(f\) has \(m\) outputs.

The instructor’s directional derivative is one-sided. The two-sided alternative is stronger: \(D_v^{\pm}f(x_0)\) exists exactly when the corresponding one-sided derivatives in directions \(v\) and \(-v\) exist and satisfy \(D_v^+f(x_0)=-D_{-v}^+f(x_0)\). The rest of this page uses the two-sided convention whenever it writes \(D_v^{\pm}\). Partials examine only coordinate lines; total differentiability controls all directions and all curved approaches.

Theorem 3.2.5: chain rule

Assumptions. \(g:\mathbb R^n\to\mathbb R^m\) is differentiable at \(x_0\), and \(f:\mathbb R^m\to\mathbb R^\ell\) is differentiable at \(g(x_0)\).

Conclusion. \(f\circ g\) is differentiable at \(x_0\) and

\[D(f\circ g)(x_0)=Df(g(x_0))Dg(x_0).\]

Dimensions force the order:

\[ (\ell\times m)(m\times n)=\ell\times n. \]

The input displacement first passes through \(Dg(x_0)\), then through \(Df(g(x_0))\). Reversing the order generally is undefined and, when square, generally wrong.

Theorem 3.2.8: differentiability implies directional differentiability

Assumptions. Let \(X\subseteq\mathbb R^n\), let \(x_0\in\operatorname{int}X\), and let \(f:X\to\mathbb R^m\) be differentiable at \(x_0\).

Conclusion. For every \(v\in\mathbb R^n\), both the instructor’s one-sided directional derivative and the two-sided alternative exist, with

\[D_v^+f(x_0)=D_v^{\pm}f(x_0)=Df(x_0)v.\]

Because \(x_0\) is interior, \(x_0+tv\in X\) for all sufficiently small \(t\). Set \(h=tv\) in (D) and divide by \(t\); the resulting two-sided limit proves the second equality and therefore the one-sided one. This implication has no converse: the earlier counterexample has both partial derivatives but is not continuous.

Retrieval check. If \(g:\mathbb R^3\to\mathbb R^2\) and \(f:\mathbb R^2\to\mathbb R\), what are the dimensions of \(Dg\), \(Df\), and \(D(f\circ g)\)?

\(Dg\) is \(2\times3\), \(Df\) is \(1\times2\), and \(D(f\circ g)=Df\,Dg\) is \(1\times3\).

4. Local inversion and implicit equations

The derivative of \(F:\mathbb R^n\to\mathbb R^n\) describes whether nearby input directions are crushed together. If \(DF(x_0)\) is invertible, no nonzero first-order direction is lost. The inverse function theorem turns that local linear fact into a local nonlinear inverse.

Theorem 3.2.14: inverse function theorem

Assumptions. \(X\subseteq\mathbb R^n\) is open; \(F:X\to\mathbb R^n\) is \(C^1\); and \(DF(x_0)\) is invertible for \(x_0\in X\).

Conclusion. There are open neighborhoods \(U\subseteq X\) of \(x_0\) and \(V\subseteq\mathbb R^n\) of \(F(x_0)\) such that \(F:U\to V\) is bijective. Its inverse is \(C^1\), and

\[D(F^{-1})(F(x_0))=[DF(x_0)]^{-1}.\]

The word “local” matters. \(F(x)=x^2\) has nonzero derivative at \(x_0=1\) and is invertible on a small interval around \(1\), but it is not one-to-one on all of \(\mathbb R\). At \(x_0=0\), the derivative is singular and the theorem gives no inverse.

Theorem 3.2.15: implicit function theorem

Let \(F:X\to\mathbb R^m\) be \(C^1\) on an open \(X\subseteq\mathbb R^{n+m}\). Write a point as \((x,y)\) with \(x\in\mathbb R^n\) and \(y\in\mathbb R^m\).

Assumptions. \(F(x^*,y^*)=0\), \((x^*,y^*)\in X\), and the \(m\times m\) block \(D_yF(x^*,y^*)\) is invertible.

Conclusion. There are neighborhoods \(U\) of \(x^*\) and \(V\) of \(y^*\) and a unique \(C^1\) function \(g:U\to V\) with \(g(x^*)=y^*\) such that:

  • \(F(x,g(x))=0\) for every \(x\in U\);
  • if \((x,y)\in U\times V\) and \(F(x,y)=0\), then \(y=g(x)\).

For every \(x\in U\), its derivative is

\[ Dg(x)=-[D_yF(x,g(x))]^{-1}D_xF(x,g(x)). \]

Proof strategy. Apply the inverse function theorem to \(H(x,y)=(x,F(x,y))\). Its block Jacobian has determinant determined by \(D_yF\). Invert \(H\) locally, then read its \(y\) component as \(g(x)\).

Example: an equilibrium response

Let \(F(x,y)=y^2+x-4\). At \((x^*,y^*)=(0,2)\), \(F=0\) and \(D_yF=2\ne0\). Thus \(y=g(x)=\sqrt{4-x}\) locally and

\[g'(x)=-[D_yF]^{-1}D_xF=-\frac1{2\sqrt{4-x}}.\]

At \((4,0)\), \(D_yF=0\). There is no differentiable single-valued branch through that point: \(y=\pm\sqrt{4-x}\) has a vertical tangent there.

5. Gradient, Hessian, and mixed partials

Definition 3.2.16: gradient

For differentiable \(f:X\subseteq\mathbb R^n\to\mathbb R\), define the column gradient

\[ \nabla f(x)= \begin{pmatrix} \dfrac{\partial f}{\partial x_1}(x)\\ \vdots\\ \dfrac{\partial f}{\partial x_n}(x) \end{pmatrix} \in\mathbb R^n. \]

The derivative is the row matrix \(Df(x)=\nabla f(x)^{\mathsf{T}}\), so \(Df(x)h=\nabla f(x)^{\mathsf{T}}h\) is a scalar.

For a unit vector \(v\), Cauchy–Schwarz gives \(|D_v^{\pm}f(x)|=|\nabla f(x)^{\mathsf{T}}v|\le\|\nabla f(x)\|\). The upper bound is attained at \(v=\nabla f(x)/\|\nabla f(x)\|\) when the gradient is nonzero. Thus the gradient gives the direction of fastest first-order increase. If \(f\) is \(C^1\) and \(\nabla f(x)\ne0\), it is normal to the regular level set through \(x\).

Definition: Hessian and \(C^2\)

If \(f:X\to\mathbb R\) is \(C^1\) on open \(X\subseteq\mathbb R^n\) and \(Df\) is differentiable at \(x\), the Hessian is the \(n\times n\) matrix

\[ D^2f(x)=\left[\frac{\partial^2 f}{\partial x_i\partial x_j}(x)\right]. \]

The row and column indices satisfy \(i,j=1,\ldots,n\).

The function is \(C^2\) if \(D^2f\) exists and is continuous on \(X\).

Clairaut’s theorem (Theorem 3.2.18)

Assumptions. \(X\subseteq\mathbb R^n\) is open and \(f:X\to\mathbb R\) is \(C^2\).

Conclusion. For every \(i,j\),

\[\frac{\partial^2 f}{\partial x_i\partial x_j} =\frac{\partial^2 f}{\partial x_j\partial x_i}.\]

Hence \(D^2f(x)\) is symmetric.

Continuity of the relevant second partials is a sufficient condition for interchanging their order. Without it, mixed partials can exist and differ. Symmetry is essential when interpreting \(v^{\mathsf{T}}D^2f(x)v\) as curvature.

Assumption audit: what each object needs
Claim Regularity needed What it does not say
A partial exists a one-axis limit total differentiability
\(Df(x)\) exists remainder condition (D) \(Df\) is continuous
\(f\in C^1\) \(Df\) continuous \(D^2f\) exists
mixed partials commute \(f\in C^2\) they commute under arbitrary existence
IFT conclusion open domain, \(C^1\), square invertible derivative global invertibility

Proof and calculation blueprints

To prove differentiability at \(x_0\)

  1. State a candidate linear map \(A\) with dimensions \(m\times n\).
  2. Expand \(f(x_0+h)-f(x_0)-Ah\).
  3. Bound its norm by \(o(\|h\|)\), then divide by \(\|h\|\).
  4. Conclude using the exact limit in (D).

To use the chain rule or implicit function theorem

  1. Write domains and codomains, then the Jacobian dimensions.
  2. Evaluate derivatives at the correct point, especially \(g(x_0)\) in a composition.
  3. For IFT, verify \(F(x^*,y^*)=0\) and invertibility of the \(D_yF\) block.
  4. State a local neighborhood conclusion before writing the derivative formula.

Exit tickets

  1. Give a function with all coordinate partial derivatives at the origin but no continuity there. Which implication does it refute?
  2. For \(F(x,y)=y^3+xy-1\), find the condition at \((x^*,y^*)\) that lets one solve locally for \(y\) as a function of \(x\).
  3. Explain why a Hessian need not be symmetric if one has not established the hypotheses of Clairaut’s theorem.
  1. The earlier \(x^2y/(x^4+y^2)\) example works. It refutes partial derivatives \(\Rightarrow\) continuity or differentiability. 2. Require \(F(x^*,y^*)=0\) and \(D_yF=3(y^*)^2+x^*\ne0\). 3. Equality of mixed partials needs regularity such as \(C^2\); existence alone does not license the swap.

Mastery checklist

Back to top