The simple rule I to -I is not guaranteed to work, e.g.
Exp[3 I] /. I -> -I
and ComplexConjugate might be too slow (for lengthy expressions). Therefore, I rather define an alternative function to conjugate
ClearAll[AltConjugate]
AltConjugate[x_] := ReplaceAll[FullSimplify[x], Complex[a_, b_] -> Complex[a, -b]];
This functions looks for the pattern Complex[a_, b_]
and replaces it by Complex[a, -b]
.
@celtschk - roots might be problematic, simple functions like f[x_]=Sqrt[-x^2]
can be handle by simplifying the input function, i.e. adding FullSimplify
in the definition of AltConjugate
. Nevertheless, this will fail for functions including more general roots, such as f[x]=Sqrt[-x^2 +I b]
where both x and b are reals.
Use this carefully and always test it.
Cheers.