I'm not sure how to phrase this question, but I find myself confused over the correctness of a particular solution in the table of integral, specifically: $$\int\frac{dx}{\sqrt{x^2-a^2}}=\ln|\sqrt{x^2-a^2}+x|+C$$
I find that if you try to solve it with trigonometric substitution, you get a different answer:
So, for the example, since the form $\sqrt{x^2-a^2}$ is present, we use the substitution $x=asec \theta$, and $dx=asec\theta tan \theta d\theta$. Doing so:
$$\int\frac{asec\theta tan \theta d\theta}{\sqrt{(asec \theta)^2-a^2}}$$ $$\int\frac{asec\theta tan \theta d\theta}{\sqrt{a^2sec^2 \theta-a^2}}$$ $$\int\frac{asec\theta tan \theta d\theta}{a\sqrt{sec^2 \theta-1}}$$ Using the trigonometric identity $tan^2 \theta=sec^2 \theta -1$ $$\int\frac{asec\theta tan \theta d\theta}{atan \theta}$$
Cancelling like terms, we get $\int sec \theta$, which finally integrates to $ln|sec \theta + tan \theta|+C$
Undoing the substitution, using this triangle:
https://i.stack.imgur.com/6tkR7.png
With $sec \theta = \frac{x}{a}$ and $tan \theta = \frac{\sqrt{x^2-a^2}}{a}$, the final answer then is:
$$ln\biggl|\frac{x}{a} + \frac{\sqrt{x^2-a^2}}{a}\biggl|+C$$
Which is evidently different from the one from the table of integrals. Is my solution wrong or something?