Integration by trig substitution - why is my answer wrong? Attempting integral:
$$-\int \frac{dx}{\sqrt{x^2-9}}$$
Let $x = 3\ sec\ \theta$ so that under the square root we have:
$$\sqrt{9\ sec^2\ \theta - 9}$$
$$\sqrt{9(sec^2\ \theta - 1)}$$
$$\frac{dx}{d\theta} =3\ sec\ \theta\ tan\ \theta$$
The $1/3$ and the $3$ cancel eachother out outside the integral, so we have:
$$-\int \frac{sec\ \theta\ tan\ \theta\ d\theta}{tan\ \theta}$$
The $tan\ \theta$ terms cancel, so we're left to integrate $sec\ \theta$ which is equal to:
$$- \ln\ (tan\ \theta + \ sec\ \theta) + C$$
Since $tan\ \theta = \sqrt{x^2-9}\ $ since it replaced it in the integral, and $sec\ \theta = \frac{x}{3}$, the answer is:
$$-\ ln\ (\sqrt{x^2-9}\ + \frac{x}{3})+C$$
However, using an online calculator, the answer turned out to be:
$$-\ ln\ (\sqrt{x^2-9}\ + x)+C$$
It seemed to come about due to their substitution of $u = \frac{x}{3}$ we led them to get the standard integral of $sec^{-1}x$, which would imply that
$$\sqrt{\frac{x^2}{9} - 9}$$
becomes $$\sqrt{u^2 - 1}$$
And I just don't see how. Can someone explain why what they did is valid and/or where my mistake was?

$$I = -\int \frac{1}{\sqrt{x^2-9}}\,dx$$
$\sqrt{bx^2 - a} \implies x = \sqrt{\frac{a}{b}}\sec \alpha$
$$x = 3\sec\alpha \implies \frac{dx}{d\alpha}=3\sec\alpha\tan\alpha$$
$$ -\int \frac{1}{\sqrt{\left(3\sec \alpha \right)^2-9}}3\sec\alpha\tan\alpha\,\,d\alpha$$
$$ -\int \frac{\sec\alpha \tan\alpha}{\sqrt{\sec^2\alpha-1}}\,d\alpha$$
$\sec^2\alpha = 1 + \tan^2\alpha$
$$ -\int \frac{\sec\alpha \tan\alpha}{\sqrt{\tan^2\alpha}}\,d\alpha =  -\int \frac{\sec\alpha \tan\alpha}{\tan\alpha}\,d\alpha = -\int\sec\alpha\,d\alpha$$
$$-\int\sec\alpha\,d\alpha = -\ln(\tan\alpha + \sec\alpha) +C$$
$$\alpha = arcsec\left( \frac{1}{3}x\right)$$
$$-\ln\left(\tan\left( arcsec\left( \frac{1}{3}x\right)\right)+ \sec\left( arcsec\left( \frac{1}{3}x\right)\right)\right) +C$$
$$-\ln\left(\sqrt{\frac{1}{9}x^2 -1} + \frac{1}{3}x\right)+C$$
$$-\ln\left(\frac{1}{3} \left(\sqrt{x^2 - 9} + x\right)\right)+C$$
$$-\ln\left(\sqrt{x^2 - 9} + x\right) - \ln(3)+C$$

$$I = -\ln\left(\sqrt{x^2 - 9} + x\right) +C$$

