---
title: The inverse and implicit function theorems
heading: When an equation defines one variable as a function of another, and how fast it changes
eyebrow: A14 · Lesson 44 · The inverse and implicit function theorems
xp: 40
---

::: hook
A diode in series with a resistor: as the supply voltage changes, how does the diode's voltage change? There's no formula for $V_D$ in terms of the supply; the circuit only gives an equation linking them. The **implicit function theorem** says that, as long as a certain derivative isn't zero, that equation still defines $V_D$ as a smooth function of the supply, and it gives the derivative directly. That derivative is the small-signal gain. The same theorem underlies sensitivity analysis, explains when Newton's method behaves near a root, and marks the exact points where a system can jump, like a Schmitt trigger's thresholds.
:::

::: play
- The curve shows the supply voltage needed for each diode voltage: $V_s = V_D + RI_s(e^{V_D/nV_T} - 1)$, with R = 1 kΩ. That's explicit in $V_D$; the circuit question needs it the other way round.
- Its slope $\frac{dV_s}{dV_D} = 1 + Rg_d$ is never zero, so by the inverse function theorem $V_D$ is a smooth function of $V_s$ with slope $\frac{1}{1 + Rg_d}$ (readout), with no formula for the function itself needed.
- At the marked point the diode conducts a few milliamps and the gain is tiny: changing the supply barely moves $V_D$.
:::
:::

```sim plot
view: graph
x: v = 0.45..0.75 V
y: s = 0..12 V
slider: v0 = 0.45..0.74 step 0.005 = 0.68 V
plot: v + 1000*1e-14*(exp(v/0.02585) - 1) | label: supply needed, Vs(V_D)
marker: v = v0 | label: V_D
readout: supply at this point, V = v0 + 1000*1e-14*(exp(v0/0.02585) - 1)
readout: dVs/dV_D = 1 + 1000*1e-14/0.02585*exp(v0/0.02585)
readout: small-signal gain dV_D/dVs = 1/(1 + 1000*1e-14/0.02585*exp(v0/0.02585))
```

::: predict
## $f(x) = x^3 + x$ has an inverse. What's the slope of the inverse at y = 2 (where x = 1)?

- [ ] 4
- [x] $\frac14$
- [ ] 2
- [ ] $\frac12$

::: reveal
$\frac14$: $f'(1) = 3 + 1 = 4$, and the inverse's slope is the reciprocal, $\frac{1}{f'(x)}$ at the matching x. You never need a formula for $f^{-1}$, which here would be messy.
:::
:::

::: nameit
## The inverse function theorem

If f is continuously differentiable near a and $f'(a) \ne 0$, then near a, f has a differentiable inverse with

$$(f^{-1})'(f(a)) = \frac{1}{f'(a)}$$

In n dimensions: if the Jacobian matrix $J_f(a)$ is invertible, f is invertible near a and $J_{f^{-1}} = J_f^{-1}$. Where det J = 0 (polar coordinates at r = 0), local invertibility can fail.

## The implicit function theorem

If $F(x, y) = 0$ at a point, F is continuously differentiable, and $\frac{\partial F}{\partial y} \ne 0$ there, then near that point the equation defines y as a differentiable function of x, with

$$\frac{dy}{dx} = -\frac{\partial F/\partial x}{\partial F/\partial y}$$

With many equations $F(x, y) = 0$ for a vector y, the condition is that the Jacobian $\partial F/\partial y$ is invertible, and $\frac{dy}{dx} = -\left(\frac{\partial F}{\partial y}\right)^{-1}\frac{\partial F}{\partial x}$.

## In circuits

A circuit's DC equations are $F(v, p) = 0$, with node voltages v and parameters p (supplies, resistor values). The theorem says the operating point moves smoothly with the parameters wherever the Jacobian $\partial F/\partial v$, the matrix Newton's method factors, is invertible, and gives the sensitivities $\frac{\partial v}{\partial p}$ by one more linear solve. Where it's singular, the operating point can jump or split: the thresholds of a latch or a Schmitt trigger.
:::

::: example
## A 1 kΩ resistor feeds a diode at 4.31 mA ($V_D$ = 0.6925 V). What's $\frac{dV_D}{dV_s}$?

::: solution
1. **Write the circuit as F = 0.**
   $$\begin{aligned} F(V_D, V_s) &= \frac{V_s - V_D}{R} \\ &\quad - I_s(e^{V_D/nV_T} - 1) \\ &= 0 \end{aligned}$$
2. **Partials.**
   $$\frac{\partial F}{\partial V_s} = \frac1R$$
   $$\frac{\partial F}{\partial V_D} = -\frac1R - g_d$$
   with $g_d = I/nV_T = 0.167$ S.
3. **Implicit derivative.**
   $$\begin{aligned} \frac{dV_D}{dV_s} &= \frac{1/R}{1/R + g_d} \\ &= \frac{1}{1 + Rg_d} \\ &= \frac{1}{168} \\ &= 0.0060 \end{aligned}$$
4. **What it means.** A 1 V change in supply moves the diode by 6 mV.

**Answer:** $\frac{dV_D}{dV_s} = 0.0060$: a 1 V change in supply moves the diode voltage by 6 mV.
:::
:::

::: example
## On the circle $x^2 + y^2 = 25$, find $\frac{dy}{dx}$ at (3, 4), and say where the theorem fails.

::: solution
1. **Set up F.**
   $$F = x^2 + y^2 - 25$$
2. **Implicit derivative.**
   $$\begin{aligned} \frac{dy}{dx} &= -\frac{2x}{2y} \\ &= -\frac34 \end{aligned}$$
3. **Where the theorem fails.** It fails where $\partial F/\partial y = 2y = 0$, at (±5, 0): there the circle is vertical and isn't the graph of a function of x.

**Answer:** $\frac{dy}{dx} = -\frac34$ at (3, 4), and the theorem fails at (±5, 0).
:::
:::

::: example
## Near (1, 1), $F(x, y) = x^2 + xy + y^3 - 3 = 0$ defines y as a function of x. Find dy/dx there.

::: solution
1. **Check the hypotheses.** $F(1, 1) = 0$, and $F_y = x + 3y^2$ is $4 \ne 0$ there, so the implicit function theorem applies.
2. **Differentiate.** Differentiating $F(x, y(x)) = 0$ gives
   $$F_x + F_yy' = 0$$
3. **Solve for y'.**
   $$\begin{aligned} y' &= -\frac{F_x}{F_y} \\ &= -\frac{2x + y}{x + 3y^2} \\ &= -\frac34 \end{aligned}$$
4. **What the theorem gives.** It guarantees that y(x) exists and is smooth near x = 1 without solving the cubic.
5. **Where it would fail.** Where $F_y = 0$, that is, where $x = -3y^2$: there the curve can have a vertical tangent or branch.

**Answer:** $\frac{dy}{dx} = -\frac34$ at (1, 1).
:::
:::

::: check
given: a = 1 | 2 | 0.5
answer: 1/(3*a^2 + 1)
tolerance: 0.1%

## For $f(x) = x^3 + x$, what's the slope of $f^{-1}$ at y = f({a})?

