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?

Given $\int \frac{\sqrt{16x^2}-9}{x}dx$ and that $\sqrt{x^2-a^2} \Rightarrow x=a \sec \theta \wedge a \sec \theta \tan \theta d\theta =dx$
Then,
$$\int \frac{\sqrt{16x^2}-9}{x}dx \Rightarrow \int \frac{\sqrt{16(3 \sec\theta)^2}-3^2}{3 \sec \theta} 3 \sec \theta \tan \theta d\theta $$
$$ = 12\int \tan \theta \sqrt{\sec^2 \theta}-9 $$
$$ =  12\sqrt {\sec^2\theta} -81\theta +C$$
by factoring out constants and integrating the sum term by term.
