Equivalence of two antiderivatives involving trigonometric/hyperbolic functions I am struggling to see how two antiderivatives of the same function—obtained in two different ways—are equivalent (what I mean by equivalent is that they differ from just a constant), if they even are equivalent.
The function in question is 
$$
\begin{align}
f \colon \quad \{x\in\mathbb{R} \mid e^{2x} \ge 9\} &\to\mathbb{R}\\
x &\mapsto f(x) = \frac{1}{\sqrt{e^{2x} - 9}}
\end{align}\,.
$$
Wanting to find $I = \displaystyle\int f(x)\mathrm{d}x$, I proceeded as follows.
$$
\int \frac{1}{\sqrt{e^{2x} - 9}}\mathrm{d}x = \frac{1}{3} \int \frac{1}{\sqrt{\left(\dfrac{e^x}{3}\right)^2 - 1}}\mathrm{d}x\,.
$$
Since $\left(\frac{e^x}{3}\right)^2 \in[1,+\infty]$ and the image of $\cosh$ is $[1, +\infty)$, 
$$\exists t \in \mathbb{R}\colon\quad \left(\dfrac{e^x}{3}\right)^2 = \cosh^2t\\
\Rightarrow \mathrm{d}x = \tanh t\ \mathrm{d}t\,.$$
Thus,
$$
I = \frac{1}{3} \int \frac{\tanh t}{\sqrt{\cosh^2 t - 1}}\mathrm{d}t = \frac{1}{3}\int \mathrm{sech}\ t\ \mathrm{d}t\,.
$$
Here is where the two different ways diverge. The first thing I tried was using the hyperbolic function's definition.
$$
I = \frac{1}{3}\int \frac{2e^t}{e^{2t} + 1}\ \mathrm{d}t\,;
\qquad\text{let}\quad 
\begin{cases}
u = e^t\\
\mathrm{d}u = e^t\mathrm{d}t
\end{cases}\\ \\
\Rightarrow I = \frac{2}{3} \int \frac{1}{u^2 + 1}\ \mathrm{d}u = \frac{2}{3} \arctan u + C = \frac{2}{3} \arctan e^t + C = \\
= \frac{2}{3} \arctan e^{\text{arccosh} \frac{e^x}{3}} + C = \frac{2}{3} \arctan e^{\ln\left(\frac{e^x + \sqrt{e^{2x}-9}}{3}\right)} + C =\\
= \frac{2}{3} \arctan \left(\frac{e^{x} + \sqrt{e^{2x}-9}}{3}\right) + C\,.
$$
The alternative solution is
$$ 
I = \frac{1}{3}\int \mathrm{sech}\ t\ \mathrm{d}t = \frac{1}{3}\int \frac{\cosh t}{\cosh^2 t}\ \mathrm{d}t = \frac{1}{3}\int \frac{\cosh t}{1 +\sinh^2 t}\ \mathrm{d}t =\\
= \frac{1}{3}\arctan \left(\sinh t\right) + C = \frac{1}{3}\arctan \left(\sinh \left(\mathrm{arccosh} \frac{e^x}{3}\right)\right) + C = \frac{1}{3}\arctan \frac{\sqrt{e^{2x} - 9}}{3} + C\,.
$$
I don't see any obvious way in which $$\frac{2}{3} \arctan \left(\frac{e^x + \sqrt{e^{2x}-9}}{3}\right) + C$$ and $$\frac{1}{3}\arctan \frac{\sqrt{e^{2x} - 9}}{3} + C$$ are equivalent antiderivatives, although they do seem to be.



Update
Following Yuriy S's suggestion, I tried the following. Let
$$
s = \frac{\sqrt{e^{2x} - 9}}{3}\,.
$$
Thus, 
$$
\arctan s = 2\arctan \frac{\sqrt{1+s^2}-1}{s} = 2\arctan \frac{\sqrt{1+\frac{e^{2x}-9}{9}}-1}{\frac{\sqrt{e^x - 9}}{3}} = 2\arctan \frac{3e^x-3}{\sqrt{e^x - 9}}\,.
$$
On the other hand, let
$$
r = \frac{e^x + \sqrt{e^{2x} - 9}}{3}\,,
$$
so that
$$
\frac{1}{r} = \frac{3}{e^x + \sqrt{e^{2x} - 9}} \cdot \frac{e^x - \sqrt{e^{2x} - 9}}{e^x - \sqrt{e^{2x} - 9}} = \frac{e^x - \sqrt{e^{2x} - 9}}{3}\,.
$$
I was striving to apply the formula
$$
\arctan x + \arctan \frac{1}{x} = \pm\frac{\pi}{2}
$$
but I got stuck here.
 A: Whenever you face this problem, you can check the answer by differentiating. If
$$
F(x)=\frac{2}{3} \arctan \left(\frac{e^{x} + \sqrt{e^{2x}-9}}{3}\right) + C
$$
then
\begin{align}
F'(x)
&=\frac{2}{3}\frac{1}{1+\left(\dfrac{e^{x} + \sqrt{e^{2x}-9}}{3}\right)^2}
  \frac{1}{3}\left(e^x+\frac{e^{2x}}{\sqrt{e^{2x}-9}}\right) \\[4px]
&=\frac{2}{9+e^{2x}+e^{2x}-9+2e^x\sqrt{e^{2x}-9}}
  \frac{e^x(e^x+\sqrt{e^{2x}-9}\,)}{\sqrt{e^{2x}-9}} \\[4px]
&=\frac{1}{\sqrt{e^{2x}-9}}
\end{align}
We can try differentiating the second function
$$
G(x)=\frac{1}{3}\arctan\frac{\sqrt{e^{2x}-9}}{3}+C
$$
and we get
\begin{align}
G'(x)
&=\frac{1}{3}\frac{1}{1+\left(\dfrac{\sqrt{e^{2x}-9}}{3}\right)^2}
  \frac{1}{3}\frac{e^{2x}}{\sqrt{e^{2x}-9}} \\[4px]
&=\frac{1}{9+e^{2x}-9}\frac{e^{2x}}{\sqrt{e^{2x}-9}} \\[4px]
&=\frac{1}{\sqrt{e^{2x}-9}}
\end{align}
Good job in both cases.
You can easily compute the constant difference by the limits at $\infty$ (with $C=0$ in both cases):
$$
\lim_{x\to\infty}F(x)=\frac{2}{3}\frac{\pi}{2}=\frac{\pi}{3}
\qquad
\lim_{x\to\infty}G(x)=\frac{1}{3}\frac{\pi}{2}=\frac{\pi}{6}
$$
Alternative solution: substitute $\sqrt{e^{2x}-9}=3t$, so
$$
x=\frac{1}{2}\log(9(t^2+1))
$$
and
$$
dx=\frac{t}{t^2+1}\,dt
$$
so the integral becomes
$$
\int\frac{1}{t^2+1}\,dt=\arctan t+C=\arctan\frac{\sqrt{e^{2x}-9}}{3}+C
$$