::: right
Right. $\frac{1}{f'(a)} = \frac{1}{3a^2 + 1}$ = {answer}.
:::

::: misses
- [3*a^2 + 1] That's f′; the inverse's slope is its reciprocal.
- [any] Not yet. $(f^{-1})' = 1/f'$ at the matching point.
:::
:::

::: check
given: x = 3 | 5 | 1; y = 4 | 12 | 2
answer: -x/y
tolerance: 0.1%

## On the circle through ({x}, {y}) centered at the origin, what's dy/dx there?

::: right
Right. $-\frac xy$ = {answer}.
:::

::: misses
- [-y/x] It's $-\frac{F_x}{F_y} = -\frac{2x}{2y}$.
- [any] Not yet. Differentiate $x^2 + y^2 = r^2$ implicitly.
:::
:::

::: check
given: I = 1 | 4.31 | 10; R = 1000 | 220
answer: 1/(1 + R*I/1000/0.02585)
tolerance: 0.1%

## A diode carries {I} mA ($nV_T$ = 25.85 mV) fed through {R} Ω from a supply. What's $\frac{dV_D}{dV_s}$?

::: right
Right. $\frac{1}{1 + Rg_d}$ with $g_d = I/nV_T$: {answer}.
:::

::: misses
- [1/(R*I/1000/0.02585)] Include the 1: it's $\frac{1/R}{1/R + g_d}$.
- [any] Not yet. Implicit differentiation of the KCL equation.
:::
:::

::: check
given: x = 1 | 2; y = 1 | 2
answer: -y/(x + exp(y))
tolerance: 0.1%

## $F(x, y) = xy + e^y - c$ defines y as a function of x near ({x}, {y}). What's dy/dx there?

::: right
Right. $-\frac{F_x}{F_y} = -\frac{y}{x + e^y}$ = {answer}.
:::

::: misses
- [any] Not yet. $F_x = y$, $F_y = x + e^y$.
:::
:::

::: check
given: r = 0.5 | 2 | 10
answer: r
tolerance: 0.1%

## What's the Jacobian determinant of the polar map $(r, \theta) \mapsto (r\cos\theta, r\sin\theta)$ at r = {r}?

::: right
Right. det J = r = {answer}: invertible except at the origin.
:::

::: misses
- [1] The determinant depends on r.
- [any] Not yet. $\det\begin{pmatrix}\cos\theta & -r\sin\theta\\ \sin\theta & r\cos\theta\end{pmatrix}$.
:::
:::

::: check
kind: choice

## Near which point does $x^2 - y^3 = 0$ fail to define y as a differentiable function of x?

- [ ] (1, 1)
- [ ] (8, 4)
- [x] (0, 0)
- [ ] It never fails

::: misses
- [1] There $\partial F/\partial y = -3 \ne 0$.
- [2] There $\partial F/\partial y = -48 \ne 0$.
- [4] At the origin $\partial F/\partial y = -3y^2 = 0$, and indeed $y = x^{2/3}$ has a vertical tangent there.
:::
:::

::: check
kind: parts
given: x = 1 | 2; y = 1 | 0.5

## $F(x, y) = x^2 + xy + y^3 - c$, with c chosen so F passes through ({x}, {y}).

::: part
answer: x + 3*y^2
tolerance: 0.5%

### What is $F_y$ there?

::: misses
- [any] $\partial_y(xy + y^3) = x + 3y^2$.
:::
:::

::: part
answer: -(2*x + y)/(x + 3*y^2)
tolerance: 0.5%

### What is dy/dx along the curve?

::: misses
- [(2*x + y)/(x + 3*y^2)] Check the sign: $y' = -F_x/F_y$.
- [any] $-\frac{F_x}{F_y}$.
:::
:::
:::

::: check
kind: derivation
vars: a = -2..2

## $f(x) = x^3 + x$ has an inverse g.

::: step
answer: 1/(3*a^2 + 1)

### What is $g'(f(a))$?
:::

::: step
answer: -6*a/(3*a^2 + 1)^3

### What is $g''(f(a))$, using $g'' = -\frac{f''}{f'^3}$?
:::

::: right
Right. The inverse function theorem gives the inverse's derivatives without inverting.
:::
:::

::: explain
## Why does the implicit function theorem give a circuit's small-signal gain without solving the circuit again?

::: model
At the operating point, the circuit's equations $F(v, p) = 0$ hold. If a parameter p changes slightly, the operating point must change so the equations still hold, and to first order the change satisfies $\frac{\partial F}{\partial v}\Delta v + \frac{\partial F}{\partial p}\Delta p = 0$. When the Jacobian $\frac{\partial F}{\partial v}$ is invertible, this has the unique solution $\Delta v = -\left(\frac{\partial F}{\partial v}\right)^{-1}\frac{\partial F}{\partial p}\Delta p$: the sensitivities, or small-signal gains. That Jacobian is exactly the linearized circuit (diodes as conductances $g_d$), so one linear solve of the small-signal circuit gives every sensitivity, without re-solving the nonlinear equations.
:::
:::

::: practice

::: check
given: a = 0.2 | 0.5 | 1 | 2 | 3 | 5
answer: 1/(3*a^2 + 1)
tolerance: 0.1%

## Slope of the inverse of $x^3 + x$ at f({a})?

::: misses
- [any] $\frac{1}{3a^2 + 1}$.
:::
:::

::: check
given: I = 0.5 | 20; R = 470 | 3300
answer: 1/(1 + R*I/1000/0.02585)
tolerance: 0.5%

## $\frac{dV_D}{dV_s}$ at {I} mA through {R} Ω?

::: misses
- [any] $\frac{1}{1 + Rg_d}$.
:::
:::

::: check
given: x = 8 | 6; y = 6 | 8
answer: -x/y
tolerance: 0.1%

## dy/dx on the circle at ({x}, {y})?

::: misses
- [any] $-x/y$.
:::
:::
:::
