# Softmax function derivative - a couple of doubts

Given, the SoftMax function:

$$$$p_j = \frac{e^{o_j}}{\sum_k e^{o_k}}$$$$ which is posted here: Derivative of Softmax loss function

The following are it's derivatives, as posted in the link: $$$$\frac{\partial p_j}{\partial o_i} = p_i(1 - p_i),\quad i = j$$$$

and

$$$$\frac{\partial p_j}{\partial o_i} = -p_i p_j,\quad i \neq j.$$$$

I just wanted to know HOW we arrived at these derivatives, and have been scratching my head for hours! Another thing I can't understand, along similar lines is how we arrive at this..:

$$$$1+\sum_{j=1}^{M-1}\exp{\{\eta_{j}\}}={\sum_{j=1}^M\exp{\{\eta_{j}\}}}$$$$

Much appreciate any answers, thank you!

• You just need to apply $\frac{d(\frac{f(x)}{g(x)})}{dx} = \frac{f'g-g'f}{g^2}$. – Peanojr Oct 2 '19 at 10:11
• That is helpful, thank you. – RohanChandra Oct 2 '19 at 10:58