I'm learning integration by the method of substitution. While doing sums, I encountered a case in which I got this expression in the denominator: $$\sqrt {a^2 + x^2 } $$
Now, I wanted to substitute $x$ as $a i \sin \theta$ where $i = \sqrt {-1} $. My idea was to take $a$ outside the root, and obtain $\cos \theta $ from the root.
Although I've reached the answer, I couldn't find any complex function substitution example in my book, which makes me wonder whether my substitution is correct.
Can I substitute a variable with a complex function in integration?