Help finding partial derivative with chain rule I'm having trouble finding the partial derivative of $z$ with respect to $x$ of this function:
$$z(x,y) = f(x + y) + f(x - y)$$
I saw this exercise online, but I can't figure it out. How can I solve it? Because the functions $f(x + y)$ and $f(x - y)$ only depend on one variable, but I don't understand why their input is an expression involving $x$ and $y$.
Thank you!
 A: To address your second concern first, let's consider the function $f(x) = x^2$.  Then, there is nothing strange about evaluating, say, $f(2 - 3) = f(-1) = 1$ or $f(15 - 10) = f(5) = 25$.  In the same way, we could define a new function $h(x,y) = f(x-y)$, in which case we could write the above calculations as $h(2,3) = 1$ and $h(15,10) = 25$.  So, we are using a single-variable function $f$ to carry out the final computation, but if we are always considering a calculation 'inside' the function it is easier to think of the function of two variable, $h$.
Now, to your original question.  Given $$z(x,y) = f(x + y) + f(x - y),$$ if we want to compute the partial derivative of $z$ with respect to $x$, we will need to use the chain rule:
$$\frac{\partial z}{\partial x}(x,y) = f'(x+y)\frac{\partial(x+y)}{\partial x} + f'(x-y)\frac{\partial(x-y)}{\partial x} = \boxed{f'(x+y) + f'(x-y)}.$$
Now, if you wanted to compute the partial derivative of $z$ with respect to $y$ then the chain rule would actually do something more obvious:
$$\frac{\partial z}{\partial y}(x,y) = f'(x+y)\frac{\partial(x+y)}{\partial y} + f'(x-y)\frac{\partial(x-y)}{\partial y} = \boxed{f'(x+y) - f'(x-y)}.$$
A: To answer one part of your question, how $f(x-y)$ isn't simply a function of 1 variable, consider the most simple case of $f(w)=w$. If I substitute $x-y$ for $x$ then I get $f(x-y)=x-y$. So I had started with a function indeterminate in 1 variable, and obtained a function that is indeterminate in 2 variables.
So let's look at $\frac{\partial z}{\partial x}$. It will probably be easier if I just substitute $x+y$ with $u$ and $x-y$ with $v$. Let's note that $\frac{\partial u}{\partial x}=1$, and similarly for $v$. Then
$$\frac{\partial z}{\partial x} = \frac{\partial f(u)}{\partial u}\frac{\partial u}{\partial x}+\frac{\partial f(v)}{\partial v}\frac{\partial v}{\partial x}\\=\frac{\partial f(u)}{\partial u}+\frac{\partial f(v)}{\partial v}.$$ It's not possible to get much more definitive than this for your example. Just note that our result depends on what $u,v$ are, and if we took, say, the derivative with respect to $y$ then $\frac{\partial v}{\partial y}=-1$ which would change our answer.
