We are given:
[MATH]I=\int\frac{e^{3x}}{1+e^{2x}}\,dx[/MATH]
If I were going to use the second substitution you posted, I would let:
[MATH]t=e^{3x}\implies dt=3e^{3x}dx[/MATH]
And now we have:
[MATH]I=\frac{1}{3}\int\frac{1}{1+t^{\frac{2}{3}}}\,dt=\frac{1}{3}\int\frac{t^{-\frac{2}{3}}}{t^{-\frac{2}{3}}+1}\,dt[/MATH]
Next, let:
[MATH]u=t^{\frac{1}{3}}\implies du=\frac{1}{3}t^{-\frac{2}{3}}\,dt[/MATH]
And we have:
[MATH]I=\int\frac{1}{u^{-2}+1}\,du=\int\frac{u^2}{u^{2}+1}\,du=\int 1-\frac{1}{u^2+1}\,du[/MATH]
[MATH]I=u-\arctan(u)+C=e^x-\arctan(e^x)+C[/MATH]