Taking Partial Derivatives of Composite Functions

348 Views Asked by At

I've got a question about taking the partial derivative of a function defined by the sum of two composite functions from a past exam I'm doing and kind of stuck, wondering if anyone can help me with it.

$f(x,y)=g(\frac{x}{y})+g(\frac{y}{x})$

where $g$ is differentiable for $xy\neq0$. Evaluate $\frac{\partial f}{\partial x}$ and deduce that $x\frac{\partial f}{\partial x}+y\frac{\partial f}{\partial y}=0$.

I think what I've done so far is correct:

$x\frac{\partial f}{\partial x}+y\frac{\partial f}{\partial y}=\frac{x}{y}\frac{\partial g(\frac{x}{y})}{\partial x} - \frac{y}{x}\frac{\partial g(\frac{y}{x})}{\partial x}-\frac{x}{y}\frac{\partial g(\frac{x}{y})}{\partial y}+\frac{y}{x}\frac{\partial g(\frac{y}{x})}{\partial y}$

But I'm not too sure on how to simplify this further down to 0.

Thanks in advance.

2

There are 2 best solutions below

6
On BEST ANSWER

I'll try to explain this in a slightly more general setting. Note that $g$ is actually a function of one variable. Although we have both $x$ and $y$ in the input expression for $g$ in both terms on the RHS, the point is that $g$ only has one input position, as opposed to, for example, $f$, which has two input positions.

So we can say $u(x,y) = x/y$ and $v(x,y) = y/x$. Then the equation becomes $$ f(x,y) = g(u(x,y)) + g(v(x,y))$$

Now if we take $\partial/\partial x$ of both sides: $$ \frac{\partial}{\partial x}f(x,y) = \frac{\partial}{\partial x} g(u(x,y)) + \frac{\partial}{\partial x} g(v(x,y))$$

So what is $\frac{\partial}{\partial x} g(u(x,y))$? Well, remember that $g$ is just a function of one variable, so we'll get $$ \frac{\partial}{\partial x} g(u(x,y)) = g'(u(x,y)) \cdot \frac{\partial}{\partial x} u(x,y)$$ from the chain rule. Similarly, $$ \frac{\partial}{\partial x} g(v(x,y)) = g'(v(x,y)) \cdot \frac{\partial}{\partial x} v(x,y)$$ So all together, we have \begin{align*} f(x,y) &= g(u(x,y)) + g(v(x,y))\\[0.3cm] \frac{\partial}{\partial x}f(x,y) &= \frac{\partial}{\partial x} g(u(x,y)) + \frac{\partial}{\partial x} g(v(x,y))\\[0.3cm] &= g'(u(x,y)) \cdot \frac{\partial}{\partial x} u(x,y) + g'(v(x,y)) \cdot \frac{\partial}{\partial x} v(x,y)\\[0.3cm] &= g'\left(\frac xy \right) \cdot \frac{\partial}{\partial x} \left(\frac xy \right) + g'\left(\frac yx \right) \cdot \frac{\partial}{\partial x} \left( \frac yx\right)\\[0.3cm] &= g'\left(\frac xy \right) \cdot \left(\frac 1y \right) + g'\left(\frac yx \right) \cdot \left( -\frac y{x^2}\right)\\[0.3cm] &= \frac 1y g'\left(\frac xy \right) - \frac y{x^2} g'\left(\frac yx \right) \end{align*}

Addendum:

Following a similar process, we get $$ \frac{\partial f}{\partial y} = -\frac x{y^2} g'\left(\frac xy \right) + \frac 1x g'\left(\frac yx \right), $$ so then $$ x\frac{\partial f}{\partial x} = \frac xy g'\left(\frac xy \right) - \frac yx g'\left(\frac yx \right) $$ and $$ y\frac{\partial f}{\partial y} = -\frac xy g'\left(\frac xy \right) + \frac yx g'\left(\frac yx \right). $$

Showing $\displaystyle x\frac{\partial f}{\partial x} + y\frac{\partial f}{\partial y} = 0$ from here is straightforward, but it is not the same thing as showing $\displaystyle \frac{\partial g}{\partial x} = \frac{\partial g}{\partial y}$. For one thing it's ambiguous which $g$ is being referred to ($g(x/y)$ or $g(y/x)$) but it actually doesn't matter which one, because $$ \frac{\partial}{\partial x}g\left(\frac xy \right) = \frac 1y g'\left( \frac xy\right) \ne -\frac x{y^2} g'\left( \frac xy\right) = \frac{\partial}{\partial y}g\left(\frac xy \right) $$ and $$ \frac{\partial}{\partial x}g\left(\frac yx \right) = -\frac y{x^2} g'\left( \frac yx\right) \ne \frac 1x g'\left( \frac yx\right) = \frac{\partial}{\partial y}g\left(\frac yx \right). $$ There may be specific values of $x$ and $y$ for which the two "$\ne$" above become "$=$" but the point is that $\partial g/\partial x$ and $\partial g/\partial y$ are not equal to each other in general. But $\displaystyle x\frac{\partial f}{\partial x} + y\frac{\partial f}{\partial y}$ is equal to zero in general (as long as $xy \ne 0$).

1
On

We have

$$f(x,y)=g(\frac{x}{y})+g(\frac{y}{x})$$

$$=g_1(x,y)+g_2(x,y)$$.

with

$$dg_1=\frac{\partial g_1}{\partial x}dx+\frac{\partial g_1}{\partial y}dy$$

$$=\frac{1}{y}g'(\frac{x}{y})dx-\frac{x}{y^2}g'(\frac{x}{y})dy$$

by the same, we get

$$dg_2=\frac{1}{x}g'(\frac{y}{x})dy-\frac{y}{x^2}g'(\frac{y}{x})dx$$

thus

$$x\frac{\partial f}{\partial x}=x\frac{\partial g_1}{\partial x}+x\frac{\partial g_2}{\partial x}=$$

$$=\frac{x}{y}g'(\frac{x}{y})-\frac{y}{x}g'(\frac{y}{x})$$ $$y\frac{\partial f}{\partial y}=-\frac{x}{y}g'(\frac{x}{y})+\frac{y}{x}g'(\frac{y}{x}).$$

we check that

$$x\frac{\partial f}{\partial x}+y\frac{\partial f}{\partial y}=0.$$