I came to know about the following integration formulae-
$$\int\frac{1}{x^2+a^2}dx=\frac{1}{a}\tan ^{-1}\left(\frac{x}{a}\right)+C$$
$$\int\frac{1}{x^2-b^2}dx=\frac{1}{2b}\ln \left(\left\lvert\frac{x-b}{x+b}\right\rvert\right)+C$$
where $a$ and $b$ are some constants and $C$ is the constant of integration.
I was wondering whether we could derive the second formula from the first by substituting $a^2=-b^2$ in the first.
Edit- Fortunately I got my answer from this question. Thanks to S.H.W.'s comment.
Note that $$\int \frac{dx}{x^2-b^2}= \frac{1}{2b} \ln \left|\frac{x-b}{x+b}\right|=-\frac{1}{b} \tanh^{-1} \frac{x}{b}$$ Replace $b=ia$, to get $$\int \frac{dx}{x^2+a^2}=- \frac{1}{ia} \tanh^{-1} \frac{x}{ia}=\frac{1}{a} \tan^{-1} \frac{x}{a}.$$ Both the results are conssitent with each other.
You may read about Htperbolic function here: https://en.wikipedia.org/wiki/Hyperbolic_functions