How do you find the first and second derivative of #y=1/(1+e^x)#?

2 Answers
Jun 26, 2018

#d/dx(1/(1+e^x))=-e^x/(1+e^x)^2#
#d^2/dx^2(1/(1+e^x))=(e^x*(1-e^x))/((1+e^x)^3)#

Explanation:

First derivative is just applying chain rule to #(1+e^x)^-1#
which gives:
#d/dx((1+e^x)^-1)=-1*(1+e^x)^-2*e^x=-e^x/(1+e^x)^2#
For the second derivative we need the quotient rule which states:
#d/dx((u(x))/(v(x)))=(u'(x)*v(x)-u(x)*v'(x))/(v(x)^2)#

#u(x)=e^x# ; #u'(x)=e^x#
#v(x)=(1+e^x)^2# ; #v'(x)=2*(1+e^x)*e^x#
Plugging this in we get:

#d^2/dx^2(1/1+e^x)=(e^x*(1+e^x)^2-e^x*e^x*2*(1+e^x))/((1+e^x)^2)^2#
This can be simplified to:
#=(e^x*(1+e^x)((1+e^x)-2e^x))/((1+e^x)^4)=(e^x*((1+e^x)-2e^x))/((1+e^x)^3)=(e^x*(1-e^x))/((1+e^x)^3)#

#\frac{dy}{dx}=-\frac{e^x}{(1+e^x)^{2}}\quad#, #\frac{d^2y}{dx^2}=\frac{e^{x}(e^x-1)}{(1+e^x)^{3}}#

Explanation:

Given that

#y=\frac{1}{1+e^x}#
Differentiating w.r.t. #x# as follows

#\frac{dy}{dx}=\frac{d}{dx}(1+e^x)^{-1}#

#\frac{dy}{dx}=-(1+e^x)^{-2}\frac{d}{dx}(1+e^x)#

#\frac{dy}{dx}=-\frac{1}{(1+e^x)^{2}}e^x#

#\frac{dy}{dx}=-\frac{e^x}{(1+e^x)^{2}}#
Differentiating w.r.t. #x# as follows

#\frac{d}{dx}\frac{dy}{dx}=-\frac{d}{dx}\frac{e^x}{(1+e^x)^{2}}#

#\frac{d^2y}{dx^2}=-\frac{(1+e^x)^{2}\frac{d}{dx}e^x-e^x\frac{d}{dx}(1+e^x)^2}{((1+e^x)^{2})^2}#

#\frac{d^2y}{dx^2}=-\frac{(1+e^x)^{2}e^x-e^x2(1+e^x)e^x}{(1+e^x)^{4}}#

#\frac{d^2y}{dx^2}=\frac{2e^{2x}-e^x(1+e^x)}{(1+e^x)^{3}}#

#\frac{d^2y}{dx^2}=\frac{e^x(2e^{x}-(1+e^x))}{(1+e^x)^{3}}#

#\frac{d^2y}{dx^2}=\frac{e^x(e^{x}-1)}{(1+e^x)^{3}}#