0

Suppose I have a function such that \begin{align} f\left(x,y\right)&=x^2+y^2+xy, \end{align} now let $v=x+y\implies y=v-x$, therefore \begin{align} f\left(x,v-x\right)&=x^2+\left(v-x\right)^2+x\left(v-x\right)\\ \require{cancel}&=x^2+v^2-\cancel{xv}+\cancel{x^2}+\cancel{xv}-\cancel{x^2}-2vx\\ &=x^2-2vx+v^2. \end{align} Now I'm going to let \begin{align} g\left(x,v\right)=x^2-2vx+v^2. \end{align}


Suppose now that I want to find $\displaystyle\frac{\partial g}{\partial x}$? It seems I would have to add in the piece from before since $v=y+x$, but how do I do that throughout the chain rule of partial differentials? This is what I think might happen: \begin{align} \frac{\partial g}{\partial x}&=\frac{\partial g}{\partial x}+\frac{\partial g}{\partial v}\frac{\partial v}{\partial x},\tag{1} \end{align} and if I might want to find $\displaystyle\frac{\partial g}{\partial y}$ I would have to do something like \begin{align} \frac{\partial g}{\partial y}&=\frac{\partial g}{\partial v}\frac{\partial v}{\partial y},\tag{2} \end{align} but are $\left(1\right)$ and $\left(2\right)$ right?
bjd2385
  • 3,017
  • Equation (1) is necessarily wrong as $\frac{\partial g}{\partial v}\frac{\partial v}{\partial x} \neq 0$. – Mahdi Mar 15 '15 at 04:46

1 Answers1

0

Chain rule is not so helpful here, as it calculates derivative of composition of two or more functions, but you may write:

$$ \frac{\partial g(x,v(x,y))}{\partial x} = 2x - 2 v -2x \frac{\partial v}{\partial x} + 2v \frac{\partial v}{\partial x}= 0. $$

Note that:

$$ g(x,v) = (x-v)^2 = y^2 \Rightarrow \frac{\partial g}{\partial y}= 2y . $$

Mahdi
  • 627
  • $v$ is not a function of one variable though. So it should be $\displaystyle\frac{\partial g\left(x,v\left(x,y\right)\right)}{\partial x}$...? – bjd2385 Mar 15 '15 at 04:55
  • Yes you're right. – Mahdi Mar 15 '15 at 04:56
  • 1
    Also, note that this two equations are correct only if we know a priori that $v=v(x,y)$ otherwise $\partial_{y}g=0$. – Mahdi Mar 15 '15 at 05:04