Answer
The solution is $$\int\frac{1}{1+e^{2x}}dx=x-\frac{1}{2}\ln(1+e^{2x})+c.$$
Work Step by Step
To solve the integral
$$\int\frac{1}{1+e^{2x}}dx$$
we will use substitution $e^x=t$ which gives us $e^xdx=dt\Rightarrow dx=\frac{dt}{e^x}=\frac{dt}{t}.$ Putting that into the integral he get:
$$\int\frac{1}{1+e^{2x}}dx=\int\frac{1}{t(1+t^2)}dt.$$
To solve the last integral we will use partial fractions method:
$$\frac{1}{t(1+t^2)}=\frac{A}{t}+\frac{Bt+C}{1+t^2},$$
where $A,B,C$ are constants we need to find. To do that follow the steps below:
Step 1: Put the fractions on right side together with the common denominator:
$$\frac{1}{t(1+t^2)}=\frac{A}{t}+\frac{Bt+C}{1+t^2}=\frac{A(1+t^2)+t(Bt+C)}{t(1+t^2)}=\frac{A+At^2+Bt^2+Ct}{t(1+t^2)}.$$
Step 2: Equate the numerators of the starting and the final fraction:
$$1=A+At^2+Bt^2+Ct=(A+B)t^2+Ct+A.$$
Step 3: Equate the coefficients multiplying the same powers of $t$ on the both sides. Note that there is no $t$ and $t^2$ on the left, so their coefficients are $0$:
$A=1,A+B=0,C=0.$ Putting $A=1$ into the second equation we get $B=-1.$
Using the obtained values for $A,B,C$ we get:
$$\frac{1}{t(1+t^2)}=\frac{A}{t}+\frac{Bt+C}{1+t^2}=\frac{1}{t}-\frac{t}{1+t^2}.$$
Now we can go back on solving the integral:
$$\int\frac{1}{t(1+t^2)}dt=\int\left(\frac{1}{t}-\frac{t}{1+t^2}\right)dt
=\int\frac{1}{t}dt-\int\frac{t}{1+t^2}dt.$$
We get two integrals and first of them can be solved using the table of integrals and to solve the second we will use substitution.
Solve the first integral:
$$\int\frac{1}{t}dt=\ln|t|+c_1,$$
where $c_1$ is arbitrary constant.
Solve the second integral:
Substitution: $z=1+t^2\Rightarrow 2tdt=dz$ Putting this into the integral we have:
$$\int\frac{t}{1+t^2}dt=\frac{1}{2}\int\frac{dz}{z}=\frac{1}{2}\ln|z|+c_2,$$ where $c_2$ is arbitrary constant.
Now we have to express our solution in terms of $t$ by expressing $z$ in terms of $t$:
$$\int\frac{t}{1+t^2}dt=\frac{1}{2}\ln|z|+c_2=\frac{1}{2}\ln(1+t^2)+c_2.$$
Now we have:
$$\int\frac{1}{t(1+t^2)}dt=\int\frac{1}{t}dt-\int\frac{t}{1+t^2}dt=\ln|t|+c_1-\frac{1}{2}\ln(1+t^2)+c_2=\ln|t|-\frac{1}{2}\ln(1+t^2)+c$$
where we put that $c=c_1+c_2$ which is arbitrary constant as well.
We have to express the solution in terms of $x$ and to do that we will express $t$ in terms of $x$:
$$\int\frac{1}{1+e^{2x}}dx=\ln|t|-\frac{1}{2}\ln(1+t^2)+c=\ln e^x-\frac{1}{2}\ln(1+e^{2x})+c=x-\frac{1}{2}\ln(1+e^{2x})+c.$$