Consider this expression
f = Abs[ x + I ]
with this assumption
$Assumptions = Element[x, Reals]
Now there is something strange: why are the following derivatives different?
FullSimplify[ComplexExpand[D[f, x]]]
D[ComplexExpand[f, TargetFunctions -> {Re, Im}], x]
(* (I + x)/Sqrt[(I + x)^2] *)
(* x/Sqrt[1 + x^2] *)
Note that the argument of the derivative is the same
FullSimplify[
ComplexExpand[f, TargetFunctions -> {Re, Im}] == f]
(* True *)
Trace
on yourIn[3]
inputs to see the order of computations. $\endgroup$Abs'[I+x]
? $\endgroup$