# Help with differentiating summations

Hello!

I'm getting confused when differentiating summations.

I understand that if you differentiate an expression and it gives a kroneker delta, that then sums over the appropriate summation and it disappears. But in my notes it has

$$\frac{\partial}{\partial p_{i}} [-k \sum_{i=1}^{r} p_{i} ln p_{i}]$$

Which I then differentiate to get

$$-k \sum_{i=1}^{r}[\frac{\partial p_{i}}{\partial p_{i}} ln p_{i} + p_{i} \frac{\partial}{\partial p_{i}} ln p_{i}]$$

Which I can get down to

$$-k \sum_{i=1}^{r}[ln p_{i} + 1]$$

But in the notes that summation sign has gone.....and I don't understand why. I know that if it had been...

$$\frac{\partial}{\partial p_{j}}$$ acting on it instead that the kroneker deltas would sum over the summation for me but it definitely has to be a subscript i.

Am I missing the point somewhere?

Thank you!

Hannah

uart
Hannah, you seem really confused about the "kroneker delta" thing. There are no delta functions involved here, the delta is being used as a partial derivative symbol.

Back to the problem of differentiating and as to why the summation "disappears". Consider rewriting it slightly as I have below. Note that I've used a different variable "j" for the dummy variably of summation.

$$\frac{\partial}{\partial p_{i}} [-k \sum_{j=1}^{r} p_{j} ln p_{j}]$$

In particular, think about what happens when $j = i$ and what happens when $j \neq i$.

Hey, thanks, but

in your example, if I were to multiply that out via the product rule

$$- k \sum^{r}_{j=1}[\frac{\partial p_{j}}{\partial p_{i}} ln p_{j} + p_{j} \frac{\partial}{\partial p_{i}} ln p_{j}]$$

Where

$$\frac{\partial p_{j}}{ \partial p_{i} } = \delta _{ij}$$ and that would sum over my indices, but would leave me with the second term being $$\frac{p_{j}}{p_{i}}$$ which doesn't correlate with my notes, it has

$$-k[ln p_{i } + 1]$$ as the answer, and that would suggest to me that I should have $$\frac{p_i}{p_i}$$ as my second term?

???

Thanks

Hannah

uart
Hannah. $p_i$ is one variable in your system, $p_j$ is another different variable (for $i \neq j$). What do you get when you take the partial derivative of a variable with respect to a different variable?

And just to clarify, I might be wrong, but thought that I needed to differentiate wrt

$$\frac{\partial}{\partial p_{i}}$$

on

$$-k \sum_{i} p_{i} ln p_{i}$$

all with subscript "i" because I hope to differentiate each projection (?) separately? Sorry I'm maybe not making myself clear :-)

uart
^^^ No that's where you are going wrong. You need to find the PD for a particular value of the indexed variable. This is a common source of misunderstanding in this type of problem. The sum should run over a "dummy" variable.

BTW. See my previous post.

Stephen Tashi
but would leave me with the second term being $$\frac{p_{j}}{p_{i}}$$
I don't think so. For example, what is $$x \frac{\partial}{\partial y} ln(x)$$ ?

Mute
Homework Helper
Hello!

I'm getting confused when differentiating summations.

I understand that if you differentiate an expression and it gives a kroneker delta, that then sums over the appropriate summation and it disappears. But in my notes it has

$$\frac{\partial}{\partial p_{i}} [-k \sum_{i=1}^{r} p_{i} ln p_{i}]$$
You have an error in your notes. The expression as written above cannot be correct. The letter i is a dummy index that you are summing over. The index i must not be present after you complete the sum, so you cannot then differentiate with respect to p_i. You should be differentiating with respect to p_j (or the dummy index should be different than i if you are differentiating with respect to p_i).

$$\frac{\partial}{\partial p_{i}} [-k \sum_{j=1}^{r} p_{j} ln p_{j}]$$

is that although you recognize that

$$\frac{\partial p_{j}}{ \partial p_{i} } = \delta _{ij}$$

you seem to not have realized that for a differentiation such as

$$\frac{\partial f(p_j)}{\partial p_i}$$

you must use the chain rule:

$$\frac{\partial f(p_j)}{\partial p_i} = \frac{\partial f(p_j)}{\partial p_j}\frac{\partial p_{j}}{ \partial p_{i} } = \frac{\partial f(p_j)}{\partial p_j} \delta_{ij}$$

In particular,

$$\frac{\partial \ln(p_j)}{\partial p_i} = \frac{1}{p_j} \delta_{ij}$$

*OH* ok I think I get it, so for my term

$$\frac{\partial}{\partial p_{j}} ln p_{i}$$

all of the terms would be zero apart from the once instance in which the j = i in the summation? And that justifies getting rid of the summation sign? Is that right?

Thanks!

Hannah

Mute! I see! Woops! Thank you that makes sense :-)

uart
*OH* ok I think I get it, so for my term

$$\frac{\partial}{\partial p_{j}} ln p_{i}$$

all of the terms would be zero apart from the once instance in which the j = i in the summation? And that justifies getting rid of the summation sign? Is that right?

Thanks!

Hannah
Yes you've got it. :) And that's all the discrete delta function $\delta_{i,j}$ means, it's one when i = j and zero when it's not. It's up to you whether or not you want to use that notation or to just consider the cases where i=j and where $i \neq j$ separately.