Antiderivative of $e^x/(1+2e^x)$

I know the solution is $$\dfrac{\ln\left(2\mathrm{e}^x+1\right)}{2}+C$$ However, the result I got was $$\dfrac{\ln\left(\mathrm{e}^x+0.5\right)}{2}+C$$ What I did was:

\begin{align} \int \frac {e^x}{1+2e^x}dx &= \int \frac {e^x}{2*(0.5+e^x)}dx \\ &= 0.5 \cdot \int \frac{e^x}{0.5 + e^x} dx \\ &= 0.5 \cdot (\ln|0.5 + e^x| + C). \end{align}

I know there are antiderivative calculators online that show the correct method step by step, but I can't understand what I did wrong. What's the mistake?

• I think OP choice's of presentation on a line was better than the actual edit, symbols get all packet in a small area now. Why override OP's style when the original LaTeX is ok ? – zwim Dec 3 '17 at 0:34
• I split the lines because it accidentally carried over to a second line, which is distinctly unoptimal. The choice to make three lines instead of two was made on the fly. – davidlowryduda Dec 3 '17 at 0:37
• @zwim Also (I’m not taking sides) multiple lines are better for viewing on mobile. – Chase Ryan Taylor Dec 3 '17 at 1:51

These answers are the same. Namely,

$$\ln(2e^x + 1) = \ln(2(e^x + 0.5)) = \ln(2) + \ln(e^x + 0.5).$$

The added $\ln 2$ is absorbed by the $+ C$, and so we see that the two answers are the same up to an additive constant. There is no error.

You can tell your answer is right by differentiating it and seeing what you get back. Indeed, $$\frac{d}{dx}\left(\frac{\ln(e^x+0.5)}{2}\right) =\frac{1}{2}\frac{e^x}{e^x+0.5} =\frac{e^x}{2e^x+1}.$$ So you are correct. As the other answers point out, the two answers are the same up to a constant.

Let $C = \ln 2$, a constant. Then they're equivalent.

What you did is correct; you just have a different value of $C$. This is why the "$+C$" is so important!

The others have answered your question. Note that one runs into this often also when dealing with trig functions.For example $\int sinx cosx dx= sin^2(x)/2 + C$ if one chooses to make the substitution $u= sinx$, and $\int sin(x)cosx dx= -cos^2(x)/2 + C$, if one chooses $u=cosx$. Both answers are correct, as of course their difference is a constant, since $sin^2(x)+cos^2(x) = 1.$