How has this derivation been achieved? This is a step in a derivation I am to know, but I can't figure out how to achieve it - specifically, how we end up with $1 + e^{-X\theta}$ instead of $1 + e^{X\theta}$ as the denominator in the applicable terms. Working it through I seem to get the latter.
These steps are given in the literature, not derived by me:
$$\frac{\delta}{\delta\theta}\left[-y\log(1 + e^{-X\theta}) + (1 - y)\left[-X\theta - \log(1 + e^{-X\theta})\right]\right]$$
$$= -y\left(\frac{-X}{1 + e^{-X\theta}}\right) + (1 - y)\left(-X - \frac{-X}{1 + e^{-X\theta}}\right)$$
(see http://cl.ly/image/2o2R1P1d290u for all steps)
To offer some context factoring out $-X$ would leave in the first term, for example, $\frac{1}{1 + e^{-X\theta}}$ which is the sigmoid function, and this is indeed what is required for the subsequent steps.
I suppose my problem must lie in my calculation:
$$\frac{\delta}{\delta\theta}\left(-y\log(1 + e^{-X\theta})\right) = -y\frac{-X\frac{1}{e^{X\theta}}}{1 + e^{-X\theta}} = -y\frac{-X}{1 + e^{X\theta}}$$
Thanks in advance.
 A: You have $1+e^{-X\theta}$ inside of logarithm. After derivative is taken, the content of the logarithm moves into denominator, because $\frac{d}{du}\log u=\frac{1}{u}$. You also get the derivative of $1+e^{-X\theta}$ in the numerator (chain rule), which is $-X\,e^{-X\theta}$. So,
$$\frac{\partial}{\partial\theta}\left[-y \log(1 + e^{-X\theta})\right]
=-y \frac{-X\,e^{-X\theta}}{1 + e^{-X\theta}}$$
and
$$\frac{\partial}{\partial\theta}\left[ (1 - y)\left[-X\theta - \log(1 + e^{-X\theta})\right]\right] =
(1 - y)\left\{-X -\frac{-X\,e^{-X\theta}}{1 + e^{-X\theta}}\right\}
$$ 
One can then simplify a bit, using 
$$
\frac{-X\,e^{-X\theta}}{1 + e^{-X\theta}} = \frac{-X }{ e^{X\theta}+1}
$$
A: For the first term
$$\frac d{d\theta}\bigg(-y\log(1 + e^{-X\theta})\bigg)=-y\frac d{d\theta}\bigg(\log(1 + e^{-X\theta})\bigg)=-y\frac 1{1+e^{-X\theta}}\frac d{d\theta}\bigg(1 + e^{-X\theta}\bigg)$$
$$=-y\frac {e^{-X\theta}}{1+e^{-X\theta}}\frac d{d\theta}\bigg(-X\theta\bigg)=-y\frac {-Xe^{-X\theta}}{1+e^{-X\theta}}$$
and some manipulation
$$-y\frac {-Xe^{-X\theta}}{1+e^{-X\theta}}=-y\frac {-X}{\big(1+e^{-X\theta}\big)e^{X\theta}}=-y\frac {-X}{e^{X\theta}+1}$$
