I want to differentiate the function say $g(x)=x^2+y^2$ with respect to the function $f(x)=xy$. But I haven't been able to figure it out. Though I have derived the formula $$\frac{dg}{df}=\frac{\left(\frac{\partial g}{\partial x}\right)\left(\frac{\partial g}{\partial y}\right)}{x\left(\frac{\partial g}{\partial x}\right)+y\left(\frac{\partial g}{\partial y}\right)}$$ But I don't even know whether it is correct or NOT(highlighted because that's most probable outcome)
-
What kind of derivative do you want? If it is a partial derivative, the answer will depend on what variable (function) is independent together with $f$. – Vasily Mitch Sep 12 '19 at 09:52
-
How to know what direction to follow the level set curve $x y=c$? Do you just need the absolute value of the derivative? – Coolwater Sep 12 '19 at 09:56
-
x and y are independent variables – Vansh Saini Sep 12 '19 at 10:04
-
Aye, I just want the absolute value. – Vansh Saini Sep 12 '19 at 10:07
-
3I want to remove from the earth anyone who talks about differentiating a function with respect to a function. I realize that Leibniz notation and teachers "encourage" this bad language and misconception. – Ted Shifrin Sep 12 '19 at 19:39
2 Answers
There is no such thing as this kind of derivative, without more information. Everyone is being imprecise when they talk about the derivative of $g(x, y) = x^2 + y^2$ with respect to $x$: this is actually not enough information. What they mean is the derivative with respect to $x$, holding $y$ fixed; this second clause is left implicit but it's actually crucial.
Here's a simpler example: what's the derivative of $g(x, y) = x^2 + y^2$ with respect to $a = x + y$? The answer is that there's no way of telling what this means until you tell me what is being left fixed; for example, if I'm fixing $y$ then we can rewrite
$$g = (a - y)^2 + y^2, \frac{\partial g}{\partial a} = 2(a - y) = 2x$$
but if I'm fixing $b = x - y$ then we can rewrite
$$g = \left( \frac{a+b}{2} \right)^2 + \left( \frac{a-b}{2} \right)^2, \frac{\partial g}{\partial a} = (a+b) + (a-b) = 2a = 2x + 2y$$
and this is not the same!
Formally, what is needed is to specify a vector field. On $\mathbb{R}^n$ we can specify a vector field by choosing coordinate functions $x_1, \dots x_n : \mathbb{R}^n \to \mathbb{R}$, which specifies a dual basis $\frac{\partial}{\partial x_1}, \dots \frac{\partial}{\partial x_n}$ of vector fields. Crucial here is that despite what the notation says, the construction of $\frac{\partial}{\partial x_i}$ depends on the entire rest of the $x_j$: it's "the derivative with respect to $x_i$, keeping the other $x_j$ fixed." If you just have some fixed coordinate function $x$, what you can define is the differential $1$-form $dx$, but you don't have a way of turning this $1$-form into a vector field.

- 1,674

- 419,620
-
Couldn't we naively consider functions $f, g : U \to \mathbb R^n$ defined on an open $U \subset \mathbb R^m$ and define
$$\frac{\partial f}{\partial g}(\mathbf x) = \lim_{\mathbf h \to \mathbf0} \frac{f(\mathbf x +\mathbf h) - f(\mathbf x)}{g(\mathbf x +\mathbf h) - g(\mathbf x)}$$ if this limit exists? – Kritiker der Elche Jan 14 '23 at 14:11 -
@Kritiker: this limit just won't exist very often in practice. Try it with the $f = x^2 + y^2, g = x + y$ example in the post. – Qiaochu Yuan Jan 14 '23 at 20:54
With $s$ as arclength parameter, let $(x(s),y(s))$ be a point on level set $f(x,y)=c$.
By differentiating both sides we get $x'(s)f^{(1,0)}(x(s),y(s))+y'(s)f^{(0,1)}(x(s),y(s))=0$.
By using an arclength parameter we have $x'(s)^2+y'(s)^2=1$
After solving these equation we have:
$$x'(s)=\frac{\pm f^{(0,1)}(x(s),y(s))}{\sqrt{f^{(1,0)}(x(s),y(s))^2+f^{(0,1)}(x(s),y(s))^2}}\\ y'(s)=\frac{\mp f^{(1,0)}(x(s),y(s))}{\sqrt{f^{(1,0)}(x(s),y(s))^2+f^{(0,1)}(x(s),y(s))^2}}$$
The derivative of $g(x(s),y(s))$ along the level set is:
$$x'(s)g^{(1,0)}(x(s),y(s))+y'(s)g^{(0,1)}(x(s),y(s))$$
By combining these expression we have the derivative:
$$\frac{\pm(f^{(0,1)}(x,y)\cdot g^{(1,0)}(x,y)- f^{(1,0)}(x,y)\cdot g^{(0,1)}(x,y))}{\sqrt{f^{(1,0)}(x,y)^2+f^{(0,1)}(x,y)^2}}$$
Plugin in your example functions:
$$\frac{2(x^2-y^2)}{\pm\sqrt{x^2+y^2}}$$

- 1,292