<s>[INST] integration by trig substitution I solved the following integral by using trig substitution $(u = 3 sec \theta)$ 
$$
\int \frac{dx}{x^{2}+10x+16}=\int \frac{du}{u^2-9}
$$
and got the same result as in the textbook which looked for $\int \frac{du}{u^{2}-a^2}$. Below is the process and result given in the textbook.
$$
\int \frac{du}{u^2-9}=\frac{1}{6}\ln \left| \frac{u-3}{u+3} \right|=\frac{1}{6}\ln \left| \frac{x+2}{x+8} \right|
$$
If I let $f(u) = \frac{1}{u^2-9}$, I am confused when using $u = 3 sec \theta$ due to the domain of $f(u)$ and the range of $3sec \theta$ : 
$$
3 \left| \sec\theta \right|\geq3
$$
but the domain of $f(u)$ is $[(-\infty, -3)\cup(-3, 3)\cup(3,\infty)]$.
In this case, how should I interpret the answer $\frac{1}{6}\ln \left| \frac{x+2}{x+8} \right|$? 
I mean, I don't think I can use the answer if I want to solve definite integrals like below:
$$
\int_{-5}^{-3} \frac{dx}{x^2+10x+16}
$$
or 
$$
\int_{0}^{2} \frac{du}{u^2-9}.
$$
Is my guess right? 
 [/INST] This may not be what you want, but do you notice the following?
$$\begin{align}\int\frac{1}{x^2+10x+16}&=\int\frac{1}{(x+5)^2-9}dx\\&=\int\frac{1}{u^2-9}du\\&=\frac 16\int\left(\frac{1}{u-3}-\frac{1}{u+3}\right)du\\&=\frac 16(\ln|u-3|-\ln|u+3|)+C\\&=\frac 16\ln\left|\frac{u-3}{u+3}\right|+C\end{align}$$
Here, I set $x+5=u.$
I think you don't need to use $u=3\sec\theta$.
</s>