It seems to be quite a common manipulation to replace $x$ by $ix$.
Every time I see it's being done in a textbook, I blindly trust the author without really understanding when are we allowed to do so in each particular case and when not.
If you know any examples of false usage, I'd be happy to learn from them.
What one generally needs to keep in mind while replacing $x$ by $ix$?
For example, if we replace $x$ by $ix$ in the following:
$$ x \coth(x)=\sum_{n=0}^\infty \frac{2^{2n}}{(2n)!}B_{2n}x^{2n} $$ what should be the correct justification for the replacement?
- Because $ix$ is just a rotation of $x$, so $|x|=|ix|$, therefore if the series converges for $x$ then so it does for $ix$.
- Because both LHS and RHS are defined for a complex argument.
Both/one/none of them? What could go wrong?
Yes, in general, you need to be careful when replacing $x$ by $ix$. For instance, below is a false usage: $$\int_{-\infty}^{\infty} \exp(-x^2) dx = \sqrt{\pi}$$ Replacing $x$ by $ix$, we get that $$\int_{-\infty}^{\infty} \exp(x^2) dx = \dfrac{\sqrt{\pi}}{i}$$ Similarly, for $x \in \mathbb{R}$, $\vert \exp(ix) \vert = 1$. However, we cannot replace $x$ by $ix$ and conclude that $\vert \exp(-x) \vert = 1$.
The main thing is, if we know a result is true for real $x$, we need to check if the result can be holomorphically extended into the complex domain.