\(\int\displaystyle\frac{dx}{1+e^x}\) is equal to
Answer & explanation
Correct answer: option 4
The correct answer is Option (4) → \(x-\log\left(1+e^x\right)+C\)
Adding and subtracting \(e^x\) in the numerator splits the fraction:
\( \displaystyle \frac{1}{1+e^x} = \frac{\left(1+e^x\right)-e^x}{1+e^x} = 1-\frac{e^x}{1+e^x} \)
The second part has the form \(\frac{f'(x)}{f(x)}\) with \(f(x) = 1+e^x\):
\( \displaystyle \int\left(1-\frac{e^x}{1+e^x}\right)dx = x-\log\left(1+e^x\right)+C \)
Why the other options are incorrect
Option (1) \(\log\left(1+e^x\right)+C\) — Incorrect. Its derivative is \(\frac{e^x}{1+e^x}\), which has \(e^x\) in the numerator.
Option (2) \(x+\log\left(1+e^x\right)+C\) — Incorrect. Its derivative is \(1+\frac{e^x}{1+e^x}\); the log term must be subtracted.
Option (3) \(\log\left(1+e^{-x}\right)+C\) — Incorrect. Its derivative is \(\frac{-e^{-x}}{1+e^{-x}} = -\frac{1}{1+e^x}\), so the sign is wrong; the answer equals \(-\log\left(1+e^{-x}\right)+C\).