Slope of a Line Tangent to a Level Curve at a Point

Staff Emeritus

Homework Statement

The equation ## f(x,y) = f(a,b) ## defines a level curve through a point ## (a,b) ## where ## \nabla f(a,b) \neq \vec 0##. Use implicit differentiation and the chain rule to show that the slope of the line tangent to this curve at the point ##(a,b)## is ##-f_x(a,b)/f_y(a,b)## if ##f_y \neq 0##.

Homework Equations

##\nabla f(x,y) = f_x(x,y)\vec i + f_y(x,y)\vec j##

The Attempt at a Solution

Well, if we're using implicit differentiation, then I think ##y = f(x)## and ##\frac{\partial f(x,y)}{\partial y} = \frac{df(x,f(x))}{dx}\frac{dx}{dx}##
That would make it: ##\frac{df(x,y)}{dx} = \frac{df(x)}{dx}\frac{dx}{dx} + \frac{df((f(x))}{dx}\frac{dx}{dx}##
Since dx/dx = 1, that becomes: ##\frac{df(x,y)}{dx} = \frac{df(x)}{dx} + \frac{df((f(x))}{dx}##
However, the right term appears to go to zero (or right "branch" as my math teacher told us), leaving this as: ##\frac{df(x,y)}{dx} = \frac{df(x)}{dx}##

Assuming all that's correct, which I'm not sure it is, I'm now stuck. I can't see how to get the slope equal to ##-f_x(a,b)/f_y(a,b)##

LCKurtz
Homework Helper
Gold Member

Homework Statement

The equation ## f(x,y) = f(a,b) ## defines a level curve through a point ## (a,b) ## where ## \nabla f(a,b) \neq \vec 0##. Use implicit differentiation and the chain rule to show that the slope of the line tangent to this curve at the point ##(a,b)## is ##-f_x(a,b)/f_y(a,b)## if ##f_y \neq 0##.

Homework Equations

##\nabla f(x,y) = f_x(x,y)\vec i + f_y(x,y)\vec j##

The Attempt at a Solution

Well, if we're using implicit differentiation, then I think ##y = f(x)## and ##\frac{\partial f(x,y)}{\partial y} = \frac{df(x,f(x))}{dx}\frac{dx}{dx}##

Really bad idea to use ##f## for two different functions. Better to think of ##y = y(x)##. So you have ##f(x,y(x)) = C##, a constant. What happens if you differentiate that with respect to ##x## and solve for ##y'##?

andrewkirk
Homework Helper
Gold Member
Well, if we're using implicit differentiation, then I think ##y = f(x)##
We can't do that, as ##f## is an already existing two-input function.

Let's assume the tangent is not parallel to the y axis (If it is, we swap x for y in everything that follows and end up with the same result). Then there is a function ##g:\mathbb R\to\mathbb R## such that, for ##x## on some open interval ##U\subseteq \mathbb R## containing ##a##, the point ##(x,g(x))## is on the level curve. We use the function ##\gamma:x\mapsto(x,g(x))## to parametrize the curve and note that ##b=g(a)##, so that ##\gamma(a)=(a,b)##.

Since it is a level curve we have
$$0 =D(f\circ\gamma)(a)=D_1f(a,b)D\gamma^1(a)+D_2f(a,b)D\gamma^2(a) =D_1f(a,b)D(x\mapsto x)(a)+D_2f(a,b)D(x\mapsto g(x))(a)$$
where
• the operator ##D## means differentiate the unary function immediately following the symbol
• ##D_k## means differentiate the function following the symbol wrt its ##k##th argument
• ##\gamma^k## is the ##k##th component function of ##\gamma##
The second equality in the above expression is the total differential rule.

Next step is to perform the differentiations of the unary functions.

Last edited:
Staff Emeritus
Really bad idea to use ##f## for two different functions. Better to think of ##y = y(x)##. So you have ##f(x,y(x)) = C##, a constant.

Ah, didn't think about using a different letter for the new function.

What happens if you differentiate that with respect to ##x## and solve for ##y'##?

I... don't really know.

Then there is a function ##g:\mathbb R\to\mathbb R## such that, for ##x## on some open interval ##U\subseteq \mathbb R## containing ##a##, the point ##(x,g(x))## is on the level curve. We use the function ##γ:x↦(x,g(x))\gamma:x\mapsto(x,g(x))## to parametrize the curve and note that ##b=g(a)##, so that ##γ(a)=(a,b)\gamma(a)=(a,b)##.

