# How to find the derivative of this?

$$f(z) = \frac{\exp(z)}{1+\exp(z)}$$

My thought was to apply quotient rule with the denominator needing chain rule. But I feel like my answer is off.

Here's my working:

$$\frac{exp(z)}{1+exp(z)} = \frac{(1 + exp(z))^{-1}exp(z) - exp(z)(-1)(1 + exp(z))^{-2}(exp(z))}{(1 + exp(z))^2}$$

$$= \frac{exp(z)}{(1+exp(z))^3} + \frac{exp(z)^2}{(1+exp(z))^4}$$ $$= \frac{exp(z) + exp(z)^2 + exp(z)^2}{(1 + exp(z))^4}$$ $$= \frac{exp(z)(1 + 2exp(z))}{(1 + exp(z))^4}$$

• Your suggested approach will work. Why don't you show us what you tried? – angryavian Sep 30 '19 at 8:28
• Just show us your answer. – Wuestenfux Sep 30 '19 at 8:29
• It's hard to be more accurate without seeing your attempt, but I do want to point out that you don't need the chain rule for the denominator; the derivative of $1 + \exp(x)$ is $\exp(x)$. – Theo Bendit Sep 30 '19 at 8:42
• In case you apply the quotient rule there's no need for the chain rule. The latter must be applied in José's approach. – Michael Hoppe Sep 30 '19 at 8:49
• – Hans Lundmark Sep 30 '19 at 9:51

Your approach is fine. A simpler approach would consist of starting with the equality$$\frac{\exp(z)}{1+\exp(z)}=1-\frac1{1+\exp(z)}.$$

• Another alternative: $\frac{\exp(z)}{1 + \exp(z)} = \frac{1}{1 + \exp(-z)}$. – angryavian Sep 30 '19 at 8:50

Quotient rule approach: $$(\dfrac{e^z}{1+e^z})'=\dfrac {e^z(1+e^z)-e^z(e^z)}{(1+e^z)^2}=\dfrac {e^z}{(1+e^z)^2}$$.