`f(x)= -tanh^-1(sqrt(1-e^(2x)) + C` is not an incorrect solution.
The derivative of tanh^-1(x) is `1/(1-x^2)` .
The solution that you have proposed is just tanh^-1 expressed on the complex plane.
Further Reading
Step 1: integration by substitution
`u = 2x -gt du=2dx -gt dx=1/2du`
`= 1/2int(du)/(sqrt(1-e^u))`
Step 2: integration by substitution
`v = e^u -gt dv=e^udu -gt du=(dv)/v`
`= 1/2int(dv)/(vsqrt(1-v))`
Step 3: integration by substitution
`w = 1-v -gt v = 1-w`
`dw = -dv`
`=1/2int(dw)/((-1+w)sqrt(w))`
Step 4: integration by substitution
`z = sqrt(w) -gt w = z^2`
`dz = (dw)/(2sqrt(w)) -gt dw = 2zdz`
`= 1/2(2)int(zdz)/((-1+z^2)z)`
`= int(dz)/(-1+z^2)`
`= -int(dx)/(1-z^2)`
`= -tanh^-1(z) + C`
Final step: Resubstitute, w, v, and u:
`z=sqrt(w)=sqrt(1-v)=sqrt(1-e^u)=sqrt(1-e^2x)`
`int(dx)/(sqrt(1-e^(2x)))=-tanh^-1(sqrt(1-e^(2x)))+C`
Further Reading