3

Let $I$ be the integral we are asked to evaluate. We have: $$ I = \int \dfrac{1}{e^x \left( e^{x}+1\right) } \,\, dx $$ Now, I apply the technique of partial fractions. \begin{align*} \dfrac{1}{e^x \left( e^{x}+1\right)} &= \dfrac{ A }{e^x+1} + \dfrac{B}{e^x} \\ 1 &= A( e^x) + B(e^x+1) \\ \end{align*} Now, we setup the following system of equations: \begin{align*} A + B &= 0 \\ B &= 1 \end{align*} Solving for $A$ we find that $A = -1$. \begin{align*} I &= \int \dfrac{1}{e^x} \,\, dx - \int \dfrac{1}{\left( e^{x}+1\right)} \,\, dx \\ \int \dfrac{1}{e^x} \,\, dx &= \int e^{-x} \,\, dx \\ \int \dfrac{1}{\left( e^{x}+1\right)} \,\, dx &= \int \dfrac{e^x}{\left( e^{2x}+e^x\right)} \,\, dx \\ u &= e^x \\ du &= e^x \, dx \\ \int \dfrac{1}{\left( e^{x}+1\right)} \,\, dx &= \int \dfrac{1}{u^2 + u} \,\, du \\ \end{align*} Now, I apply the technique of partial fractions. \begin{align*} \dfrac{1}{u^2 + u} &= \dfrac{1}{u(u+1)} \\ \dfrac{1}{u^2 + u} &= \dfrac{ C }{u+1} + \dfrac{D}{u} \\ 1 &= Cu + D(u+1) \\ D &= 1 \\ C &= -1 \\ \dfrac{1}{u^2 + u} &= \dfrac{1}{u} - \dfrac{1}{u+1} \\ \int \dfrac{1}{e^x+1} \, dx &= \int e^{-x} \, dx - \int e^{-x+1} \, dx \\ \int \dfrac{1}{e^x+1} \, dx &= -e^{-x} + e^{-x+1} \\ I &= -e^{-x} - \left( -e^{-x} + e^{-x+1} \right) + C \\ I &= e^{-x+1} + C \end{align*} According to an online integral calculator, the answer is: $$ \ln{\left( e^x + 1 \right) } - e^{-x} - x + C$$ Where did I go wrong?

Bob
  • 3,954
  • 5
    $1/(u+1) \neq e^{-x+1}$. Also, why did you multiply by $e^x$ after the first partial fractions, when you could have multiplied by $e^{-x}$? This would have saved you a second partial fractions computation and limited your opportunities for error. – Ninad Munshi Apr 24 '23 at 17:13
  • @NinadMunshi Multiplying by $e^{-x}$ would have been the smart thing to do. It leads to a better solution. However, I did not see it until you told me. – Bob Apr 24 '23 at 18:53

2 Answers2

2

so I think you over complicated this integrel just multiblay and divide by $e^{-x}$ and get $$\int \frac{e^{-x}}{1+e^{-x}}dx=-ln(1+e^{-x})+c=-ln(e^{x}+1)+x+c$$ so the desired integral is $$ln(e^{x}+1)-x-e^{-x}+C$$

1

The error is in $\int \dfrac{1}{e^x+1} \, dx = -e^{-x} + e^{-x+1}$. In fact you have everything you need to complete the integral correctly: write (as you did) $$\int \dfrac{1}{e^x+1} \, dx = \int \dfrac{1}{u^2+u} \, dx =\int \dfrac{1}{u}- \dfrac{1}{u+1}\, dx=\ln\left|u\right|-\ln\left|u+1\right|=x-\ln\left|e^x+1\right|$$ and you will get the answer given for I.

mcd
  • 3,448