Derive the formula for gradient using chain rule

  • I
  • Thread starter Happiness
  • Start date
  • #1
673
28
Consider a surface defined by the equation ##g(x, y, z)=0##. The intersection between this surface and the plane ##z=c## produces a curve that can be plotted on an x-y plane. Find the gradient of this curve.

By chain rule,

##\frac{\partial y}{\partial x}=\frac{\partial y}{\partial g}\frac{\partial g}{\partial x}##

Using the reciprocity relation ##\frac{\partial y}{\partial g}=\Big(\frac{\partial g}{\partial y}\Big)^{-1}##, we have

##\frac{\partial y}{\partial x}=\frac{(\frac{\partial g}{\partial x})}{(\frac{\partial g}{\partial y})}##

This differs from the correct answer by a negative sign. What's wrong with this method?
 

Answers and Replies

  • #2
andrewkirk
Science Advisor
Homework Helper
Insights Author
Gold Member
3,886
1,454
Greater care is needed when handling partial derivatives. They cannot be treated in general the same as total derivatives. In particular it is not necessarily the case that
##\frac{\partial y}{\partial x}=\frac{\partial y}{\partial g}\frac{\partial g}{\partial x}##
Indeed, in this case the ##\frac{\partial y}{\partial x}## that is being calculated is with the values of ##g## and ##z## held constant, so ##\frac{\partial y}{\partial g}## is undefined or infinite, while ##\frac{\partial g}{\partial x}## is zero.
 
  • Like
Likes Happiness
  • #3
673
28
The following website calculates the gradient as follows:

Differentiate ##g## wrt ##x## while holding ##z## constant.

image.png


Then we will have ##\frac{\partial y}{\partial x}=-\frac{(\frac{\partial g}{\partial x})}{(\frac{\partial g}{\partial y})}##. Why ain't ##\frac{\partial g}{\partial x}## and ##\frac{\partial g}{\partial y}## zero in this case?

In what situations must the two partials on the RHS of the chain rule have the same variables held constant? Like you mentioned for post #1, ##(\frac{\partial y}{\partial g})_{gz}(\frac{\partial g}{\partial x})_{gz}##. But why is it not required in the attachment above, where ##(\frac{\partial g}{\partial y})_{xz}(\frac{\partial y}{\partial x})_{gz}##?

Source:
http://www.sjsu.edu/faculty/watkins/envelopetheo.htm
 
Last edited:
  • #4
andrewkirk
Science Advisor
Homework Helper
Insights Author
Gold Member
3,886
1,454
I find the presentation on that web page unnecessarily confusing. It attempts to use the formula for a total derivative in a case where all derivatives are partial. Sometimes one can get away with this, but sometimes one can't, so it is best avoided.

A more correct derivation would be as follows:

Say the point ##(x_0,y_0)## is on the curve. Let us parametrise the curve through that point by function ##\gamma:\mathbb R\to\mathbb R^2## and wlog set ##\gamma(0)=(x_0,y_0)##. Then we have ##g(\gamma_1(t).\gamma_2(t),c)=0##, where ##\gamma_1## and ##\gamma_2## are the component functions of ##\gamma##.

We then apply ##\frac d{dt}## to this - ie taking a total derivative - to get:

$$0=\frac d{dt}0=\frac d{dt}g(\gamma_1(t).\gamma_2(t),c)=\frac{\partial g}{\partial x}\frac {dx}{dt}+
\frac{\partial g}{\partial y}\frac {dy}{dt}+\frac{\partial g}{\partial c}\frac {dc}{dt}
=\frac{\partial g}{\partial x}\frac {dx}{dt}+
\frac{\partial g}{\partial y}\frac {dy}{dt}+\frac{\partial g}{\partial c}\cdot 0$$

Rearranging, we get

$$-\frac{\partial g}{\partial x}/\frac{\partial g}{\partial y}=\frac{dy}{dt}/\frac{dx}{dt}=\frac{dy}{dx}$$
as required. Note that the transformation in the final step is allowed because we are dealing with total derivatives, not partial derivatives.
 
  • Like
Likes Happiness and Delta2

Related Threads on Derive the formula for gradient using chain rule

  • Last Post
Replies
5
Views
288
  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
6
Views
16K
  • Last Post
Replies
7
Views
2K
Replies
10
Views
3K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
2
Views
741
Top