# Difficulty deducing derivatives of particular summation formulas

I have difficulty concluding the derivatives of the following:

$$y=\ln\bigg(\sum_{j=1}^ng_j\cdot e^{xE_j}\bigg)$$ and $$y=x\cdot \sum_{j=1}^n \bigg(g_j \cdot \frac{N}{\sum_{j=1}^ng_j\cdot e^{xE_j}}\cdot e^{xE_j}\cdot E_j\bigg)$$ Note that $$x$$ does not change during the summation. Are these possible to solve? If so, how?

EDIT: I have made a mistake when copying the second formula, I have corrected it.

• What derivatives are you taking? $\frac{\partial y}{\partial E_j}$, or $\frac{\partial y}{\partial g_j}$, presumably not $\frac{dy}{dx}$ since you're suggesting $x$ is constant. Is this something from statistical mechanics by any chance? – snulty May 7 at 23:47
• He is saying that $x$ is the variable to differentiate wrt, but the series index is not $x$. Here what I'd do is say $e^y = \sum$ and then you can differentiate both sides wrt $x$ (implicit differentiation), giving $\frac{dy}{dx}e^y = \frac{d}{dx}\Sigma$. To differentiate the series, just differentiate each term and sum them together. – George Dewhirst May 8 at 0:35
• For the second one I'd guess the answer is just $y=N$ with derivative zero, but seeing as there is probably $N = N_j$ i.e. $N$ varying, what you should do is take $(\sum_{j=1}^n g_j e^{xE_j})^{-1}$ out as a multiple, and use the product rule of differentiation. – George Dewhirst May 8 at 0:38
• @GeorgeDewhirst For the 1st formula, if $\frac{dy}{dx}e^y = \frac{d}{dx}\Sigma$ then I get $\frac{dy}{dx} = \frac{1}{x} \cdot \sum_{j=1}^n(g_j \cdot E_j \cdot e^{xE_j})$. But a different source is telling me otherwise saying that the derivative of $\ln(g(x))$ is $\frac{g'(x)}{g(x)}$, thus $\frac{dy}{dx} = \frac{\sum_{j=1}^n (g_j \cdot E_j e^{xE_j})}{\sum_{j=1}^n (g_j \cdot e^{xE_j})}$. For the second formula, I made a mistake; the summation itself should be multiplied by $x$ as well (I corrected it in the OP). The $N$ is a constant and does not vary during the summation. – JohnnyGui May 8 at 17:15

If $$y =\ln\bigg(\sum_{j=1}^ng_j\cdot e^{xE_j}\bigg)$$ then, since $$(\ln(f(x))' =\dfrac{f'(x)}{f(x)}$$,

$$\begin{array}\\ y' &=\dfrac{(\sum_{j=1}^ng_j e^{xE_j})'}{\sum_{j=1}^ng_je^{xE_j}}\\ &=\dfrac{\sum_{j=1}^ng_jE_j e^{xE_j}}{\sum_{j=1}^ng_je^{xE_j}}\\ \end{array}$$

For your second $$y$$, you need to make the index in the inner sum different than the index in the outer sum.

$$\begin{array}\\ y &=x \sum_{j=1}^n \bigg(g_j \dfrac{N}{\sum_{k=1}^ng_ke^{xE_k}} e^{xE_j}\bigg)\\ &=N\sum_{j=1}^n \bigg(g_j \dfrac{xe^{xE_j}}{\sum_{k=1}^ng_ke^{xE_k}} \bigg)\\ &=N\sum_{j=1}^n g_jy_j(x)\\ \end{array}$$

where $$y_j(x) = \dfrac{xe^{xE_j}}{\sum_{k=1}^ng_ke^{xE_k}}$$.

Then

$$\begin{array}\\ y_j'(x) &= \left(\dfrac{xe^{xE_j}}{\sum_{k=1}^ng_ke^{xE_k}}\right)'\\ &= \dfrac{(\sum_{k=1}^ng_ke^{xE_k})(xe^{xE_j})'-(\sum_{k=1}^ng_ke^{xE_k})'(e^{xE_j})}{(\sum_{k=1}^ng_ke^{xE_k})^2}\\ &= \dfrac{(\sum_{k=1}^ng_ke^{xE_k})((xE_j+1)e^{xE_j})-(\sum_{k=1}^ng_kE_ke^{xE_k})(e^{xE_j})}{(\sum_{k=1}^ng_ke^{xE_k})^2}\\ &= e^{xE_j}\dfrac{(xE_j+1)\sum_{k=1}^ng_ke^{xE_k}-\sum_{k=1}^ng_kE_ke^{xE_k}}{(\sum_{k=1}^ng_ke^{xE_k})^2}\\ \end{array}$$

Now put this in $$y'(x) =\sum_{j=1}^n g_jNy_j'(x)$$, do any possible simplifications, correct any errors I may have made, and you are done.

• Thanks a lot. I'm so sorry, I have a mistake in the OP, the second formula within the summation should be multiplied by $E_j$ such that $y=x\cdot \sum_{j=1}^n (g_j \cdot \frac{N}{\sum_{j=1}^ng_j\cdot e^{xE_j}}\cdot e^{xE_j}\cdot E_j)$. Not sure if this would change the whole derivation. – JohnnyGui May 8 at 19:40
• Nope. Just changes the final summation. The $y_j$ remain the same. – marty cohen May 9 at 2:14
• Such that $y'(x)=\sum_{j=1}^n E_j g_jNy_j'(x)$? – JohnnyGui May 9 at 16:00
• Yup. If $E-J$ is there, use it. – marty cohen May 9 at 19:54
• I think your $x$ in the denominator of $y'_j(x)$ should not be there. – JohnnyGui May 9 at 20:57