Differentiating Complex Conjugated Functions
This is primarily a question of understanding the syntax of some output although there might be a bug hidden underneath. Consider the following code:
sage: var('x,t')
sage: q = function('q',x,t)
sage: f = q*q.conjugate()
sage: print f.derivative(x,1)
q(x, t)*D[0](conjugate)(q(x, t))*D[0](q)(x, t) + conjugate(q(x,t))*D[0](q)(x, t)
The answer is supposed to be d/dx(qˉq)=qxˉq+qˉqx. The second term in the Sage output is correct but I'm having trouble deciphering the first term. Any thoughts?
I think I can narrow down the differences even further. Check it out:
sage: print q.conjugate().derivative(x,1)
D[0](conjugate)(q(x, t))*D[0](q)(x, t)
sage print q.derivative(x,1).conjugate()
conjugate(D[0](q)(x, t))
The independence of order isn't the issue: q=u+iv means that qx=ux+ivx, ˉq=u−iv. So ¯qx=ux−ivx and (ˉq)x=(u−iv)x=ux−ivx.
Depending on the problem you could just define a new function called qbar as long as you don't expect to conjugate an entire expression. Such is my own case and I got the result I wanted.
@kcrisman - what does `D[0](conjugate)` mean?