I am struggling to solve this integral to the method of substitution/replacement method of variables. I know I have to find a u which the derivative of u (u') is present in the equation.
But I have trouble finding what will that my variable to replace . I have these two resolutions but of these I would not solve alone and the other I didn't understand anything.
My question is: Is there a simpler way to solve (even if it is a long resolution) where I can understand every step and make it more obvious which variable will replace?
$$ \int \frac{du}{u^2 + a^2}, (a\neq0) $$
Resolution 1 (I got the same steps but the difficulty is in understanding which replace variable) $$ \int \frac{du}{u^2 + a^2} = \frac{1}{a^2}\int\frac{du}{\frac{u^2}{a^2}+ 1} $$ $$ v = \frac{u}{a} \implies dv = \frac{1}{a}, du =adv $$ $$ \frac{1}{a^2}\int\frac{adv}{v^2+ 1} = \frac{1}{a}arctan(\frac{u}{a}) + C $$
Resolution 2: I have no idea what happened to the $+ a^2$ in $(atan\theta)^2 + a^2 = a^2sec^2\theta$ $$ \tan^2\theta +1 = sec^2\theta \\ a^2\tan^2\theta + a^2 = a^2\sec^2\theta\\ (a\tan\theta)^2 + a^2 = a^2\sec^2\theta\\ u = atg\theta, du = asec^2\theta d\theta\\ \int\frac{du}{u^2 + a^2} = \int\frac{a\sec^2\theta d\theta}{a^2\sec^2\theta} = \frac{1}{2}\int1d\theta = \frac{1}{a}\arctan(\frac{u}{a}) + C $$
The method you have presented is basically a rehash of the fact that $$ \frac{d}{dx} \arctan(x) = \frac{1}{1 + x^2}$$ Note that $$\frac{d}{dx} \arctan(x/a) = \frac{1}{a}\frac{1}{1 + (x/a)^2} = \frac{a}{a^2 + x^2}$$ The above basically proves the result $$ \frac{1}{a^2 + x^2} = \frac{1}{a} \left( \frac{d}{dx} \arctan(a/x)\right)$$ Now it is "trivial" to see that $$\int \frac{dx}{a^2 + x^2} = \int \frac{1}{a} \left( \frac{d}{dx} \arctan(a/x)\right) dx = \frac{1}{a} \arctan(x/a) + C, \ C \in \mathbb{R}$$