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?
 A: Your mistake:
$$\sec\theta=\frac x3$$ yields
$$\cos\theta=\frac 3x,\\\sin\theta=\sqrt{1-\frac9{x^2}},\\\tan\theta=\sqrt{\frac{x^2}9-1}.$$
Not $\sqrt{x^2-9}$.

This said, you can rescale the variable with $x=3t$ to get
$$\int\frac{dt}{\sqrt{t^2-1}}.$$
You may recognize another familiar integral,
$$\int\frac{dt}{\sqrt{1-t^2}}=-\arccos t+C.$$
What you have here is just the hyperbolic equivalent,
$$\int\frac{dt}{\sqrt{t^2-1}}=\text{arcosh }t+C,$$
which can also be written 
$$\log\left(t+\sqrt{t^2-1}\right)+C.$$
A: HINT:
If $x=3\sec\theta$
$$\tan^2\theta=\left(\dfrac x3\right)^2-1=\dfrac{x^2-9}9$$
$|\tan\theta|=\dfrac{\sqrt{x^2-9}}3$
$\sec\theta+|\tan\theta|=\dfrac{x+\sqrt{x^2-9}}3$
$\implies\ln(\sec\theta+|\tan\theta|)=\ln(x+\sqrt{x^2-9})-\ln3$
A: $$\int\frac{dx}{\sqrt {x^2-9}}$$
By substitution 
$$x=3\sec\theta $$
$$dx=3\sec\theta \tan \theta d\theta$$
$$\int \frac{3\sec\theta \tan \theta d\theta}{\sqrt{9\sec^2\theta-9}} $$
$$\int \frac{3\sec\theta \tan \theta d\theta}{3\tan\theta} $$
$$\int \sec\theta d\theta $$
$$ ln|\sec\theta+\tan\theta|$$
$$ ln| \frac{1+\sin \theta}{cos \theta}|$$
$$ \cos \theta=\frac{3}{x}$$
Recall that $\sin \theta= \sqrt{1-\cos^2\theta}$
$$ln|\frac{x(1+\sqrt{1-\frac{9}{x^2})}}{3}|$$
$$ ln|x+\sqrt{x^2-9}|-ln3$$
A: $$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$$