I'm sorry andrew, but I don't know what most of your notation means. Thank you very much for posting though. I appreciate it.

andrewkirk
Homework Helper
Gold Member
I'm sorry andrew, but I don't know what most of your notation means.
The notation ##\gamma:x\mapsto (x,g(x))## is just a shorthand way of saying that ##\gamma## is a function from ##\mathbb R## to ##\mathbb R^2## and that ##\gamma(x)=(x,g(x))##. That is, ##\gamma## maps the real number ##x## to the point on the number plane with horizontal coordinate ##x## and vertical coordinate ##g(x)##.

The function ##\gamma## is a parametrization of the line we are interested in.

Drakkith
Mark44
Mentor
We can't do that, as ##f## is an already existing two-input function.

Let's assume the tangent is not parallel to the y axis (If it is, we swap x for y in everything that follows and end up with the same result). Then there is a function ##g:\mathbb R\to\mathbb R## such that, for ##x## on some open interval ##U\subseteq \mathbb R## containing ##a##, the point ##(x,g(x))## is on the level curve. We use the function ##\gamma:x\mapsto(x,g(x))## to parametrize the curve and note that ##b=g(a)##, so that ##\gamma(a)=(a,b)##.

Since it is a level curve we have
$$0 =D(f\circ\gamma)(a)=D_1f(a,b)D\gamma^1(a)+D_2f(a,b)D\gamma^2(a) =D_1f(a,b)D(x\mapsto x)(a)+D_2f(a,b)D(x\mapsto g(x))(a)$$
where
• the operator ##D## means differentiate the unary function immediately following the symbol
• ##D_k## means differentiate the function following the symbol wrt its ##k##th argument
• ##\gamma^k## is the ##k##th component function of ##\gamma##
The second equality in the above expression is the total differential rule.

Next step is to perform the differentiations of the unary functions.
With all due respect, and by comments from Drakkith, the OP, this explanation is not helpful.

LCKurtz said:
So you have ##f(x,y(x)) = C##, a constant. What happens if you differentiate that with respect to ##x## and solve for ##y'##?
You can take the total derivative of f(x, y(x)).

Staff Emeritus
Really bad idea to use ##f## for two different functions. Better to think of ##y = y(x)##. So you have ##f(x,y(x)) = C##, a constant. What happens if you differentiate that with respect to ##x## and solve for ##y'##?

Sorry, I've been super busy and haven't had the time to really dive into this.

Can we work through a small example? What would be a good equation for Y? ##y=g(x) = x^2 - y^2 ## ?

Mark44
Mentor
Sorry, I've been super busy and haven't had the time to really dive into this.

Can we work through a small example? What would be a good equation for Y? ##y=g(x) = x^2 - y^2 ## ?
No. g(x) implies that g is a function of x alone, but you show it as involving both x and y.

Suppose you have the level curves of ##z = g(x, y) = x^2 - y^2## so you're looking at the equation ##x^2 - y^2 = C##, for some constant. Assuming that y can be written as a function of x; i.e., y = y(x) in an abuse of notation, then we can think of z as being ultimately a function of x alone.

So I'll take the total differential of both sides of ##x^2 - y^2 = C##.
But ##dz = \frac{\partial g}{\partial x}dx + \frac{\partial g}{\partial y}dy = d(C)##
Divide through by dx to get ##\frac{dz}{dx} = \frac{\partial g}{\partial x} \frac{dx}{dx} + \frac{\partial g}{\partial y}\frac{dy}{dx} = \frac{d(C)}{dx}##
This is the part I'm interested in: ##\frac{\partial g}{\partial x} \frac{dx}{dx} + \frac{\partial g}{\partial y}\frac{dy}{dx} = \frac{d(C)}{dx}##
Fill in the rest and follow LCKurtz's advice to solve for y' (i.e., dy/dx).

Staff Emeritus
Assuming that y can be written as a function of x; i.e., y = y(x) in an abuse of notation, then we can think of z as being ultimately a function of x alone.

I think that's where I'm really getting confused. How can we write Y as a function of X in this case? Just solve for Y in the equation to get ##y=\sqrt{x^2-c}## ?

