Hints on finding derivatives where summation exists I have the function:
$f(n_i$) = $\sum_{i = 1}^{k} c_in_i$
The answer says, $\frac{df(n_i)}{dn_i} = c_i$
I don't understand why the answer is not $\sum_{i=1}^{k}{c_i}$.
Any good resource or hints will be helpful. Thanks in advance.
 A: Firstly, your function is dependent on all the variables $n_i$, and so strictly, you should write $f(\mathbf{n})$ with $\mathbf{n} = (n_i)_{i=1}^k$. Then the reason for the derivative is because $ \frac{\partial f(n_i)}{\partial n_j} = 0 $ for $i \neq j$.
Consider the example with $k=2$ and to ease notation, with $n_1 = x, n_2 = y$. Then we have that
$$
f(x,y) = c_1 x + c_2 y.
$$
It is then clear that (by linearity of the derivative)
$$
\frac{\partial f(x,y)}{\partial x} =  c_1\frac{\partial (x)}{\partial x} + c_2 \frac{\partial (y)}{\partial x} = c_1.
$$
Similarly, for the other derivate.
Extension
If instead you wanted to get the sum of the derivatives, then what you need to do is take the directional derivative of the function $f$ in the direction $\mathbf{u}=(1,1,...,1)$. In which case you would get
$$
\mathbf{u} \cdot \nabla f(\mathbf{n}) = \pmatrix{1 \\ 1 \\ \vdots \\ 1} \cdot \pmatrix{\frac{\partial f(n_1)}{\partial n_1} \\ 
\frac{\partial f(n_2)}{\partial n_2}
\\ \vdots \\ \frac{\partial f(n_k)}{\partial n_k}} = \pmatrix{1 \\ 1 \\ \vdots \\ 1} \cdot \pmatrix{c_1 \\ c_2 \\ \vdots \\ c_k} = \sum_{i=1}^{k} c_i,
$$
where $\nabla f$ denotes the gradient of $f$.
