# Partial derivative of a two variables function, one of which dependent on the other

I found this exercise on the book of multivariable calculus from which I'm studying:

"Find the partial derivative $$\frac{\partial{z}}{\partial{x}}$$ and the total derivative $$\frac{\text{d}z}{\text{d}x}$$ of $$z(x,y)=e^{xy}$$ where $$y=\phi(x)$$."

Now, this to me looks like a function of a single variable $$f:\mathbb{R}\to\mathbb{R}$$ and so in this case the partial derivative of $$f$$ with respect to $$x$$ and total derivative would be equivalent; in particular, I end up with something like:

$$\frac{\text{d}z}{\text{d}x}=e^{xy}(\phi(x)+x\phi'(x))$$

In the solution, while the result for the total derivative is the same as mine, the partial derivative of $$f$$ with respect to $$x$$ is written as follows:

$$\frac{\partial{z}}{\partial{x}}=ye^{xy}$$

Why is this the case? Since the partial derivative of $$f$$ with respect to $$x$$ shows the incremental behaviour of the function as $$x$$ changes, shouldn't I account for the presence of $$x$$ in the functional representation of $$y$$ while computing the derivative with respect to $$x$$?

Sorry in advance for the super basic question :)

## 1 Answer

It is possible for $$\phi(x)$$ to be stationary with respect to $$x$$ wiggles while $$f(x,\phi(x))$$ is not stationary due to its remaining explicit dependence on $$x$$. When we write the partial derivative, we by-definition require that $$y$$ is constant, or equivalently that $$\phi(x)$$ is constant while we wiggle x, so it doesn't contribute to the variation (hence why it gets called "partial"). The "total" variation of $$f$$ makes no such restriction, and thus depends on the general wiggle of both x and $$\phi(x)$$.

I assume you have an intuition / understanding of the following equality, $$\frac{df(x,y)}{dt} = \frac{\partial f}{\partial x} \frac{\partial x}{\partial t} + \frac{\partial f}{\partial y} \frac{\partial y}{\partial t}$$

Letting $$x=t$$ we have, \begin{align} \frac{df(x,y)}{dx} &= \frac{\partial f}{\partial x} \frac{\partial x}{\partial x} + \frac{\partial f}{\partial y} \frac{\partial y}{\partial x}\\ &= \frac{\partial f}{\partial x} + \frac{\partial f}{\partial y} \frac{\partial y}{\partial x} \end{align}

Letting $$y = \phi(x)$$ we have, $$\frac{df(x,y)}{dx} = \frac{\partial f}{\partial x} + \frac{\partial f}{\partial y} \phi'(x)$$

Notice that, $$\phi'(x)=0\ \implies\ \frac{df}{dx}=\frac{\partial f}{\partial x}$$

The partial derivative under question is "how $$f$$ varies while we vary $$x$$ and hold $$y$$ constant", $$\frac{\partial f}{\partial x}$$, which still makes sense even if $$y=\phi(x)$$.

In the case of $$f(x,y) = e^{xy}$$ we have, $$\frac{\partial f}{\partial x} = ye^{xy}$$ and \begin{align} \frac{df(x,y)}{dx} &= ye^{xy} + xe^{xy}\phi'(x)\\ &= e^{xy}\big{(}y + x\phi'(x)\big{)} \end{align}

which is, as you have found and we would hope, equivalent to thinking of $$f$$ as a function of one variable $$x$$ to find by "product rule", $$\frac{df(x)}{dx} = e^{x\phi(x)}\big{(}\phi(x) + x\phi'(x)\big{)}$$

• I think I got it, thank a lot! – Prometheus Dec 6 '18 at 12:37
• @Stefano No problem. Generally, you can "accept" an answer to your Stack Exchange question by clicking the checkmark by the voting buttons. – jnez71 Dec 6 '18 at 15:39