4

Sigmoid function is defined as $$\frac{1}{1+e^{-x}}$$ I tried to calculate the derivative and got $$\frac{e^{-x}}{(e^{-x}+1)^2}$$ Wolfram|Alpha however give me the same function but with exponents on $e$ changed of sign

Someone could explain this to me?

seldon
  • 1,442

4 Answers4

5

Multiply both numerator and denominator by $e^{2x}$ and you will get Wolfram|Alpha result.

2

Using the fact $$e^{-x}=\frac{1}{e^x}$$ we have that $$\frac{e^{-x}}{(1+e^{-x})^2}=\dfrac{\dfrac{1}{e^x}}{(1+\dfrac{1}{e^x})^2}=\dfrac{\dfrac{1}{e^x}}{(\dfrac{e^x+1}{e^x})^2}=$$ $$=\frac{\dfrac{1}{e^x}}{\dfrac{(e^x+1)^2}{e^x\cdot e^x}}=\frac{1}{\dfrac{(e^x+1)^2}{e^x}}=\frac{e^x}{(1+e^x)^2}$$

Adi Dani
  • 17,007
1

Use the formula: $\left(\frac{1}{f(x)}\right)'=-\frac{f'(x)}{f^2(x)}$ and we have:

$$\left(\frac{1}{1+e^{-x}}\right)'=\frac{-(1+e^{-x})'}{(1+e^{-x})^2}=\frac{-1'-(e^{-x})'}{(1+e^{-x})^2}=\frac{0-(-x)'(e^{-x})}{(1+e^{-x})^2}=\frac{-(-1)(e^{-x})}{(1+e^{-x})^2}=$$ $$=\frac{e^{-x}}{(1+e^{-x})^2}$$

knok16
  • 133
Madrit Zhaku
  • 5,352
0

The sigmoid function is defined as $$\frac{1}{1+e^{−x}}.$$ I tried to calculate the derivative and got $e^{−x}(e^{-x}+1)^2$.

We can rewrite this as:

$$e^{-x}(e^{-x}+1) \times \frac{1}{1+e^{-x}}.$$

This is sigmoid($x$)$\times$sigmoid($-x$).

Bowei Tang
  • 3,763