I want to have a special symbol for the imaginary unit i, but I also need the usual character for the letter i in the same context. So, I tried to change the style of the imaginary unit by setting
\def \i{\begingroup\mathgroup=0 i\endgroup}
This is supposed to return a different symbol for i when typing \i in math-mode, but it refuses to do so! I get the error message:
Command \i invalid in math mode
Why is that and what can I do to obtain a different i for my complex numbers?

\iwhich has a pre-existing meaning, use any other name, (\newcommandrather thandefwould have warned you of that) – David Carlisle Dec 12 '15 at 17:05\imath? – Dec 12 '15 at 17:06\def,\mathgroup,\begingroupetc. It seems you want\newcommand\imagi{\mathrm{i}}then use\imagi– David Carlisle Dec 12 '15 at 17:07\mathrm{•}nor\imath. However, what is\isupposed to do normally? @David By the way, thank you very much for your replies. – Jim Dec 12 '15 at 17:15\iis the command for getting the “dotless i”. It's best not to redefine it. – egreg Dec 12 '15 at 17:26copy - pasteI made some research. – Jim Dec 12 '15 at 18:33