Guillermo May

2023-03-13

How to find the first and second derivative of $y=\frac{1}{1+{e}^{-x}}$?

wmbishopxxviieg7

$\frac{dy}{dx}=\frac{{e}^{-x}}{{\left(1+{e}^{-x}\right)}^{2}},\frac{{d}^{2}y}{{dx}^{2}}=\frac{{e}^{-2x}-{e}^{-x}}{{\left(1+{e}^{-x}\right)}^{3}}$
Solution:
$\text{Reminder}\phantom{\rule{1ex}{0ex}}\overline{\underline{|\frac{2}{2}\frac{d}{dx}\left({e}^{-x}\right)=-{e}^{-x}\frac{2}{2}|}}$
There are 2 approaches to differentiating this function.
(1) Using the quotient rule
$\left(2\right)\phantom{\rule{1ex}{0ex}}\text{expressing}\phantom{\rule{1ex}{0ex}}y={\left(1+{e}^{-x}\right)}^{-1}\phantom{\rule{1ex}{0ex}}\text{and use chain rule}$
I'll use approach (1), but you could try approach (2). The outcome will be the same.
differentiate using the quotient rule
$\phantom{\rule{1ex}{0ex}}\text{Given}\phantom{\rule{1ex}{0ex}}y=\frac{g\left(x\right)}{h\left(x\right)}\phantom{\rule{1ex}{0ex}}\text{then}$
$\overline{\underline{|\frac{2}{2}\frac{dy}{dx}=\frac{h\left(x\right)g\prime \left(x\right)-g\left(x\right)h\prime \left(x\right)}{{\left(h\left(x\right)\right)}^{2}}\frac{2}{2}|}}$
$g\left(x\right)=1⇒g\prime \left(x\right)=0$
$h\left(x\right)=1+{e}^{-x}⇒h\prime \left(x\right)=-{e}^{-x}$
$⇒\frac{dy}{dx}=\frac{\left(1+{e}^{-x}\right).0-1.\left(-{e}^{-x}\right)}{{\left(1+{e}^{-x}\right)}^{2}}=\frac{{e}^{-x}}{{\left(1+{e}^{-x}\right)}^{2}}$
$\phantom{\rule{1ex}{0ex}}\text{To find}\phantom{\rule{1ex}{0ex}}\frac{{d}^{2}y}{{dx}^{2}}\phantom{\rule{1ex}{0ex}}\text{differentiate}\phantom{\rule{1ex}{0ex}}\frac{dy}{dx}$
differentiate using the quotient rule/chain rule
$\text{here}\phantom{\rule{1ex}{0ex}}g\left(x\right)={e}^{-x}⇒g\prime \left(x\right)=-{e}^{-x}$
$h\left(x\right)={\left(1+{e}^{-x}\right)}^{2}⇒h\prime \left(x\right)=2\left(1+{e}^{-x}\right).\left(-{e}^{-x}\right)\to$
$⇒h\prime \left(x\right)=-2{e}^{-x}\left(1+{e}^{-x}\right)$
$\frac{{d}^{2}y}{{dx}^{2}}=\frac{{\left(1+{e}^{-x}\right)}^{2}\left(-{e}^{-x}\right)-\left({e}^{-x}\right).\left(-2{e}^{-x}\left(1+{e}^{-x}\right)\right)}{{\left(1+{e}^{-x}\right)}^{4}}$
$=\frac{-{e}^{-x}{\left(1+{e}^{-x}\right)}^{2}+2{e}^{-2x}\left(1+{e}^{-x}\right)}{{\left(1+{e}^{-x}\right)}^{4}}$
$=\frac{{e}^{-x}\left(1+{e}^{-x}\right)\left(2{e}^{-x}-1-{e}^{-x}\right)}{{\left(1+{e}^{-x}\right)}^{4}}←\phantom{\rule{1ex}{0ex}}\text{factoring}$
$=\frac{{e}^{-x}\overline{)\left(1+{e}^{-x}\right)}\left({e}^{-x}-1\right)}{\overline{){\left(1+{e}^{-x}\right)}^{3}}}$
$=\frac{{e}^{-2x}-{e}^{-x}}{{\left(1+{e}^{-x}\right)}^{3}}$

Do you have a similar question?