# # 11.1 Arithmetic of complex numbers # # # # MAPLE SESSION 1 # > I^2; # # # MAPLE SESSION 2 # > z1 := 2 + 3*I; > z2 := 4 - I; > z1 + z2; > z1 - z2; > z1 * z2; > z1/z2; > abs(z1); > Re(z1); > Im(z1); > conjugate(z1); # # # MAPLE SESSION 3 # > z := x + I*y; > Re(z); > Im(z); # # # MAPLE SESSION 4 # > assume(x,real); > assume(y,real); > z := x + y*I; > Re(z); > Im(z); # # # MAPLE SESSION 5 # > restart; > x,y; # # # MAPLE SESSION 6 # > z := x + I*y; > evalc(Re(z)); > evalc(Im(z)); > evalc(abs(z)); > evalc(conjugate(z)); # # 11.2 Polar form # # # # MAPLE SESSION 7 # > z := sqrt(3) + I; > convert(z,polar); # # # MAPLE SESSION 8 # > w := polar(sqrt(2),Pi/4); > evalc(w); # # # MAPLE SESSION 9 # > argument(1-I); > argument(polar(4,5*Pi/7)); > argument(polar(4,12*Pi/7)); # # # MAPLE SESSION 10 # > argument(sqrt(3) - I); > arctan(-1,sqrt(3)); # # 11.3 $n$th roots # # # # MAPLE SESSION 11 # > solve(z^4=-16*I); # # # MAPLE SESSION 12 # > map(simplify,[%]); # # # MAPLE SESSION 13 # > solve(z^4=-16*I): > map(simplify,[%]): > map(evalc,%): > map(simplify,%); # # # MAPLE SESSION 14 # > p := convert(-16*I,polar); > solve(z^4 = p); > map(simplify,[%]); # # 11.4 The Cauchy-Riemann equations and harmonic functions # # # # MAPLE SESSION 15 # > z := x + I*y; > u := evalc(Re(z^7)); > v := evalc(Im(z^7)); # # # MAPLE SESSION 16 # > diff(u,x)-diff(v,y); > diff(v,x)+diff(u,y); # # # MAPLE SESSION 17 # > with(linalg): > u:=cos(x)^3*cosh(y)^3-3*cos(x)*cosh(y)*sin(x)^2*sinh(y)^2; > laplacian(u,[x,y]); # # # MAPLE SESSION 18 # > u:=cos(x)^3*cosh(y)^3-3*cos(x)*cosh(y)*sin(x)^2 > *sinh(y)^2; > v:=simplify(int(diff(u,x),y)+ K(x)); # # # MAPLE SESSION 19 # > simplify(diff(v,x)+diff(u,y)); # # 11.5 Elementary functions # # # # MAPLE SESSION 20 # > z := x + I*y; > evalc(exp(z)); > exp(3/2*ln(2) + Pi/4*I); > evalc(%); # # # MAPLE SESSION 21 # > z := x + I*y; > evalc(sin(z)); > evalc(cos(z)); > cos(ln(2)*I); # # # MAPLE SESSION 22 # > z := x + I*y; > evalc(tan(z)); > evalc(cot(z)); > evalc(sec(z)); > evalc(csc(z)); > evalc(cosh(z)); > evalc(sinh(z)); # # # MAPLE SESSION 23 # > z := x + I*y; > log(z); > evalc(%); > log(-1); > log(I); > w :=log(exp(2+101*I*Pi/3)); > evalc(w); # # # MAPLE SESSION 24 # > z:=x+I*y; > evalc(exp(log(z))); > evalc(log(exp(z))); # # # MAPLE SESSION 25 # > z := I^(2*I); > evalc(z); # # 11.6 Conformal mapping # # # # MAPLE SESSION 26 # > with(plots): > conformal(z,z=(-1)..(1+I),grid=[11,6],labels=[x,y], > scaling=constrained); # # # MAPLE SESSION 27 # > with(plots): > conformal(z^2,z=(-1)..(1+I),grid=[11,6],labels=[u,v], > scaling=constrained); # # # MAPLE SESSION 28 # > with(plots): > conformal(exp(2*Pi*I*z),z=0..(1+I)); > conformal(exp(2*Pi*I*z),z=0..(1+I),grid=[20,20], > numxy=[30,30]); # # # MAPLE SESSION 29 # > f := z -> z + 1/z; > factor(diff(f(z),z)); # # # MAPLE SESSION 30 # > b := 1: > x := sqrt(1+b^2)*cos(t); > y := b + sqrt(1+b^2)*sin(t); > plot([x,y,t=0..2*Pi],scaling=constrained); # # # MAPLE SESSION 31 # > z := x + I*y; > u := simplify(evalc(Re(f(z)))); > v := simplify(evalc(Im(f(z)))); > plot([u,v,t=0..2*Pi],scaling=constrained); # # # MAPLE SESSION 32 # > JoukowskiP := proc(b,epsilon) > local r,x,y,z,u,v,t: > r := sqrt( (1+epsilon)^2 + b^2): > x := r*cos(t)+epsilon: > y := b + r*sin(t): > z := x + I*y: > u := simplify(evalc(Re(z + 1/z))): > v := simplify(evalc(Im(z + 1/z))): > return plot([u,v,t=0..2*Pi]): > end proc: # # # MAPLE SESSION 33 # > with(plots): > display(JoukowskiP(1/10,1/10),scaling=constrained, > thickness=2); # # # MAPLE SESSION 34 # > display(JoukowskiP(0,1/10),scaling=constrained); > display(JoukowskiP(1,1/10),scaling=constrained); > display(seq(JoukowskiP(k/5,1/10),k=0..5), > scaling=constrained); # # 11.7 Taylor series and Laurent series # # # # MAPLE SESSION 35 # > f := (2-z)/(1-z)^2; > taylor(f, z=0, 10); # # # MAPLE SESSION 36 # > taylor(f, z=2); # # # MAPLE SESSION 37 # > taylor(f, z=1, 10); # # # MAPLE SESSION 38 # > S := series(f, z=1,10); # # # MAPLE SESSION 39 # > S := series(f, z=1,10); > normal(f - S); # # # MAPLE SESSION 40 # > whattype(S); # # # MAPLE SESSION 41 # > P := convert(S, polynom); > normal(f - P); # # # MAPLE SESSION 42 # > g := (-2*z + 3)/z/(z-1)/(z-2); > series(g, z=0, 6); # # # MAPLE SESSION 43 # > PF := convert(g, parfrac, z); # # # MAPLE SESSION 44 # > g1 := op(1,PF); > g2 := op(2,PF); > g3 := op(3,PF); # # # MAPLE SESSION 45 # > gg2 := subs(z=1/z,g2); > series(gg2, z=0); # # # MAPLE SESSION 46 # > series(g3, z=0); # # 11.8 Contour integrals # # # # MAPLE SESSION 47 # > f := z -> Re(z^2); > Z := t-> t + I*t^2; > dZ := diff(Z(t),t); > Int(f(Z(t))*dZ,t=0..1)= > int(evalc(f(Z(t))*dZ),t=0..1); # # 11.9 Residues and poles # # # # MAPLE SESSION 48 # > f := z -> (exp(z^2) - 1)/z^4/(z-1)^3; > singular(f(z)); # # # MAPLE SESSION 49 # > series(f(z),z=0); # # # MAPLE SESSION 50 # > f := z -> (exp(z^2) - 1)/z^4/(z-1)^3: > series(f(z),z=1); # # # MAPLE SESSION 51 # > residue(f(z),z=0); # # # MAPLE SESSION 52 # > residue(f(z),z=1); # # # MAPLE SESSION 53 # > CI := 2*Pi*I*(residue(f(z),z=0)+residue(f(z),z=1)); > evalf(CI); # # # MAPLE SESSION 54 # > Z := t -> 2*exp(I*t); > dZ := diff(Z(t),t); > CI2 := int(evalc(f(Z(t))*dZ),t=0..2*Pi); > evalf(CI2);