<s>[INST] Proving Table of Integral Integral (Trigonometric Substitution) I need help with the proof of the table of integral that:
$$\int \frac{\sqrt{a^2 + u^2}}{u} du = \sqrt{a^2 + u^2} + a \ln \left|\frac{\sqrt{a^2 + u^2} - a}{u}\right| + c$$
Must solve using trigonometric substitution.
I understand that you have to use $a^2\tan(\theta)$ as a substitution for $u$.
 [/INST] Let $u=a \tan x \tag{1}$  Then:- $u^2=a^2\tan^2 x  \implies 2u \cdot du= 2a^2\tan x \cdot \sec^2x \cdot dx $
The integral reduces to :- $$ a\int \sec^2x \csc x \cdot dx $$
$$ =  a\int (\tan^2x +1) \csc x \cdot dx = a\left(\int \sec x \tan x \cdot dx + \int \csc x \cdot dx \right)\\
= a\left(\sec x  - \ln(\cot x + \csc x)\right) + C $$Note that from $(1)$ we have $\sec x = \frac{\sqrt{u^2+a^2}}{a}$  and $\csc x= \frac{\sqrt{u^2+a^2}}{u}$ and $\cot x = \frac{a}{u} $
Thus , by undoing substitution , we get  $$\boxed{ I= \sqrt{a^2+u^2} + a\cdot \ln \left|\frac{\sqrt{a^2+u^2}-a}{u}\right| + C}$$
</s>