Consider the following example:
expr = a (1 + b + cd + Sqrt[-2 de + fg + h^2] + aj );
Now I would like to insert complex I in front of the term in the square root and save the rest of the expression. I know that expr has only one member of Sqrt . So I tried the following:
ToBoxes@
Q1: Why is this failing?
The workaround was to use another variable and then replace it with I as follows:
( ToBoxes@

Q2: Why does it work?
Q3: Are there any alternative / better ways to do this?
anon
source share