# Issue in D[ ] in 12.3.0 but not in 12.1.0

Posted 1 month ago
553 Views
|
3 Replies
|
3 Total Likes
|
 Here is the terminal log from 12.1.0, where everything is correct: $math12 Mathematica 12.1.0 Kernel for Linux x86 (64-bit) Copyright 1988-2020 Wolfram Research, Inc. In:=$Assumptions = Element[x,Reals] Out= x \[Element] Reals In:= a=Exp[x] x Out= E In:= D[a*Conjugate[a],x] // ComplexExpand // Simplify 2 x Out= 2 E and here is the log from 12.3.0 which shows the problem: $math Mathematica 12.3.0 Kernel for Linux x86 (64-bit) Copyright 1988-2021 Wolfram Research, Inc. In:=$Assumptions = Element[x,Reals] Out= x \[Element] Reals In:= a=Exp[x] x Out= E In:= D[a*Conjugate[a],x] // ComplexExpand // Simplify 2 x Out= E (1 + I Im[Conjugate'[x]] + Re[Conjugate'[x]]) In:= D[a*Conjugate[a],x] // ComplexExpand[#, TargetFunctions->Conjugate] & // Simplify 2 x Out= E (1 + Conjugate'[x]) Of course, if I did "ComplexExpand" and "Simplify" prior to differentiation, then it would work in 12.3.0 also, but this is clearly a bug, i.e. differentiation should be aware of the assumption that 'x' is real-valued. And in 12.1.0 it was aware, as the log above shows. Answer
3 Replies
Sort By:
Posted 19 days ago
 The D function itself doesn't make use of the Assumptions system, but Simplify does. A few notes:a) It's common to try FullSimplify: D[a*Conjugate[a], x] // ComplexExpand // FullSimplify Although this only gives: E^(2*x)*(1 + Derivative[Conjugate][x]) b) Derivatives and Conjugate don't mix well. D by default assumes you mean complex differentiation and there Conjugate can't be differentiated. This shocks a fair number of engineers and physicists who are used to working with it anyway. If you search online, there are a large number of clever and probably too complicated workarounds for this. c) so the real crux of what's happening here is: ComplexExpand[I Im[Derivative[Conjugate][x]] + Re[Derivative[Conjugate][x]]] I Im[Derivative[Conjugate][x]] + Re[Derivative[Conjugate][x]] Why doesn't it give 1? My best guess is that it is being conservative and not trying to interpret what the derivative means, which is probably an intentional change. Answer
Posted 18 days ago
 I am just guessing. Derivatives and integrals in Mathematica were built from the start in the complex variable. Given that, such functions as Conjugate and Abs are not differentiable, and their derivative is left unevaluated. Since version 11.1 we have RealAbs, which does have a derivative, but is not very well blended with the rest of the system yet. Maybe we need RealIntegrate and RealD too. I wonder what RealConjugate may mean. Answer
Posted 6 days ago
 Thank you very much for the replies. Answer