How do you differentiate with respect to y?

7.3k Views Asked by At

Find the gradient of

$$z=x^y$$

I understand how to get it with respect to $x$ since $y$ is treated as a constant. But when trying to solve it with respect to $y$, why is it incorrect to implicitly differentiate and use the product rule:

$$\ln(z)=y\cdot ln(x)$$

$$\frac{(z_y)}{z}=\Bigr(y\cdot \frac{1}{x}\Bigr)+(1\cdot \ln(x))$$

$$z_y=z\Bigr(\frac{y}{x}+\ln(x)\Bigr)$$

$$z_y=x^y\Bigr(\frac{y}{x}+\ln(x)\Bigr)$$

5

There are 5 best solutions below

0
On BEST ANSWER

In single-variable calculus, a first application of implicit differentiation is typically to find the derivative of $x \mapsto a^x$, where $a > 0$. The typical argument is \begin{align*} y = a^x &\implies \log(y) = x\log(a) \\ &\implies \frac{1}{y} y' = \log(a) \\ &\implies y' = y\log(a) = a^x \log(a). \end{align*} In your problem, when you differentiate with respect to $y$, you need to regard $x$ as a constant (you should also probably assume that $x > 0$). You can then apply the single-variable result to get $$ z_y = \frac{\mathrm{d}}{\mathrm{d}y} x^y = x^y\log(x). $$

0
On

When we're differentiating with respect to $y$, $x$ should be treated as a constant. The $\frac yx$ term in there that comes from differentiating $x$ shouldn't be there.

0
On

When take the derivative of $x^y$ with respect to $y$, are you treating $x$ as a constant or as a function of $y$?

If the former then (using your notation) you get $\frac{z_y}{z}=1 \times \ln(x)$ and so $z_y = x^y \ln(x)$

If the latter then you get $\frac{z_y}{z}=y \times \frac1x\times x_y+1 \times \ln(x)$ and so $z_y =y x^{y-1} x_y+ x^y \ln(x)$. Then you might also want to say $z_x = y x^{y-1}+ x^y \ln(x) y_x$ when taking the derivative of $x^y$ with respect to $x$

0
On

Note that $x $ is not a function of $y $. Hence $x_y=0$. So the correct one is:

$$\ln(z)=y\cdot\ln(x)$$

$$\frac{(z_y)}{z}=1\cdot\ln(x)$$

$$z_y=z\ln(x)$$

$$z_y=x^y\ln(x)$$

0
On

The variables $x$ and $y$ are to be considered independent when computing the gradient of $z$, that is,

$\nabla z = (z_x, z_y), \tag 1$

which is a vector. We have

$z = x^y, \tag 2$

whence

$z_x = yx^{y - 1}, \tag 3$

as our OP Random Student has noted. As for $z_y$, we have

$\ln z = y \ln x, \tag 4$

whence

$\dfrac{z_y}{z} = \ln x, \tag 5$

or

$z_y = z \ln x = x^y \ln x; \tag 6$

thus,

$\nabla z = (z_x, z_y) = (yx^{y - 1}, x^y \ln x). \tag 7$

In (4)-(6), we have implicitly differentated $z$ with respect to $y$ alone, holding $x$ constant.