Derivative of additive and multiplication functions I'm watching a machine learning lecture from MIT https://www.youtube.com/watch?v=nFTQ7kHQWtc&t=1063s where following is given :

Given $x+y$ why is $\frac{\partial f}{\partial x} = 1 $ & $\frac{\partial f}{\partial y} = 1 $ ?
Is this logic correct :
$\frac{\partial f}{\partial x} = x^{1-1} = 1 $
$\frac{\partial f}{\partial y} = y^{1-1} = 1 $
Given $xy$ why is $\frac{\partial f}{\partial x} = y $ & $\frac{\partial f}{\partial y} = x $ and/or how is computed ?
Do I need to use product rule (https://en.wikipedia.org/wiki/Product_rule) ?
 A: Partial derivatives are calculated exactly as ordinary derivatives setting constant the other variables and using the same rules, thus
for $f(x,y)=x+y$


*

*$f_x=1+0=1$

*$f_y=0+1=1$


for $f(x,y)=xy$


*

*$f_x=1\cdot y=y$

*$f_y=x\cdot 1=x$

A: Let $f(x,y)=x+y$ and $g(x,y)=xy$.
For $\dfrac{\partial f}{\partial x}$, treat $y=C_1$ as a constant. So $$\frac{\partial f}{\partial x}=\dfrac{\partial}{\partial x}(x+C_1)=1$$ 
For $\dfrac{\partial f}{\partial y}$, treat $x=C_2$ as a constant. So $$\frac{\partial f}{\partial x}=\dfrac{\partial}{\partial y}(C_2+y)=1$$ 
For $\dfrac{\partial g}{\partial x}$, treat $y=C_3$ as a constant. So $$\frac{\partial g}{\partial x}=\dfrac{\partial}{\partial x}(C_3x)=C_3=y$$ 
For $\dfrac{\partial g}{\partial y}$, treat $x=C_4$ as a constant. So $$\frac{\partial g}{\partial y}=\dfrac{\partial}{\partial y}(C_4x)=C_4=x$$ 
A: A partial derivative in $x$-direction acts only on changes regarding $x$, the variables in other directions are treated as constants:
$$
\frac{\partial}{\partial x}f(x,y,z) = \lim_{h\to 0} \frac{f(x+h, y, z) - f(x, y, z)}{h}
$$
which leads to 
$$
\frac{\partial}{\partial x}(x+y) = 
\left( \frac{\partial}{\partial x}x \right)+
\left( \frac{\partial}{\partial x}y \right) = 1 + 0 = 1 
$$
and
$$
\frac{\partial}{\partial x}(xy) = 
y \left( \frac{\partial}{\partial x} x \right) = 
y \cdot 1 = y
$$
A: In order to find partial derivatives such as $\frac{\partial f}{\partial x} $ you assume the other variable is constant and differentiate your function with respect to $x.$ 
You may have to use product rule or other rules if the function is complicated.
For example in case of $f(x,y)= 5x^2 y + 3 y^2 x $  we have   $\frac{\partial f}{\partial x} = 10xy+ 3y^2 $ and $\frac{\partial f}{\partial y} = 5x^2+6yx. $ 
