1
$\begingroup$

I just stumbled upon a simple notation inconsistency in partial derivatives and I'm unsure on how to make it appear more correctly. Assume

$f(x,y) := (x+y)*x$

For no particular reason, let's define

$u(x,y) := x + y$

so that we can rewrite $f(x,y) := u*x$. Now in Leibniz notation we could express the partial derivative of $\frac{df}{dx}$ by

$$\frac{df}{dx} = \frac{df}{df}\frac{df}{dx} + \frac{df}{df}\frac{df}{du}\frac{du}{dx} = 1*u + 1*x*1 = 2x + y$$

What bothers me is that i have $\frac{df}{dx}$ on the left hand side and the right hand side of the equation, but clearly there is a different meaning to both terms.

  • 1
    Your second $f$ is really a different function, at minimum, you should write $f(x,u)$ and not $f(x,y)$.2017-01-17
  • 0
    Yes that's it, thanks2017-01-17

1 Answers 1

0

You've used some slightly erroneous notation. Recall that a partial derivative is the same as a total derivative when the respective variable is the only changing parameter.

The partial derivative for $f$ as you've defined it, with respect to $x$, is:

$$\dfrac{\partial f}{\partial x} = \dfrac{\partial}{\partial x} ux$$

Employing the product rule, we obtain:

$$x\dfrac{\partial}{\partial x} u+u\dfrac{d}{dx} x=x(1)+u(1)=x+u=2x+y.$$

Note that $f=(x+y)x=x^2+xy$ and taking the partial with respect to $x$ from here will give the same answer. Does this help?

  • 0
    Thanks for your answer. It does not help directly, I know the product rule, but the point is I'm working on library that performs automatic differentiation on computational graphs using chain rule. See http://bit.ly/2jGjVTM .So I cannot just use the product rule but need to work with what the graph tells me. The problem is the same, just replace u by a.2017-01-17
  • 0
    But I will accept the answer as it shows a way to express my dilemma by changing notation. Thanks!2017-01-17
  • 0
    Ah, see if I knew this was a computational context, I would have stayed away entirely. I got the impression you were just messing around on a piece of paper. Glad it help.... a bit. Ha!2017-01-17
  • 1
    In the end you always need to write documentation on a piece of paper. The library is already in good shape, but documentation is not :)2017-01-17