# Neural Networks sigmoid function: How do you rewrite $e^x/(e^x + 1)$ to $1/(e^{-x} + 1)$

$$\sigma(z) = \frac{e^x}{e^x + 1}$$

$$\sigma(z) = \frac{1}{e^{-x} + 1}$$

They are both the same but I'm unable to rewrite one to the other. I'm learning about neural networks for fun and I understand what it does. I find the first equation more intuitive to understand than the second equation, which is why I'd want to be able to understand how to rewrite it.

I have a couple of questions:

1. How would I Google for this question? I think even in Dutch (my native language) I'd have trouble in this.

2. How do you rewrite one equation to the other? I've seen a couple of blogs doing it, but I didn't save it. It involved some +1 and -1 trickery.

I don't know how to search for it. And it may be the case that this answer has already been answered on Stack Exchange, but I couldn't find it via Google. The search term scavenger hunt has taken 1 hour already.

• Tip: $\LaTeX$ also works in titles. – Mohammad Zuhair Khan Feb 1 '19 at 11:18
• I don't think you can Google this as it is not a real difficulty (just you needing a coffee ;-). – Yves Daoust Feb 1 '19 at 11:27

$$\frac{a}{a+1}=\frac{a}{a(1+\frac{1}{a})}=\frac{1}{1+\frac{1}{a}}$$. If $$a=e^x$$, then $$\frac{1}{a}=e^{-x}.$$
• Thanks I get it! Your solution shows a cool trick that $a+1 = a(1+\frac{1}{a})$, I didn't know that. I mean it makes sense, but to me it looks like the invention of the paper clip. Simple to use, hard to come up with. – Melvin Roest Feb 1 '19 at 11:17
Take $$\sigma(z) = \frac{e^x}{e^x + 1}$$, divide both numerator and denominator by $$e^x$$. You get $$\sigma(z) = \frac{1}{e^{-x} + 1}$$