<s>[INST] Both ways seems right to me The question: $$\int {2e^x \over e^{2x}-1}dx $$
Solution 1 (we solv it this way in the exam today)
$\int {2e^x \over (e^x-1)(e^x+1)}dx = \int {(\frac{A}{e^x-1} + \frac{B}{e^x+1})dx} \qquad $from this, $A=1$ and $B=1$. Then,
$\int {\frac{1}{e^x-1} }dx + \int {\frac{1}{e^x+1}}dx = \ln(e^x-1)+\ln(e^x+1)+c = \ln(e^{2x}-1)+c$
Solution 2 (teacher's way)
Let $\ e^x=u \ $ and $\ e^xdx=du \ $. So the integral changes to $\ \int{2\over u^2-1}du \ $. Then,
$\int{({A \over u-1}+{B \over u+1})}du \qquad$ from this, $A=1$ and $B=-1$. Then,
$\int{({1 \over u-1}-{1 \over u+1})}du = \int{1 \over u-1}du - \int{1 \over u+1}du = \ln(u-1)-ln(u+1)+c = \ln(\frac{u-1}{u+1})+c$
And if we replace $u$ with $e^x$: $\ln(\frac{e^x-1}{e^x+1})+c$
So, which one is the right answer?
 [/INST] You can re-write you integrand as $$\frac{2}{e^{x}-e^{-x}}=\text{cosech} x.$$ Thus
\begin{eqnarray}
\int\text{cosech}xdx &=& \ln \text{tanh} \frac{x}{2}+c \\
                     &=& \ln \left(\frac{e^{\frac{x}{2}}-e^{\frac{x}{2}}}{e^{\frac{x}{2}}+e^{\frac{x}{2}}}\right)+c
\end{eqnarray}
</s>