9

For logistic functions in the form of $\frac{C}{1+Ae^{-bx}}$ where $C,A,b>0$ and $x$ is the independent variable, how does one integrate this function type? since during integration, the denominator is to the power of $(-1)$ and integrating will resulting in a power of $(0)$. I have tried a few websites such as cymath, wolfram and symbolab but havent been able to understand their working. for example $$\int \frac{1}{1+e^{-x}}dx=x+\ln \left|1+e^{-x}\right|+C$$.

edit: if the anti-derivative is used for finding an area of the original function through integration, how can an unknown bound for a particular area be solved? is it possible?

lohboys
  • 437
  • You can also take the limit $$\lim_{\varepsilon \rightarrow 0}\frac{x^\varepsilon - 1} \varepsilon = \ln x$$, where the constant of integration is $\frac {-1} {\varepsilon} +C$ – wilsonw May 27 '23 at 23:11

4 Answers4

11

the denominator is to the power of (−1) and integrating will resulting in a power of (0).

This is where you are misunderstood. $\int\frac{1}{x} dx$ = $\ln|x|$. The power rule does not apply when you are integrating $x^{-1}$.

In order to tackle this, you can do u-substitution. You can simplify to:

$$\int \frac{e^x}{e^x+1} dx$$

And you can let $u = e^x+1$, therefore $du = e^x dx$

This leaves you with:

$$\int \frac{1}{u}du$$ And that's the exception to the power rule like I said above.

So this becomes:

$$\ln|u|$$

Substituting back in for $u = e^x+1$ gets you:

$$\ln|e^x+1| + C $$

rb612
  • 3,560
  • from this point onward, can the anti-derivative (above) be solved for area between the curve and x-axis when only one of the two bounds are known? since the logistic function has a root (as a lower bound), im looking for an upper bound which will result in a particular area? – lohboys Jul 21 '17 at 07:03
  • What do you mean exactly? I'm not sure what you mean by the logistic function having a root as a lower bound. The logistic function $f(x)>0$ for all $x$. You can always apply the fundamental theorem of calculus, where the signed area under the logistic function from $a$ to $b$ is $F(b)-F(a)$, where $F(x)$ is the antiderivative. So if you wanted for example the integral from $a$ to $t$ instead, it would be $F(t)-F(a)$. – rb612 Jul 21 '17 at 21:18
  • so if i vertically translate the logistic function downwards (working with $\frac{3}{1+e^{-x}}-2$ right now) there is an area between the y-axis, x-axis and root of the function under the x-axis. im trying to find the bounds for which the an equal area is achieved above the x-axis where the lower bound of this integral is the root of the function. – lohboys Jul 22 '17 at 01:39
  • @lohboys for that, if I'm understanding you correctly, you'd like the integral from -infinity to +infinity to equal 0. You'd need to set the second derivative to 0 and find the x value where that happens. You need to translate the logistic function down the exact amount of the value of the logistic function at the x point of inflection. If that makes sense. – rb612 Jul 22 '17 at 23:47
  • @lohboys so for your example, the inflection point occurs at $x=0$. So the value of the logistic function is $-.5$. Subtracting this from the function gives you $f(x) = \frac{3}{1+e^-x} - 1.5$. Now evaluating the integral of this function with bounds $a$ and $b$ where $a = -b$, will yield a value of $0$ (areas are equal) – rb612 Jul 23 '17 at 03:34
  • i'll give you an example of what i did which the basic quadratic, $x^2$ (https://drive.google.com/file/d/0B8Q5jORpvbaDY1lTSGNPTjJDWWc/view?usp=sharing) . so with the logistic function, i have found the root of the logistic function and the area enclosed under the x-axis, y-axis and the function (similar to the image) but need to find the bound for which an equivalent area above the x-axis is present. – lohboys Jul 23 '17 at 11:21
6

$$\int \frac{dx}{1+e^{-x}}=\int \frac{e^{x}}{e^{x}}\frac{dx}{1+e^{-x}}$$

$$\int\frac{e^xdx}{e^x+1}=\int\frac{e^x+1-1 dx}{e^x+1}$$

$$\int\frac{e^x+1-1 dx}{e^x+1}=\int\frac{e^x+1 dx}{e^x+1}+\int\frac{-1dx}{e^{x}+1}$$

$$\int\frac{e^x+1 dx}{e^x+1}+\int\frac{-1dx}{e^{x}+1}=\int dx-\int(\frac{e^{-x}}{e^{-x}})\frac{dx}{e^{x}+1}$$

$$\int dx-\int(\frac{e^{-x}}{e^{-x}})\frac{dx}{e^{x}+1}=\int dx -\int\frac{e^{-x}dx}{1+e^{-x}} $$

$$\int dx -\int\frac{e^{-x}dx}{1+e^{-x}} =x+\ln|1+e^{-x}|+C$$

Another way to do this would be

$$\int \frac{dx}{1+e^{-x}}=\int \frac{e^{x}}{e^{x}}\frac{dx}{1+e^{-x}}$$

$$\int \frac{e^{x}}{e^{x}}(\frac{dx}{1+e^{-x}})=\int\frac{e^xdx}{e^x+1}$$

$$\int\frac{e^xdx}{e^x+1}=\ln|{e^x+1}|+c$$

Crazy
  • 2,125
3

The trick is to write $$ \frac{1}{1+e^{-x}}=\frac{1+e^{-x}-e^{-x}}{1+e^{-x}}=\frac{1+e^{-x}}{1+e^{-x}}+\frac{-e^{-x}}{1+e^{-x}}=1+\frac{-e^{-x}}{1+e^{-x}}. $$ Now you integrate \begin{align} \int\frac{1}{1+e^{-x}}dx=\int1+\frac{-e^{-x}}{1+e^{-x}}dx=\int 1dx+\int\frac{-e^{-x}}{1+e^{-x}}dx=x+C+\int\frac{-e^{-x}}{1+e^{-x}}dx \end{align} Defining $f(x)=1+e^{-x}$ yields $f'(x)=-e^{-x}$ and $$ \int\frac{-e^{-x}}{1+e^{-x}}dx=\int\frac{f'(x)}{f(x)}dx=\ln|f(x)|+C=\ln|1+e^{-x}|+C. $$ Together we get $$ \int\frac1{1+e^{-x}}dx=x+\ln|1+e^{-x}|+C $$

3

If we have $f(x) = \frac{C}{1 + Ae^{-bx}}$, with $C,A,b > 0$. We can find its antiderivative $$F(x) = \int \frac{C}{1 + Ae^{-bx}}dx$$ $$= C\int \frac{1}{1 + Ae^{-bx}}dx$$ $$= C\int \frac{1 + Ae^{-bx} - Ae^{-bx}}{1 + Ae^{-bx}}dx$$ $$= C\int 1 - \frac{Ae^{-bx}}{1 + Ae^{-bx}}dx$$ $$= C\int dx - C\int \frac{Ae^{-bx}}{1 + Ae^{-bx}}dx$$ $$= Cx - C\frac{1}{-b} \int \frac{-bAe^{-bx}}{1 + Ae^{-bx}}dx$$ $$= Cx + \frac{C}{b} \int \frac{(1 + Ae^{-bx})'}{1 + Ae^{-bx}}dx$$ $$= Cx + \frac{C}{b} ln|1 + Ae^{-bx}| + Const$$ Now, if you want to know what is the area under the curve, you just need compute $$\int_{x_{1}}^{x_{2}}f(x)dx = F(x_{2}) - F(x_{1})$$