Re: Some problems with complex functions like Sqrt[z]

• To: mathgroup at smc.vnet.net
• Subject: [mg18188] Re: [mg18168] Some problems with complex functions like Sqrt[z]
• From: "Andrzej Kozlowski" <andrzej at tuins.ac.jp>
• Date: Mon, 21 Jun 1999 22:50:32 -0400
• Sender: owner-wri-mathgroup at wolfram.com

```Here is how you can quickly get the answer you want:

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

In[2]:=
re=ComplexExpand[Re[f[a+I b]],TargetFunctions->{Re,Im}]
Out[2]=
2    2 1/4     ArcTan[a, b]
(a  + b )    Cos[------------]
2

In[3]:=
im=ComplexExpand[Im[f[a+I b]],TargetFunctions->{Re,Im}]
Out[3]=
2    2 1/4     ArcTan[a, b]
(a  + b )    Sin[------------]
2

In[4]:=
D[{re,im},a].D[{re,im},b]//FullSimplify
Out[4]=
0
--
Andrzej Kozlowski
Toyama International University
JAPAN
http://sigma.tuins.ac.jp
http://eri2.tuins.ac.jp

----------
>From: Robert Prus <robert at fuw.edu.pl>
To: mathgroup at smc.vnet.net
>To: mathgroup at smc.vnet.net
>Subject: [mg18188] [mg18168] Some problems with complex functions like Sqrt[z]
>Date: Sun, Jun 20, 1999, 12:54 PM
>

> 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[1]:= f[z_]:=z^3
>
> In[2]:= re=Re[f[a+I b]]//ComplexExpand
>
>          3        2
> Out[2]= a  - 3 a b
>
> In[3]:= im=Im[f[a+I b]]//ComplexExpand
>
>            2      3
> Out[3]= 3 a  b - b
>
> In[4]:= D[{re,im},a].D[{re,im},b]//Simplify
>
> Out[4]= 0
>
> But if I choose more complicated function, like Sqrt[z], I obtain:
>
> In[5]:= f[z_]:=Sqrt[z]
>
> In[6]:= re=Re[f[a+I b]]//ComplexExpand
>
>                                Arg[a + I b]
> Out[6]= Sqrt[Abs[a + I b]] Cos[------------]
>                                     2
>
> In[7]:= im=Im[f[a+I b]]//ComplexExpand
>
>                                Arg[a + I b]
> Out[7]= Sqrt[Abs[a + I b]] Sin[------------]
>                                     2
>
> In[8]:= 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[8]= -------------------------------------------------
>                           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[10]:= %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[10]= -------------
>                2    2
>          Sqrt[a  + b ]
>
> Under Mathematica 2.0 as the final result I have:
>
> In[9]:= %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[9]= -------------------------
>                           2    2
>         4 (a - I b) Sqrt[a  + b ]
>
> But it should be equal to zero !!!
>