0
$\begingroup$

Suppose I am given a function $f(x_i,y_j) = \sum_{i=1}^n\sum_{j=1}^m y_j\log(x_i)$.

I want to evaluate $\frac{\partial f}{\partial x_i}$. Am I correct in assuming that

$\frac{\partial f}{\partial x_i} = \frac{\sum_{j=1}^m y_j}{x_i}$, as the partial derivative of all $x_{i'}, i' \neq i$ equals 0, so the summation drops out?

$\endgroup$
4
  • $\begingroup$ Yes, you are correct. $\endgroup$ Aug 3, 2021 at 12:16
  • $\begingroup$ Thank you! If $f(x_i,y_j)$ = $\sum_{i=1}^n \sum_{j=1}^m y_j x_i$ and I wanted to evaluate $\frac{\partial f}{\partial x_i}$, is it then simply $\sum_{j=1}^m y_j$ instead of $\sum_{j=1}^m y_j n$ right? $\endgroup$
    – Golem
    Aug 3, 2021 at 12:21
  • $\begingroup$ Yes, as writing out the terms explicitly, the only terms with $x_i$ in them are $x_iy_1+\ldots+x_iy_n$. $\endgroup$
    – a1402
    Aug 3, 2021 at 12:28
  • $\begingroup$ Thanks you! That makes sense. $\endgroup$
    – Golem
    Aug 3, 2021 at 12:33

1 Answer 1

1
$\begingroup$

Just to visualize the problem (I think it can be useful) consider that your double sum is the sum of the elements of the following matrix

$$ \left[ \begin{matrix} y_1\log x_1& y_1\log x_2 & \dots & y_1\log x_n \\ y_2\log x_1& y_2\log x_2 & \dots & y_2\log x_n \\ \dots & \dots & \dots &\dots \\ y_m\log x_1 & y_m\log x_2 & \dots & y_m\log x_n \\ \end{matrix}\right]$$

thus derivating w.r.t. $x_i$ the result is the sum of the elements of the following matrix

$$ \left[ \begin{matrix} y_1/x_1& y_1/x_2 & \dots & y_1/x_n \\ y_2/x_1& y_2/x_2 & \dots & y_2/ x_n \\ \dots & \dots & \dots &\dots \\ y_m/x_1 & y_m/ x_2 & \dots & y_m/x_n \\ \end{matrix}\right]$$

That is

$$\frac{\partial f}{\partial x_i}=\frac{1}{x_i}\Sigma_{j=1}^m y_j$$

$i=1,2,\dots,n$

$\endgroup$
2
  • $\begingroup$ Thank you! That is very instructive. $\endgroup$
    – Golem
    Aug 3, 2021 at 12:32
  • $\begingroup$ @Golem : you're welcome. Do not forget to upvote and accept my answer! $\endgroup$
    – tommik
    Aug 3, 2021 at 12:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .