Why is this secant substitution allowed? On Paul's Math Notes covering Trig Substitutions for Integrals we start with an integral:
$$\int{{\frac{{\sqrt {25{x^2} - 4} }}{x}\,dx}}$$
Right away he says to substitute $x=\frac{2}{5}\sec(θ)$.  Why is that allowed?
Looking further down onto how he approaches the problem, it seems like it's allowed because it's compensated for with a dx:
$$dx = \frac{2}{5}\sec \theta \tan \theta \,d\theta$$
Is that what's going on here? It's fair to say you can substitute x with whatever you want so long as you update dx?  Seems like it wouldn't work for constant functions of x, like $x = 5$.. since that'd get you $dx=0$ and clearly be wrong.  So what rules are in play here for substitution?

You need to remember the Pythagorean trigonometric identity that says $$ \sec^2 \theta-1 = \tan^2\theta. $$
Where you see $\Big( \big(\text{variable}\big)^2 - \text{positive constant} \Big),$ you can often use this substitution in just the way in which it is used here.
