       Some problems with complex functions like Sqrt[z]

• To: mathgroup at smc.vnet.net
• Subject: [mg18168] Some problems with complex functions like Sqrt[z]
• From: Robert Prus <robert at fuw.edu.pl>
• Date: Sat, 19 Jun 1999 23:54:29 -0400
• Organization: Warsaw University, Physics Department, Institute of Theoretical Physics
• Sender: owner-wri-mathgroup at wolfram.com

```Hi,

For any complex (holomorphic) function f[z] I should obtain 0 as the result
of the following calculations:

Mathematica 3.0 for Silicon Graphics
Copyright 1988-97 Wolfram Research, Inc.
-- Motif graphics initialized --

In:= f[z_]:=z^3

In:= re=Re[f[a+I b]]//ComplexExpand

3        2
Out= a  - 3 a b

In:= im=Im[f[a+I b]]//ComplexExpand

2      3
Out= 3 a  b - b

In:= D[{re,im},a].D[{re,im},b]//Simplify

Out= 0

But if I choose more complicated function, like Sqrt[z], I obtain:

In:= f[z_]:=Sqrt[z]

In:= re=Re[f[a+I b]]//ComplexExpand

Arg[a + I b]
Out= Sqrt[Abs[a + I b]] Cos[------------]
2

In:= im=Im[f[a+I b]]//ComplexExpand

Arg[a + I b]
Out= Sqrt[Abs[a + I b]] Sin[------------]
2

In:= D[{re,im},a].D[{re,im},b]//Simplify

I               2               2              2
- (Abs'[a + I b]  + Abs[a + I b]  Arg'[a + I b] )
4
Out= -------------------------------------------------
Abs[a + I b]

In the following one can use the substitutions:

Abs'[x_+I y_] -> x/Sqrt[x^2+y^2]

Arg'[x_+I y_] -> -y/(x^2+y^2)

(one can check them using:

z=Abs'[x+I y]-x/Sqrt[x^2+y^2] (* or z=Arg'[x+I y]+y/(x^2+y^2) *)
Plot3D[Chop[z],{x,-10,10},{y,-10,10}]
Plot3D[Chop[z],{x,Random[],Random[]},{y,Random[],Random[]}]
)

As the final result I obtain:

In:= %8/.{Abs'[x_+I y_] -> x/Sqrt[x^2+y^2], Arg'[x_+I y_] -> -y/(x^2+y^2)}/.Abs[x_+I y_] -> Sqrt[x^2+y^2]//Together

I
-
4
Out= -------------
2    2
Sqrt[a  + b ]

Under Mathematica 2.0 as the final result I have:

In:= %8/.{Abs'[x_+I y_] -> x/Sqrt[x^2+y^2], Arg'[x_+I y_] -> -y/(x^2+y^2)}/.Abs[x_+I y_] -> Sqrt[x^2+y^2]//Together

b
Out= -------------------------
2    2
4 (a - I b) Sqrt[a  + b ]

But it should be equal to zero !!!

Any comments?

Robert Prus, robert at fuw.edu.pl
Institute of Theoretical Physics, Warsaw University
Hoza 69, 00-681 Warsaw, Poland

```

• Prev by Date: Re: Scoping and named patterns
• Next by Date: Re: How to plot more curves on one graph
• Previous by thread: Re: Automatic numbered captions for figures (plots)
• Next by thread: Re: Some problems with complex functions like Sqrt[z]