Search

Search papers and lessons

Implicit Function Theorem

Level 2 · 10 min read

The implicit function theorem says that when an equation F(x, y) = 0 holds at a point and F changes with y there, the equation locally defines y as a function of x, and gives its slope without solving for y.

On this page

  • Colour = topic mix
  • Calculus
  • Discrete math
  • Linear algebra
  • ReadReady to readNot yet

TL;DR

Many relations are written as an equation that mixes the two variables, such as x2+y2=1x^2 + y^2 = 1, and never as "y=y = something". The implicit function theorem says that if such an equation holds at a point and the expression really depends on yy there, then near that point yy is a genuine function of xx. It also gives that function's slope from the partial derivatives alone, so you can find the slope without solving the equation.

Builds on: Jacobian Matrix · Leads to: bilevel optimisation and sensitivity analysis, where a solution of one equation is differentiated with respect to a parameter

Where it's used

Economics: how an equilibrium moves. A market clears when demand equals supply, which is one equation linking price and the factors that shift demand. The theorem tells you how the equilibrium price responds to a small change in income, without solving the market for the price first. Economists call this comparative statics.

Physics: the shape of a level set. The points where an energy function takes a fixed value form a curve, such as a circle or an ellipse. At any point of that curve, the theorem tells you the slope of the curve, which is the direction a particle on it must move to keep its energy fixed.

Machine learning: differentiating through a solution. When a model's output is defined by an equation that must be solved first, such as an optimisation or a fixed point, gradients with respect to the inputs can be found by differentiating that equation. This is how some hyperparameter-tuning methods and equilibrium models obtain gradients without unrolling the solver.

How it works

Take the circle x2+y2=1x^2 + y^2 = 1 and the point (x,y)=(0.6,0.8)(x, y) = (0.6, 0.8). We want the slope of yy with respect to xx there.

  1. Write the equation as F(x,y)=0F(x, y) = 0. Here FF is a function of two variables, F(x,y)=x2+y2−1F(x, y) = x^2 + y^2 - 1. Check: at (0.6,0.8)(0.6, 0.8) we get 0.36+0.64−1=00.36 + 0.64 - 1 = 0, so the point lies on the curve.
  2. Measure how FF changes with xx, holding yy fixed. This is the rate of change, the partial derivative Fx=2x=1.2F_x = 2x = 1.2 at the point.
  3. Measure how FF changes with yy, holding xx fixed. This is Fy=2y=1.6F_y = 2y = 1.6. It is not zero, which is the condition the theorem needs.
  4. Combine them into the slope. The theorem says dy/dx=−Fx/Fy=−1.2/1.6=−0.75dy/dx = -F_x / F_y = -1.2 / 1.6 = -0.75. Check: the circle goes down as xx grows here, which matches a negative slope.
  5. Confirm by solving once. Near this point y=1−x2y = \sqrt{1 - x^2}, whose derivative is −x/1−x2=−0.6/0.8=−0.75-x / \sqrt{1 - x^2} = -0.6 / 0.8 = -0.75. The two agree, so the shortcut works even though we did not need to solve for yy to use it.

The picture is a small piece of the circle, with the tangent line through (0.6,0.8)(0.6, 0.8) having slope −0.75-0.75.

−1−0.500.5100.51xy
  • y = sqrt(1 - x^2)
  • tangent at (0.6, 0.8)
Near (0.6, 0.8) the circle is a graph of y over x, and the tangent line has slope -0.75.

The math

Step 1 in symbols: the equation and the point

Let F(x,y)F(x, y) be a function of two variables, and let (a,b)(a, b) be a point with F(a,b)=0F(a, b) = 0.

Definition: Implicit function theorem (one equation, two variables)

Suppose FF is continuously differentiable near (a,b)(a, b), F(a,b)=0F(a, b) = 0, and Fy(a,b)≠0F_y(a, b) \neq 0. Then there is a neighbourhood of aa and a unique differentiable function y=g(x)y = g(x) with g(a)=bg(a) = b and F(x,g(x))=0F(x, g(x)) = 0 for every xx in that neighbourhood. Its slope is

dydx=−Fx(x,y)Fy(x,y),y=g(x),\frac{dy}{dx} = -\frac{F_x(x, y)}{F_y(x, y)}, \qquad y = g(x),

evaluated at the point.

Read the statement in words: the function FF must be differentiable; the point must be on the curve; and FF must change when yy changes. Only then is yy determined by xx near the point.

Step 2 in symbols: why the slope has that form

Substitute y=g(x)y = g(x) into the equation: F(x,g(x))=0F(x, g(x)) = 0 holds for every xx nearby. Differentiate both sides with respect to xx. The chain rule gives

Fx⋅1+Fy⋅dydx=0.F_x \cdot 1 + F_y \cdot \frac{dy}{dx} = 0.

The first term is the change in FF from moving xx; the second is the change from moving yy along the curve. The sum must be zero because FF stays at zero. Solve for dy/dxdy/dx and you get the formula. The division is allowed only when Fy≠0F_y \neq 0, which is why the hypothesis is there.

Step 3 in symbols: the check on the circle

For F=x2+y2−1F = x^2 + y^2 - 1 we have Fx=2xF_x = 2x and Fy=2yF_y = 2y. The formula gives dy/dx=−2x/2y=−x/ydy/dx = -2x / 2y = -x/y. At (0.6,0.8)(0.6, 0.8) this is −0.6/0.8=−0.75-0.6 / 0.8 = -0.75, the same as the direct computation in the walkthrough.

Several variables

For a system of mm equations F(x,y)=0F(x, y) = 0 with x∈Rnx \in \mathbb{R}^n and y∈Rmy \in \mathbb{R}^m, the same argument uses the Jacobian matrix of FF with respect to yy. The theorem then needs that square matrix to be invertible, and the slope becomes dy/dx=−(∂yF)−1∂xFdy/dx = -(\partial_y F)^{-1} \partial_x F. The one-equation case is the special case where ∂yF\partial_y F is a single number. Solving the linear system here is the matrix version of dividing by FyF_y, and it uses the inverse of a matrix.

Worked examples

Example
1. The circle at a simple point

Find dy/dxdy/dx for x2+y2=1x^2 + y^2 = 1 at (0,1)(0, 1).

  1. Write F(x,y)=x2+y2−1F(x, y) = x^2 + y^2 - 1. At (0,1)(0, 1): 0+1−1=00 + 1 - 1 = 0, so the point is on the curve.
  2. Fx=2x=0F_x = 2x = 0 at x=0x = 0.
  3. Fy=2y=2F_y = 2y = 2 at y=1y = 1, which is not zero, so the theorem applies.
  4. dy/dx=−Fx/Fy=−0/2=0dy/dx = -F_x / F_y = -0 / 2 = 0.

Interpretation: at the top of the circle the curve is horizontal, which matches what you see on a graph.

Example
2. A curve with a cubic term

Find dy/dxdy/dx for x3+y3−6xy=0x^3 + y^3 - 6xy = 0 at (3,3)(3, 3).

  1. Check the point: 27+27−54=027 + 27 - 54 = 0, so (3,3)(3, 3) lies on the curve.
  2. Fx=3x2−6yF_x = 3x^2 - 6y. At (3,3)(3, 3): 27−18=927 - 18 = 9.
  3. Fy=3y2−6xF_y = 3y^2 - 6x. At (3,3)(3, 3): 27−18=927 - 18 = 9, which is not zero.
  4. dy/dx=−Fx/Fy=−9/9=−1dy/dx = -F_x / F_y = -9 / 9 = -1.
  5. Interpretation: the curve crosses the diagonal y=xy = x at (3,3)(3, 3) going downward at a 45 degree angle.

Notice that we never solved the cubic for yy. The theorem gave the slope directly from the two partial derivatives.

Example
3. Realistic: how a market price responds to income

A market has demand D(p,t)=100−2p+tD(p, t) = 100 - 2p + t and supply S(p)=4p+10S(p) = 4p + 10, where pp is the price and tt is an income index. The market clears when D=SD = S, which we write as F(p,t)=90−6p+t=0F(p, t) = 90 - 6p + t = 0.

  1. At t=0t = 0 the equation gives p=15p = 15. Check: D=100−30+0=70D = 100 - 30 + 0 = 70 and S=60+10=70S = 60 + 10 = 70.
  2. Take the partial derivative with respect to tt, holding price fixed: Ft=1F_t = 1.
  3. Take the partial derivative with respect to pp, holding income fixed: Fp=−6F_p = -6. It is not zero, so the theorem applies.
  4. The implicit formula gives dp/dt=−Ft/Fp=−1/(−6)=1/6dp/dt = -F_t / F_p = -1 / (-6) = 1/6.
  5. Check by solving once: p(t)=(90+t)/6p(t) = (90 + t)/6, whose derivative is 1/61/6.

Interpretation: a one-unit rise in the income index raises the equilibrium price by about one sixth of a unit. The theorem gives this without solving the market for every income.

Try it: a market has demand D(p,t)=120−3p+tD(p, t) = 120 - 3p + t and supply S(p)=2p+20S(p) = 2p + 20. Find dp/dtdp/dt at the equilibrium where p=20p = 20 when t=0t = 0. Answer: F=100−5p+tF = 100 - 5p + t, so Ft=1F_t = 1 and Fp=−5F_p = -5, giving dp/dt=−1/(−5)=1/5=0.2dp/dt = -1 / (-5) = 1/5 = 0.2.

Common mistakes and tradeoffs

"The theorem says every point of the curve is a graph of yy over xx." It is tempting to think that any equation F(x,y)=0F(x, y) = 0 defines yy as a function of xx. In fact the theorem needs Fy≠0F_y \neq 0 at the point. On the circle at (1,0)(1, 0) the partial Fy=2yF_y = 2y is zero, and the curve turns vertical there: near that point it is a graph of xx over yy instead.

"The theorem gives a global solution." The result is local. It describes the curve near one point, and far away the equation can define several branches, as the circle does with its upper and lower halves. Each branch needs its own check of the hypotheses.

"You must solve for yy before you can differentiate." The point of the theorem is that you do not. You only need the value of FF's partial derivatives at a point on the curve.

When to use it. Use the theorem when a relation is given implicitly and you need a slope, rate or sensitivity at a known point. Use it to decide whether a solution moves smoothly with a parameter.

When not to use it. When the equation can be solved cleanly for yy, solving is simpler and gives the global picture. When Fy=0F_y = 0 at the point, the formula breaks down and you must switch the roles of the variables or use a different method.

History

Ways of finding slopes of curves given by equations were known to Newton and Leibniz, who used implicit differentiation as a routine technique without a general statement of when it was justified. The question of when an equation really defines one variable as a function of another was harder: a curve can look like a graph in pictures and still fail at special points. Ulisse Dini gave the general statement in the 19th century, and the theorem became a standard part of multivariable calculus because the proof uses the same linear approximation as the derivative itself. The result caught on because it lets mathematicians and economists talk about how solutions change without writing the solution down.

Recap

  • An equation F(x,y)=0F(x, y) = 0 can define yy as a function of xx near a point, if FF is smooth there and Fy≠0F_y \neq 0.
  • The slope is dy/dx=−Fx/Fydy/dx = -F_x / F_y, found from partial derivatives alone.
  • The formula comes from differentiating F(x,g(x))=0F(x, g(x)) = 0 with the chain rule.
  • Several equations need the Jacobian matrix and its inverse in place of the single division.
  • Read next: partial derivatives if the notation is new, and bilevel optimisation for a dependent use.

Check yourself

QuestionRecall: what condition on the partial derivatives lets the theorem solve for y as a function of x near a point?Show answer

FyF_y must not be zero at the point. This is what allows the division by FyF_y in the formula dy/dx=−Fx/Fydy/dx = -F_x / F_y, and it is what makes yy locally determined by xx.

QuestionCompute: for F(x,y)=xy+y3−2F(x, y) = xy + y^3 - 2 at the point (1,1)(1, 1), find dy/dxdy/dx.Show answer

First check the point: 1+1−2=01 + 1 - 2 = 0. Then Fx=y=1F_x = y = 1 and Fy=x+3y2=1+3=4F_y = x + 3y^2 = 1 + 3 = 4. So dy/dx=−1/4=−0.25dy/dx = -1/4 = -0.25.

QuestionWhy: why does the formula for dy/dxdy/dx not need yy solved out explicitly?Show answer

Because the slope comes from differentiating the identity F(x,g(x))=0F(x, g(x)) = 0 with the chain rule. That gives Fx+Fy dy/dx=0F_x + F_y \, dy/dx = 0, a relation between the derivatives at the point. The function gg is only needed to justify the calculation, and its existence is guaranteed by the theorem.

QuestionApplied: a water-level equation H(h,r)=0H(h, r) = 0 links the height hh of a tank to a rainfall rate rr, and ∂H/∂h=0\partial H / \partial h = 0 at the current level. Can you use the theorem to find dh/drdh/dr there, and what would you do instead?Show answer

No. The theorem needs the partial derivative with respect to the variable being solved for to be nonzero, and here it is zero, so hh is not locally a smooth function of rr by this argument. You would switch the roles, solving for rr as a function of hh if that partial is nonzero, or analyse the equation directly, since the tank may be at a point where the response changes sharply.

Sources