Evaluation of $\int \frac{dx}{\sqrt{x^2 - 9}}$ $$\int \frac{dx}{\sqrt{x^2 - 9}}$$
$x = 3\sec\theta$
$dx = 3\tan\theta \sec\theta\,d\theta$
$$\frac{1}{3} \int \frac{3\tan\theta\sec\theta}{\sqrt{\sec^2 + 1}} d\theta$$
$$ \int \sec\theta d\theta$$
I have no idea how to continue without looking up tables which I cannot do on a test, how would I proceed or have I already gone wrong?
 A: Hint: Multiply $\sec$ by $\displaystyle 1=\frac{\sec(\theta)+\tan (\theta)}{\sec (\theta)+\tan (\theta)}$.
Further hint: $\displaystyle \int \sec (\theta) d\theta=\int \sec (\theta) \cdot 1\,d\theta=\int \sec (\theta) \frac{\sec(\theta)+\tan (\theta)}{\sec (\theta)+\tan (\theta)}d\theta=\int \frac{(\sec(\theta))^2+\sec (\theta)\tan (\theta)}{\sec (\theta)+\tan (\theta)}d\theta$.
Now differentiating $\theta \mapsto \sec (\theta) + \tan (\theta)$, you can find $\displaystyle \frac{d}{d\theta}\left(\sec (\theta) + \tan (\theta)\right)=(\sec(\theta))^2+\sec (\theta)\tan (\theta)$.
Finally use $\displaystyle \int \frac{u'}{u}=\log (|u|).$
A: Another method:
\begin{eqnarray*}
 \int\sec\theta\mathrm{d}\theta&=&\int\frac{\cos\theta}{\cos^2\theta}\mathrm{d}\theta=\int\frac{\mathrm{d}\sin\theta}{(1-\sin\theta)(1+\sin\theta)}\\
&=&\frac{1}{2}\left(\int\frac{\mathrm{d}\sin\theta}{1-\sin\theta}+\int\frac{\mathrm{d}\sin\theta}{1+\sin\theta}\right)=\cdots
\end{eqnarray*}
A: I will show you the work with Euler's substitutions so you see that you don't need to come up with any imaginative trick.
First the Euler's substitutions tells you to introduce a new variable $t$ such that $\sqrt{x^2-9}=x+t$. From this we get that $x^2-9=x^2+2xt+t^2$, i.e. $$x=\frac{-9-t^2}{2t}$$ and $$\sqrt{x^2-9}=\frac{-9-t^2}{2t}+t$$
Then, differentiating you get $$dx=\left(\frac{9}{2t^2}-\frac{1}{2}\right)\text{d}t$$.
Putting these in the integral we get 
$$\int \frac{\text{d}x}{\sqrt{x^2-9}}=\int\frac{2t}{-9+t^2}\frac{9-t^2}{2t^2}\text{d}t.$$
Now simplify a little to get $$\int\frac{-\text{d}t}{t}=-\ln(t).$$
Returning now to the old variable $x$, using that $t=\sqrt{x^2-9}-x$ we get
$$\int\frac{\text{d}x}{\sqrt{x^2-9}}=-\ln(\sqrt{x^2-9}-x)+constant.$$
If you want you can also rewrite this in the equivalent form: $$\ln\left(\frac{1}{\sqrt{x^2-9}-x}\right)=\ln\left(\frac{\sqrt{x^2-9}+x}{-9}\right)=\ln\left(\sqrt{x^2-9}+x\right)+constant.$$
I am telling you, those trigonometric substitutions are an educational nonsense. The only thing we had to do here was to notice that this was an integral of the form $R(\sqrt{ax^2+bx+c},x)$, for $R$ rational, and to remember what is the Euler substitution corresponding to it (there are only $3$ of them). The rest is just mindless computation.
A: OK, just for fun, here's a substitution that works:
$$
w = \tan\left(\frac\theta2+\frac\pi4\right)
$$
If you're good at trigonometric identities, you can then derive these:
$$
\sec\theta = \frac{1+w^2}{2w}, \qquad d\theta=\frac{2\,dw}{1+w^2}.
$$
Then you have
$$
\int\sec\theta\,d\theta = \int \frac{dw}{w} = \cdots\cdots
$$
(I have a short note in the current Monthly about this.  Also see the Wikipedia article about this integral, which I created a couple of years ago.  You'll see a link to a paper about its application to cartography, that being the reason why people first wanted to know how to do this integral.  This particular substitution is not (yet?) in the Wikipedia article.)
(What I privately think of as the cartographer's tangent half-angle formula says $\tan\left(\dfrac\theta2+\dfrac\pi4\right)=\sec\theta+\tan\theta$.  But maybe someone else has called it that?)
