Lecture 3: The Chain Rule and Higher Derivatives
KSM3E04: Analysis on Manifolds — Fall 2025 | August 18, 4:00–5:30 PM
In our last lecture, we established a robust definition for the derivative of a function $f:\mathbf{R}^n \to \mathbf{R}^m$ and noted that the existence of all directional derivatives at a point is not sufficient to guarantee differentiability. This motivates the search for a stronger, more practical condition. A natural question arises: is there a simpler condition that guarantees differentiability?
The answer lies in the behavior of the partial derivatives. We will see that if the partial derivatives not only exist but are also continuous, then the total derivative is guaranteed to exist. This provides a practical pathway to establishing differentiability for a vast class of functions.
Building on this, we will generalize one of the cornerstone theorems of single-variable calculus: the Chain Rule. This will allow us to differentiate compositions of functions. Finally, we will venture into the territory of higher-order derivatives, introducing notation that will be indispensable as we move toward the study of smooth manifolds.
1. Continuous Differentiability
In Lecture 2, we saw that the existence of partial derivatives alone is not enough to ensure a function is differentiable. However, adding the condition of continuity changes the story completely.
Definition 1 (Continuously Differentiable).
A function $f:U \to \mathbf{R}^m$ defined on an open set $U \subseteq \mathbf{R}^n$ is said to be continuously differentiable at a point $a \in U$ if all partial derivatives $\frac{\partial f^i}{\partial x^j}$ exist in an open set containing $a$ and are continuous at $a$. If this holds for all $a \in U$, we say $f$ is continuously differentiable on $U$, or that $f$ is of class $\mathcal{C}^1$.
This condition provides a powerful, practical test for differentiability.
Theorem 1 (Sufficient Condition for Differentiability).
Let $U \subseteq \mathbf{R}^n$ be an open set and $f: U \to \mathbf{R}^m$. If all partial derivatives $D_j f^i(x)$ exist on $U$ and are continuous at a point $a \in U$, then $f$ is differentiable at $a$.
Proof
We can prove this component-wise, so it suffices to consider the case $m=1$, where $f: U \to \mathbf{R}$. Let $a \in U$ and let $h$ be a small displacement vector such that $a+h \in U$. The key idea is to write the total change $f(a+h) - f(a)$ as a telescoping sum:
\[ \begin{align*} f(a+h) - f(a) = & \; f(a^1+h^1, a^2+h^2, \dots, a^n+h^n) - f(a^1, a^2, \dots, a^n) \\ = & \; \big[ f(a^1+h^1, a^2, \dots, a^n) - f(a^1, \dots, a^n) \big] \\ & + \big[ f(a^1+h^1, a^2+h^2, \dots, a^n) - f(a^1+h^1, a^2, \dots, a^n) \big] \\ & + \dots \\ & + \big[ f(a^1+h^1, \dots, a^n+h^n) - f(a^1+h^1, \dots, a^{n-1}+h^{n-1}, a^n) \big]. \end{align*} \]For each difference in brackets, we can apply the one-dimensional Mean Value Theorem. For the first term, we have:
\[ f(a^1+h^1, a^2, \dots, a^n) - f(a^1, \dots, a^n) = h^1 \cdot D_1 f(c_1, a^2, \dots, a^n) \]for some $c_1$ between $a^1$ and $a^1+h^1$. Applying this to each term, we get:
\[ f(a+h) - f(a) = \sum_{j=1}^n h^j \cdot D_j f(p_j) \]where $p_j$ is a point on the line segment between the relevant intermediate points. As $h \to 0$, each point $p_j \to a$. Since each partial derivative $D_j f$ is continuous at $a$, we have $D_j f(p_j) \to D_j f(a)$. Let $L$ be the linear map whose matrix is the Jacobian at $a$. Then
\[ \frac{\|f(a+h) - f(a) - L(h)\|}{\|h\|} = \frac{\|\sum_{j=1}^n h^j (D_j f(p_j) - D_j f(a))\|}{\|h\|} \le \sum_{j=1}^n \frac{|h^j|}{\|h\|} \|D_j f(p_j) - D_j f(a)\|. \]Since $|h^j|/\|h\| \le 1$ and $\|D_j f(p_j) - D_j f(a)\| \to 0$ as $h \to 0$, the entire expression goes to 0. Thus, $f$ is differentiable at $a$.
2. The Chain Rule in Higher Dimensions
The chain rule is a fundamental tool for differentiating composite functions. Its generalization to higher dimensions is one of the most elegant results in multivariable calculus.
Theorem 2 (The Chain Rule).
Let $f: U \to \mathbf{R}^m$ be differentiable at $a \in U$ (where $U \subseteq \mathbf{R}^n$ is open), and let $g: V \to \mathbf{R}^p$ be differentiable at $f(a) \in V$ (where $V \subseteq \mathbf{R}^m$ is open). Then the composite function $g \circ f: U \to \mathbf{R}^p$ is differentiable at $a$, and its derivative is the composition of the individual derivatives:
In terms of Jacobian matrices, this is simply matrix multiplication: $J_{g \circ f}(a) = J_g(f(a)) \cdot J_f(a)$.
Proof
Let $b = f(a)$, $\lambda = Df(a)$, and $\mu = Dg(b)$. By definition of the derivative, we can define error functions $\varphi(x)$ and $\psi(y)$ such that:
\[ f(x) - f(a) = \lambda(x-a) + \varphi(x) \quad \text{where} \quad \lim_{x\to a} \frac{\|\varphi(x)\|}{\|x-a\|} = 0. \] \[ g(y) - g(b) = \mu(y-b) + \psi(y) \quad \text{where} \quad \lim_{y\to b} \frac{\|\psi(y)\|}{\|y-b\|} = 0. \]We want to analyze the error for the composition $g \circ f$. Let's substitute:
\[ \begin{align*} g(f(x)) - g(f(a)) &= \mu(f(x) - f(a)) + \psi(f(x)) \\ &= \mu(\lambda(x-a) + \varphi(x)) + \psi(f(x)) \\ &= (\mu \circ \lambda)(x-a) + \mu(\varphi(x)) + \psi(f(x)). \end{align*} \]The term $(\mu \circ \lambda)(x-a)$ is our candidate for the derivative. The remaining part is the error: $E(x) = \mu(\varphi(x)) + \psi(f(x))$. We must show that $\lim_{x\to a} \frac{\|E(x)\|}{\|x-a\|} = 0$.
By the triangle inequality, it suffices to show that each part of the error term vanishes when divided by $\|x-a\|$. First, consider $\mu(\varphi(x))$:
\[ \frac{\|\mu(\varphi(x))\|}{\|x-a\|} \le \frac{\|\mu\| \|\varphi(x)\|}{\|x-a\|} = \|\mu\| \left(\frac{\|\varphi(x)\|}{\|x-a\|}\right). \]As $x \to a$, the term in parentheses goes to 0, so this part of the error vanishes.
Next, consider $\psi(f(x))$. Since $f$ is differentiable at $a$, it is also continuous at $a$, so $f(x) \to f(a)=b$ as $x \to a$. We have:
\[ \frac{\|\psi(f(x))\|}{\|x-a\|} = \frac{\|\psi(f(x))\|}{\|f(x)-f(a)\|} \cdot \frac{\|f(x)-f(a)\|}{\|x-a\|}. \]The first factor, $\frac{\|\psi(f(x))\|}{\|f(x)-f(a)\|}$, goes to 0 as $x \to a$ because $f(x) \to b$. For the second factor, we have:
\[ \frac{\|f(x)-f(a)\|}{\|x-a\|} = \frac{\|\lambda(x-a) + \varphi(x)\|}{\|x-a\|} \le \frac{\|\lambda\|\|x-a\| + \|\varphi(x)\|}{\|x-a\|} = \|\lambda\| + \frac{\|\varphi(x)\|}{\|x-a\|}. \]As $x \to a$, this term approaches $\|\lambda\|$, so it is bounded for $x$ near $a$. Since we have a term that goes to 0 multiplied by a bounded term, their product goes to 0. Therefore, both parts of the error vanish as required, and the proof is complete.
3. Higher-Order Derivatives
If a function $f:U \to \mathbf{R}^m$ is differentiable on an open set $U$, its derivative $Df$ is a map from $U$ to the space of linear maps $L(\mathbf{R}^n, \mathbf{R}^m)$. We can ask if this map is itself differentiable. This leads to the idea of higher-order derivatives. Since the differentiability of $f$ is determined entirely by its component functions, it suffices to first build the theory for real-valued functions before extending it to the vector-valued case.
Higher Partials of Real-Valued Functions
Let $f: U \to \mathbf{R}$ be defined on an open set $U \subseteq \mathbf{R}^n$. If the partial derivative $\frac{\partial f}{\partial x^j}$ exists on $U$, it is another function from $U$ to $\mathbf{R}$. We can then attempt to take its partial derivative with respect to another variable $x^i$. If this exists, we call it a second-order partial derivative, denoted by:
This process can be iterated. A partial derivative of order $k$ is obtained by taking a partial derivative of a partial derivative of order $k-1$. This leads to a hierarchy of smoothness for functions.
- A function is of class $\mathcal{C}^k$ if all its partial derivatives up to order $k$ exist and are continuous.
- A function is of class $\mathcal{C}^\infty$, or smooth, if it is of class $\mathcal{C}^k$ for every $k \ge 0$.
Theorem 3 (Clairaut's Theorem on Equality of Mixed Partials).
Let $f: U \to \mathbf{R}$ be defined on an open set $U \subseteq \mathbf{R}^n$. If the partial derivatives $\frac{\partial^2 f}{\partial x^i \partial x^j}$ and $\frac{\partial^2 f}{\partial x^j \partial x^i}$ exist and are continuous on $U$, then they are equal:
Proof
For simplicity, let $n=2$ and consider a point $(x,y) \in U$. Let $h, k$ be small enough that the rectangle with corners $(x,y)$ and $(x+h, y+k)$ is in $U$. Define the second-order difference operator:
\[ \Delta(h,k) = f(x+h, y+k) - f(x+h, y) - f(x, y+k) + f(x,y). \]Let $\phi(t) = f(t, y+k) - f(t, y)$. Then $\Delta(h,k) = \phi(x+h) - \phi(x)$. By the Mean Value Theorem, there exists a $\theta_1 \in (0,1)$ such that:
\[ \Delta(h,k) = h \phi'(x+\theta_1 h) = h \left( \frac{\partial f}{\partial x}(x+\theta_1 h, y+k) - \frac{\partial f}{\partial x}(x+\theta_1 h, y) \right). \]Now, applying the Mean Value Theorem to the function $g(t) = \frac{\partial f}{\partial x}(x+\theta_1 h, t)$, there exists a $\theta_2 \in (0,1)$ such that:
\[ \Delta(h,k) = h k \frac{\partial^2 f}{\partial y \partial x}(x+\theta_1 h, y+\theta_2 k). \]By a symmetric argument, defining $\psi(t) = f(x+h, t) - f(x, t)$, we can also show there exist $\theta_3, \theta_4 \in (0,1)$ such that:
\[ \Delta(h,k) = k h \frac{\partial^2 f}{\partial x \partial y}(x+\theta_3 h, y+\theta_4 k). \]Equating the two expressions for $\Delta(h,k)$ and dividing by $hk$ (for $h,k \neq 0$), we get:
\[ \frac{\partial^2 f}{\partial y \partial x}(x+\theta_1 h, y+\theta_2 k) = \frac{\partial^2 f}{\partial x \partial y}(x+\theta_3 h, y+\theta_4 k). \]Taking the limit as $(h,k) \to (0,0)$ and using the continuity of the second partial derivatives, we obtain the desired equality at $(x,y)$.
By repeated application of Clairaut's Theorem, if a function is of class $\mathcal{C}^k$, the order of differentiation does not matter for any partial derivative up to order $k$. This justifies the use of multi-index notation to simplify expressions for higher-order derivatives. A multi-index $\alpha$ is an n-tuple of non-negative integers, $\alpha = (\alpha_1, \alpha_2, \dots, \alpha_n)$. We define:
For example, if $n=3$ and $\alpha=(2,1,0)$, then $D^\alpha f = \frac{\partial^3 f}{(\partial x^1)^2 \partial x^2}$.
The Vector-Valued Case
For a vector-valued function $f: U \to \mathbf{R}^m$, with component functions $f = (f^1, \dots, f^m)$, the partial derivative $\frac{\partial f}{\partial x^j}$ is formally the column vector:
Note that this is the $j$-th column of the Jacobian matrix $J_f(a)$. For convenience, we will often identify this column with a vector in $\mathbf{R}^m$. Higher-order partial derivatives are defined similarly by applying the differentiation component-wise. Consequently, we say $f$ is of class $\mathcal{C}^k$ if and only if each of its component functions $f^i: U \to \mathbf{R}$ is of class $\mathcal{C}^k$. In this course, we will primarily be concerned with smooth functions ($\mathcal{C}^\infty$), as they form the natural setting for the study of manifolds.
4. Geometric Applications: The Hessian and Local Defining Functions
The calculus of higher derivatives provides powerful tools for describing geometric sets analytically. A key concept in this area is the ability to define a domain's boundary as the zero-set of a smooth function, which provides a concrete analytical handle on the geometry of the set.
Definition 2 (Local Defining Function).
A function $r: U \to \mathbf{R}$ defined on a neighborhood $U$ of a point $p \in \partial \Omega$ (where $\Omega \subset \mathbf{R}^n$ is an open set) is a local defining function for $\Omega$ near $p$ if
and its derivative does not vanish on the boundary:
The second derivatives of this function then reveal information about the curvature of the boundary.
Definition 3 (The Hessian Matrix).
For a real-valued function $f: U \to \mathbf{R}$ of class $\mathcal{C}^2$, the Hessian matrix of $f$ at a point $a \in U$ is the $n \times n$ matrix of its second-order partial derivatives:
By Clairaut's theorem, if $f$ is $\mathcal{C}^2$, the Hessian matrix is symmetric.
The Hessian of a local defining function $r$ at a point on the boundary $\partial \Omega$ captures a great deal of geometric information about the domain, such as its local convexity and curvature. This connection between analysis and geometry is a central theme in the study of manifolds.
5. Problems for Practice
Exercise 1: Applying the Chain Rule
Let $f: \mathbf{R}^2 \to \mathbf{R}^3$ be given by $f(x,y) = (x^2, y^2, xy)$ and $g: \mathbf{R}^3 \to \mathbf{R}$ be given by $g(u,v,w) = u+v-w$. Let $h = g \circ f$.
- Compute the Jacobian matrices $J_f(x,y)$ and $J_g(u,v,w)$.
- Use the chain rule to find the Jacobian of $h$ at the point $(1,2)$.
- Compute $h(x,y)$ explicitly and find its Jacobian directly to verify your answer.
Exercise 2: Mixed Partials
Let $f(x,y) = e^{x} \cos(y)$.
- Compute the four second-order partial derivatives: $\frac{\partial^2 f}{\partial x^2}$, $\frac{\partial^2 f}{\partial y^2}$, $\frac{\partial^2 f}{\partial x \partial y}$, and $\frac{\partial^2 f}{\partial y \partial x}$.
- Verify that the mixed partials are equal.
- Show that $f$ satisfies Laplace's equation: $\frac{\partial^2 f}{\partial x^2} + \frac{\partial^2 f}{\partial y^2} = 0$.
Exercise 3: A Pathological Function
Show that both partial derivatives of the function $$ f(x,y)=\begin{cases}\frac{xy}{x^{2}+y^{2}}& \text{if } (x,y)\ne(0,0)\\ 0& \text{if } (x,y)=(0,0)\end{cases} $$ exist at the origin, but the function is not differentiable there.
Exercise 4: Failure of Clairaut's Theorem
Show that all second partial derivatives of the function $f:\mathbf{R}^{2}\to\mathbf{R}$ defined by $$ f(x,y)=\begin{cases} \frac{xy(x^{2}-y^{2})}{x^{2}+y^{2}} & \text{if } (x,y)\ne(0,0) \\ 0 & \text{if } (x,y)=(0,0) \end{cases} $$ exist everywhere, but the mixed second partials are unequal at the origin, i.e., $\frac{\partial^2 f}{\partial x \partial y}(0,0) \ne \frac{\partial^2 f}{\partial y \partial x}(0,0)$. Why does this not contradict Clairaut's Theorem?
Exercise 5: Hadamard's Lemma
Let $f: \mathbf{R}^n \to \mathbf{R}$ be a $\mathcal{C}^1$ function with $f(0) = 0$.
- Show that there exist $\mathcal{C}^1$ functions $g_1, \dots, g_n$ such that $f(x) = \sum_{i=1}^n x_i g_i(x)$. (Hint: Consider the function $h(t) = f(tx)$ and use the Fundamental Theorem of Calculus.)
- Show that $g_i(0) = \frac{\partial f}{\partial x^i}(0)$.
Exercise 6: Vanishing Higher Derivatives
Let $f: \mathbf{R}^n \to \mathbf{R}$ be a $\mathcal{C}^\infty$ function.
- If $f$ and all of its partial derivatives of all orders vanish at the origin, does this imply that $f$ is the zero function? (Hint: Consider the function $f(x) = e^{-1/x^2}$ for $x \neq 0$ and $f(0)=0$ in one dimension.)
- What if $f$ is known to be real analytic (i.e., it has a convergent Taylor series in a neighborhood of every point)?