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 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 $$