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?

First get rid of the annoying factors,
$$\int\frac{\sqrt{16x^2-9}}xdx=\int\frac{\sqrt{16\left(\dfrac{3y}4\right)^2-9}}{\dfrac{3y}4}d\dfrac{3y}4=3\int\frac{\sqrt{y^2-1}}{y}dy.$$
Then observe the identity
$$\left(\frac 12\left(t+\dfrac1t\right)\right)^2-1=\left(\frac 12\left(t-\dfrac1t\right)\right)^2.$$
Then with $y=\dfrac 12\left(t+\dfrac1t\right)$ and $dy=\dfrac 12\left(1-\dfrac1{t^2}\right)$,
$$\int\frac{\sqrt{y^2-1}}{y}dy=\int\frac{\dfrac 12\left(t-\dfrac1t\right)}{\dfrac 12\left(t+\dfrac1t\right)}\dfrac 12\left(1-\dfrac1{t^2}\right)dt=\frac12\int\left(1+\frac1{t^2}-\frac{4}{t^2+1}\right) dt$$
which is easy.
