<s>[INST] How do you find appropriate trig substitution for $\int \frac{\sqrt{16x^2 - 9}}{x} \, dx$? I want to solve the below:
$$\int \frac{\sqrt{16x^2 - 9}}{x} \, dx$$
I know for trig substitution, if I have something in the form of $\sqrt{x^2-a^2}$, I can use $x = a\sec{u}$; it just so happens my integral has a numerator in this form: $\sqrt{16x^2 - 3^2}$ so I know to use $x = 3\sec u$:
$$
\begin{align}
& \int \frac{\sqrt{16x^2 - 9}}{x} \, dx \\
= {} & \int \frac{\sqrt{16x^2 - 3^2}}{x} \, dx \\
= {} & \int \frac{\sqrt{16(3\sec u)^2 - 3^2}}{3\sec u} 3\sec u\tan u \, du \\
= {} & \int \frac{(\sqrt{16(3\sec u)^2 - 3^2)}(3\sec u\tan u)}{3\sec u} \, du \\
= {} & \int \sqrt{(16(3\sec u)^2 - 3^2)}(\tan u) \, du
\end{align}
$$
This doesn't seem to make it easy. However, using a calculator online, it suggests I instead use $x = \dfrac{3}{4}\sec{u}$ which simplifies the integral to a crisp $\int 3\tan^2 u \, du$.
My question is, how did the calculator get $a = \dfrac{3}{4}$ and is there a way to determine an ideal trig substitution for a given function?
 [/INST] In general, if you have $\sqrt{p x^2\pm q}$ 


*

*Make the coefficient $x$ equal to $1$ by taking coefficient of $x^2$ out of square root which gives $$\sqrt{px^2\pm q}=\sqrt p\sqrt{x^2\pm \frac{q}{p}}$$

*Above expression: $\sqrt{x^2\pm \frac{q}{p}}$ can be changed into the form: $\sqrt{x^2\pm a^2}$ by equating $a=\sqrt{\dfrac{q}{p}}$ 

*Substitute $x=a\sec u$ for the form $\sqrt{x^2-a^2}$ and $x=a\tan u$ for the form $\sqrt{x^2+a^2}$
For this case: $$\sqrt{16x^2-9}=\sqrt{16}\sqrt{x^2-\frac{9}{16}}$$ $$\sqrt{x^2-a^2}=\sqrt{x^2-\frac{9}{16}}$$
$$\implies a=\sqrt{\frac{9}{16}}=\frac34$$
</s>