Message Boards Message Boards

1
|
436 Views
|
5 Replies
|
8 Total Likes
View groups...
Share
Share this post:

How to calculate the gradient of the arg of a complex exponential?

Posted 2 months ago

I am trying to find the gradient of the phase of complex exponential functions.

For example:

Grad[Arg[Exp[-I  (x + z)]], {x, z}]

Should be {1,1} for all x,z (Reals). However, instead I get:

{-I E^(-I (x + z))
   Derivative[1][Arg][E^(-I (x + z))], -I E^(-I (x + z))
   Derivative[1][Arg][E^(-I (x + z))]}

I think it has to do with the fact that Arg[Exp[-I (x + z)]] doesn't return (x+z). I assumed that was because it doesn't know that x,z are Reals.

I also tried Refine[Arg[Exp[-I (x + z)]], x \[Element] Reals && z \[Element] Reals] but that doesn't return (x+z) either.

Thanks!

POSTED BY: Brian M
5 Replies

Beware that your function Arg[Exp[-I (x + z)]] has discontinuities, as you can see from a plot:

Plot3D[Arg[Exp[-I (x + y)]], {x, -2 Pi, Pi}, {y, -2 Pi, 2 Pi}]

Curiously, the following gives True:

FunctionDiscontinuities[Arg[Exp[-I (x + y)]], {x, y}]

Even more puzzling is the output of this:

PiecewiseExpand[Arg[Exp[-I (x + y)]],
 0 < x < 2 Pi && 0 < y < 2 Pi,
 Reals]
POSTED BY: Gianluca Gorni

Here's another way to get the correct result, using the mathematical property that Log[z]==Log[Abs[z]]+I Arg[z]

In[]:= Im[Grad[Log[Exp[-I (x + z)]], {x, z}]]
Out[]= {-1, -1}

The problem is that Grad is trying to take the complex derivative of Arg, which is not a complex differentiable function.

POSTED BY: David Moore
Posted 2 months ago

Thanks!

POSTED BY: Brian M

ComplexEpand is useful for expanding non-differentiable complex functions into differentiable real functions:

Grad[ComplexExpand@Arg[Exp[-I (x + z)]], {x, z}]
(*
{-(Cos[x + z]^2/(Cos[x + z]^2 + Sin[x + z]^2)) - Sin[x + z]^2/(Cos[x + z]^2 + Sin[x + z]^2),
 -(Cos[x + z]^2/(Cos[x + z]^2 + Sin[x + z]^2)) - Sin[x + z]^2/(Cos[x + z]^2 + Sin[x + z]^2)}
*)
POSTED BY: Michael Rogers
Posted 2 months ago

Thank you!

POSTED BY: Brian M
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract