6.2 The Implicit Function Theorem
We saw before that the level set $f(x,y) = z$ defines a “contour” that can be plotted in $x-y$ space. Let’s derive the slope of such a contour, $dy/dx$. This will turn out to have important economic implications in a wide range of applications.
To derive this, we’ll need to start with the chain rule of calculus.
The chain rule
The most important rule of derivatives for this course is the chain rule; and it’s especially important to understand the intuition behind what it means, in addition to the mechanics of how to use it.
The mathematical formulation of the chain rule is this: if $h(x) = f(g(x))$, then \(\frac{dh}{dx} = \frac{df}{dg} \times \frac{dg}{dx}\) For example, suppose we have the function $h(x) = (3x + 2)^2$. We can rewrite this as $f(g(x))$ if \(f(g) = g^2\) \(g(x) = 3x + 2\) Therefore \(\frac{df}{dg} = 2g\) \(\frac{dg}{dx} = 3\) so we have \(\frac{dh}{dx} = \frac{df}{dg} \times \frac{dg}{dx} = 2(3x+2) \times 3 = 18x + 12\) Note that if we had expanded $h(x)$ into $9x^2 + 12x + 4$, we would have gotten this same result by taking the simple derivative.
The chain rule for multivariable functions
This same principle of multiplied rates is also true if the functions in question are multivariate. For example, the function \(h(x,y) = (3x + y)^2\) may be decomposed into \(f(g) = g^2\) \(g(x,y) = 3x + y\) so the partial derivatives of $h$ with respect to $x$ and $y$ would be \(\begin{aligned} {\partial h \over \partial x} &= {df \over dg} \times {\partial g \over \partial x} = 2(3x + y)\times 3 = 18x + 6y\\ {\partial h \over \partial y} &= {df \over dg} \times {\partial g \over \partial y} = 2(3x + y)\times 1 = 6x + 2y \end{aligned}\) Note that if we had just expanded the expression $(3x+y)^2$, we would have gotten exactly the same thing: \(\begin{aligned} h(x,y) = (3x + y)^2 &= 9x^2 + 6xy + y^2\\ {\partial h(x,y) \over \partial x} &= 18x + 6y\\ {\partial h(x,y) \over \partial y} &= 6x + 2y \end{aligned}\)
For more on this, Harvey Mudd College has a great explanation of how the multivariable chain rule works, which is well worth checking out.
The total derivative along a path
One application of this rule is the analysis of how altitude varies along a path over the surface of a multivariable function. For example, let’s consider how the height of the function $f(x,y)=12x^{1 \over 2}y$ changes along the path defined by $\textcolor{#31a354}{y(x) = 4 - 0.4x}$. We can draw that as a green line over the surface of a function, as shown below.
Think about moving by some amount $\Delta x$ along the path, from some point $\textcolor{#3182bd}{(x,y)}$ to a second point $\textcolor{#d62728}{(x + \Delta x, y + \Delta y)}$. We can decompose this overall change into two changes:
- holding $y$ constant, from $\textcolor{#3182bd}{(x,y)}$ to $\textcolor{#e6550d}{(x+\Delta x, y)}$
- holding $x$ constant, from $\textcolor{#e6550d}{(x+\Delta x, y)}$ to $\textcolor{#d62728}{(x + \Delta x, y + \Delta y)}$
If we think about this in terms of partial derivatives, we can approximate the change due to $\Delta x$ as the change in $f(x,y)$ per unit change in $x$ (i.e., the partial derivative with respect to $x$), multiplied by $\Delta x$: \(\left.\Delta f(x,y)\right|_{\Delta x} \approx {\partial f \over \partial x} \times \Delta x\) Likewise, the change due to $\Delta y$ as \(\left.\Delta f(x,y)\right|_{\Delta y} \approx {\partial f \over \partial y} \times \Delta y\) Therefore the total change is the sum of these two changes: \(\Delta f(x,y) \approx {\partial f \over \partial x} \times \Delta x + {\partial f \over \partial y} \times \Delta y\) If we divide both sides by $\Delta x$, this becomes \({\Delta f(x,y) \over \Delta x} \approx {\partial f \over \partial x} + {\partial f \over \partial y} \times {\Delta y \over \Delta x}\) As $\Delta x \rightarrow 0$ in the limit, $\Delta y/\Delta x$ approaches the derivative of $y$ with respect to $x$, giving us \(\left.{\partial f \over \partial x}\right|_{y = y(x)} = {\partial f \over \partial x} + {\partial f \over \partial y} \times {dy \over dx}\) This is really just the chain rule: if $y$ changes when $x$ changes, then the total change in $f$ when $x$ changes is the direct effect due to the change in $x$, plus the indirect effect of the change in $y$.
The slope along a level set
The above analysis holds for any path along the surface. We can look in particular at the same analysis for a level set, which is implicitly defined by the equation \(f(x,y) = z\) where $z$ is some constant.
Taking the derivative of both sides of this equation with respect to $x$ gives us \({\partial f \over \partial x} + {\partial f \over \partial y} \times {dy \over dx} = 0\) The left-hand side of the equation comes from the analysis above; the right-hand side is zero because $z$ is a constant. Intuitively, along a level set, we know that the total change is zero: however much $f(x,y)$ increases as a result of $\Delta x$, it decreases by the same amount as a result of $\Delta y$:
As $\Delta x \rightarrow 0$, the blue line becomes a line tangent to the function at the point $(x, y, z)$. This allows us to solve for the slope along a level set at a point, by solving for $dy/dx$: \(\left.{dy \over dx}\right|_{f(x,y) = z} = - {\partial f/\partial x \over \partial f/\partial y}\) We can see if we plot level sets and contour maps, that we can use this formula to define the slope of the level set passing through any point $(x, y, f(x,y))$:
Importantly, note that every point $(x,y)$ defines a level set, and therefore the slope of a level set. No matter where you drag the blue point in this diagram, it defines a purple curve, and there is a line tangent to that curve at that point. Put another way, we can think of the level set itself and the slope of the level set as functions of the point $(x,y)$: \(\begin{aligned} \text{Level set through }(\hat x, \hat y) &= \{(x,y) | f(x,y) = f(\hat x, \hat y)\}\\ \text{Slope of that level set at }(\hat x, \hat y) &= \left.{dy \over dx}\right|_{f(x,y) = f(\hat x, \hat y)} = -{\partial f(\hat x, \hat y)/\partial x \over \partial f(\hat x, \hat y)/\partial y} \end{aligned}\) These expressions will be incredibly important as we evaluate choices economic agents make, so be sure you are fluent in their applications.