Mark44
Mentor
I think that's where I'm really getting confused. How can we write Y as a function of X in this case? Just solve for Y in the equation to get ##y=\sqrt{x^2-c}## ?
You don't have to actually write the function. All you need to do is to assume that such a function exists in possibly some limited region.

The equation here, ##x^2 - y^2 = C##, represents a hyperbola with vertices on the x-axis, and opening left and right, away from the y-axis.
If ##x^2 - y^2 = C##, then ##y = \pm \sqrt{x^2 - C}##
For the positive square root, we get the upper halves of the two branches. For the neg. square root, we get the lower halves of the two branches.

This is all you need:
##\frac{\partial g}{\partial x} \frac{dx}{dx} + \frac{\partial g}{\partial y}\frac{dy}{dx} = \frac{d(C)}{dx}##
Complete the work where I left off and follow LCKurtz's advice to solve for y' (i.e., dy/dx).

Staff Emeritus
This is all you need:
##\frac{\partial g}{\partial x} \frac{dx}{dx} + \frac{\partial g}{\partial y}\frac{dy}{dx} = \frac{d(C)}{dx}##
Complete the work where I left off and follow LCKurtz's advice to solve for y' (i.e., dy/dx).

Oh, is that all you need to do? Alright. Well, solving ##\frac{\partial g}{\partial x} \frac{dx}{dx} + \frac{\partial g}{\partial y}\frac{dy}{dx} = \frac{d(C)}{dx}## for y' gives me:

##\frac{\partial g}{\partial y}\frac{dy}{dx} = -\frac{\partial g}{\partial x} \frac{dx}{dx}##

Since ##\frac{dx}{dx} = 1##, that becomes ##\frac{\partial g}{\partial y}\frac{dy}{dx} = -\frac{\partial g}{\partial x}##

Then: ##\frac{dy}{dx} =-\frac{\frac{\partial g}{\partial x}}{\frac{\partial g}{\partial y}}##

Which is the same as: ##-f_x(a,b)/f_y(a,b)##

Wow, I don't think I would have ever figured out that the ##\frac{dy}{dx}## in ##\frac{\partial z}{\partial x}=\frac{\partial g}{\partial x} \frac{dx}{dx} + \frac{\partial g}{\partial y}\frac{dy}{dx}## was the same as the slope of the tangent line in the XY-plane. No wonder I was so lost.

Thanks all.

andrewkirk
Homework Helper
Gold Member
Wow, I don't think I would have ever figured out that the ##\frac{dy}{dx}## in ##\frac{\partial z}{\partial x}=\frac{\partial g}{\partial x} \frac{dx}{dx} + \frac{\partial g}{\partial y}\frac{dy}{dx}## was the same as the slope of the tangent line in the XY-plane.
Just a small point, which might seem like a nit pick, but is actually quite important. What you wrote as
$$\frac{\partial z}{\partial x}=\frac{\partial g}{\partial x} \frac{dx}{dx} + \frac{\partial g}{\partial y}\frac{dy}{dx}$$
should be
$$\frac{dz}{dx}=\frac{\partial g}{\partial x} \frac{dx}{dx} + \frac{\partial g}{\partial y}\frac{dy}{dx}$$
Usually, minor deviations in notation make the item meaningless, which is good because one can then often infer what was intended because one can see what changes need to be made to make the notation meaningful.

But ##\frac{\partial z}{\partial x}## is perfectly meaningful in this context, and means something completely different from ##\frac{dz}{dx}##. The former is the slope of the surface in the direction of a line parallel to the ##y## axis. The latter is the slope of the surface in the direction of a level curve - which will almost certainly not be parallel to the ##y## axis. They will almost certainly give different numbers.

This issue of partial differentiation and its relation to total differentiation is fraught with traps, which I attribute to the widely-used system of notation being unsatisfactory and proliferating ambiguity.

Staff Emeritus
$$\frac{\partial z}{\partial x}=\frac{\partial g}{\partial x} \frac{dx}{dx} + \frac{\partial g}{\partial y}\frac{dy}{dx}$$
$$\frac{dz}{dx}=\frac{\partial g}{\partial x} \frac{dx}{dx} + \frac{\partial g}{\partial y}\frac{dy}{dx}$$