0% found this document useful (0 votes)
5 views25 pages

Complex Analysis

The document contains a series of mathematical computations and visualizations related to complex analysis, including solving equations, plotting roots, and transforming geometric shapes like ellipses and polygons. It covers various problems such as finding roots of complex equations, mapping disks under transformations, and comparing integrals over different paths. Each section includes code snippets and graphical outputs to illustrate the results of the computations.

Uploaded by

Kartik Makkar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views25 pages

Complex Analysis

The document contains a series of mathematical computations and visualizations related to complex analysis, including solving equations, plotting roots, and transforming geometric shapes like ellipses and polygons. It covers various problems such as finding roots of complex equations, mapping disks under transformations, and comparing integrals over different paths. Each section includes code snippets and graphical outputs to illustrate the results of the computations.

Uploaded by

Kartik Makkar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

(*Q1:Solvez^3=-27iandrepresentgeometrically*)Clear[z]

In[]:=

roots=N[z/.Solve[z^3-27I,z]];

Print["Rootsofz^3=-27iare:",roots];

ListPlot[Transpose[{Re[roots],Im[roots]}],PlotStyle{Red,PointSize[Large]},AxesLabel
{"Re(z)","Im(z)",AspectRatioAutomatic,GridLinesAutomatic,PlotRange{{-4,4},{-4,4}},
Epilog{Blue,Circle[{0,0},3]},PlotLabel"Rootsofz^3=-27i"]

Out[]= Rootsofz^3=-27iare:{0.+3.,-2.59808-1.5,2.59808-1.5}

Rootsofz^3=-27iIm(z)
4

Re(z)
4 -2 2 4

-2

-4
2 [Link]

I n [ ] : = (*Q2:Image of disk z-(2-i) <2 under w=(2+i)z+1*)


Clear[t]

A = 2 + I;
B = 1;

centerZ = 2 - I;
radiusZ = 2;

centerW = A centerZ + B;
radiusW = Abs[A] radiusZ;

Print["Image center = ", FullSimplify[centerW]];


Print["Image radius = ", radiusW];

ParametricPlot[{{Re[centerZ + radiusZ Exp[I t]], Im[centerZ + radiusZ Exp[I t]]},


{Re[centerW + radiusW Exp[I t]], Im[centerW + radiusW Exp[I t]]}}, {t, 0, 2 Pi},
PlotStyle  {Blue, Red}, AxesLabel  {"Real", "Imaginary"}, AspectRatio  Automatic,
GridLines  Automatic, PlotRange  All, PlotLabel  "Disk and Image Disk"]
Image center = 6

Image radius = 2 5
O u t [ ] =
Disk and Image Disk
Imaginary

Real
2 4 6 8 10

-2

-4
[Link] 3

I n [ ] : = (*Q3:Ellipse with major axis 8 and minor axis 2,


rotated by Pi/6 and shifted to (2,-1)*)Clear[t, x, y, xr, yr]

a = 4;
b = 1;

theta = Pi / 6;

h = 2;
k = - 1;

x[t_] := a Cos[t];
y[t_] := b Sin[t];

xr[t_] := h + x[t] × Cos[theta] - y[t] × Sin[theta];


yr[t_] := k + x[t] × Sin[theta] + y[t] × Cos[theta];

Print["Original ellipse:"];
Print["x(t) = ", x[t]];
Print["y(t) = ", y[t]];

Print["After rotation and shifting:"];

Print["x(t) = ", FullSimplify[xr[t]]];


Print["y(t) = ", FullSimplify[yr[t]]];

ParametricPlot[{{x[t], y[t]}, {xr[t], yr[t]}}, {t, 0, 2 Pi}, PlotStyle  {Blue, Red},


AxesLabel  {"x", "y"}, AspectRatio  1, GridLines  Automatic,
PlotRange  All, PlotLabel  "Original and Transformed Ellipse"]
Original ellipse:

x(t) = 4 Cos[t]

y(t) = Sin[t]

After rotation and shifting:


Sin[t]
x(t) = 2 + 2 3 Cos[t] -
2
1
y(t) = -1 + 2 Cos[t] + 3 Sin[t]
2
4 [Link]

O u t [ ] =
Original and Transformed Ellipse
y

x
-4 -2 2 4 6

-1

-2

-3
[Link] 5

I n [ ] : = (*Q4:Solve z^4=-16 and plot roots*)Clear[z]

roots = z /. Solve[z ^ 4  - 16, z];

Print["Roots of z^4 = -16 are: ", roots];

ListPlot[Transpose[{Re[roots], Im[roots]}],
PlotStyle  {Red, PointSize[Large]}, AxesLabel  {"Re(z)", "Im(z)"},
AspectRatio  1, GridLines  Automatic, PlotRange  {{- 3, 3}, {- 3, 3}},
Epilog  {Blue, Circle[{0, 0}, 2]}, PlotLabel  "Roots of z^4 = -16"]
Roots of z^4 = -16 are: -2 (-1)1/4 , 2 (-1)1/4 , -2 (-1)3/4 , 2 (-1)3/4 
O u t [ ] =
Roots of z^4 = -16
Im(z)
3

Re(z)
-3 -2 -1 1 2 3

-1

-2

-3
6 [Link]

I n [ ] : = (*Q5:Ellipse with semi-axes 5 and 3,


rotated by Pi/8 and shifted to (-2,-2)*)Clear[t, x, y, xr, yr]

a = 5;
b = 3;

theta = Pi / 8;

h = - 2;
k = - 2;

x[t_] := a Cos[t];
y[t_] := b Sin[t];

xr[t_] := h + x[t] × Cos[theta] - y[t] × Sin[theta];


yr[t_] := k + x[t] × Sin[theta] + y[t] × Cos[theta];

Print["Rotated and shifted ellipse equations:"];

Print["x(t) = ", FullSimplify[xr[t]]];


Print["y(t) = ", FullSimplify[yr[t]]];

ParametricPlot[{{x[t], y[t]}, {xr[t], yr[t]}}, {t, 0, 2 Pi}, PlotStyle  {Blue, Red},


AxesLabel  {"x", "y"}, AspectRatio  Automatic, GridLines  Automatic,
PlotRange  All, PlotLabel  "Ellipse and Transformed Ellipse"]
Rotated and shifted ellipse equations:
π π
x(t) = -2 + 5 Cos  × Cos[t] - 3 Sin  × Sin[t]
8 8
π π
y(t) = -2 + 5 Cos[t] × Sin  + 3 Cos  × Sin[t]
8 8
O u t [ ] =
Ellipse and Transformed Ellipse
y

x
-6 -4 -2 2 4

-2

-4
[Link] 7

I n [ ] : = (*Q6:Solve z^5=-32 and represent geometrically*)Clear[z]

roots = z /. Solve[z ^ 5  - 32, z];

Print["Roots of z^5 = -32 are: ", roots];

ListPlot[Transpose[{Re[roots], Im[roots]}],
PlotStyle  {Red, PointSize[Large]}, AxesLabel  {"Re(z)", "Im(z)"},
AspectRatio  1, GridLines  Automatic, PlotRange  {{- 3, 3}, {- 3, 3}},
Epilog  {Blue, Circle[{0, 0}, 2]}, PlotLabel  "Roots of z^5 = -32"]
Roots of z^5 = -32 are: -2, 2 (-1)1/5 , -2 (-1)2/5 , 2 (-1)3/5 , -2 (-1)4/5 
O u t [ ] =
Roots of z^5 = -32
Im(z)
3

Re(z)
-3 -2 -1 1 2 3

-1

-2

-3
8 [Link]

I n [ ] : = (*Q7:Polygon joining-1-i,2+i and 2-i and its image under w=z+i*)Clear[t]

z1[t_] := (- 1 - I) + t ((2 + I) - (- 1 - I));

z2[t_] := (2 + I) + t ((2 - I) - (2 + I));

z3[t_] := (2 - I) + t ((- 1 - I) - (2 - I));

w[z_] := z + I;

ParametricPlot[{{Re[z1[t]], Im[z1[t]]}, {Re[z2[t]], Im[z2[t]]},


{Re[z3[t]], Im[z3[t]]}, {Re[w[z1[t]]], Im[w[z1[t]]]},
{Re[w[z2[t]]], Im[w[z2[t]]]}, {Re[w[z3[t]]], Im[w[z3[t]]]}}, {t, 0, 1},
PlotStyle  {Blue, Blue, Blue, Red, Red, Red}, AxesLabel  {"Re(z)", "Im(z)"},
AspectRatio  1, GridLines  Automatic, PlotRange  {{- 3, 4}, {- 3, 4}},
PlotLabel  "Polygon and its Image under w = z + i"]
O u t [ ] =
Polygon and its Image under w = z + i
Im(z)
4

Re(z)
-3 -2 -1 1 2 3 4

-1

-2

-3
[Link] 9

I n [ ] : = (*Q8:Show integral over line and parabola are equal*)Clear[t, z1, z2]

(*Straight line from 0 to 1+i*)

z1[t_] := t (1 + I);

(*Parabola joining same endpoints*)

x[t_] := t;
y[t_] := t ^ 2;

z2[t_] := x[t] + I y[t];

int1 = Integrate[z1[t] × z1 '[t], {t, 0, 1}];

int2 = Integrate[z2[t] × z2 '[t], {t, 0, 1}];

Print["Integral over C1 = ", FullSimplify[int1]];


Print["Integral over C2 = ", FullSimplify[int2]];

Print["Difference = ", FullSimplify[int1 - int2]];

ParametricPlot[{{Re[z1[t]], Im[z1[t]]}, {Re[z2[t]], Im[z2[t]]}},


{t, 0, 1}, PlotStyle  {Blue, Red}, AxesLabel  {"Re(z)", "Im(z)"},
AspectRatio  1, GridLines  Automatic,
PlotRange  {{0, 1.5}, {0, 1.5}}, PlotLabel  "Contours C1 and C2"]
Integral over C1 = 

Integral over C2 = 

Difference = 0
O u t [ ] =
Contours C1 and C2
Im(z)

1.4

1.2

1.0

0.8

0.6

0.4

0.2

0.0 Re(z)
0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4
10 [Link]

I n [ ] : = (*Q9:Solve z^4=16 i and represent geometrically*)Clear[z]

roots = z /. Solve[z ^ 4  16 I, z];

Print["Roots of z^4 = 16 i are: ", roots];

ListPlot[Transpose[{Re[roots], Im[roots]}],
PlotStyle  {Red, PointSize[Large]}, AxesLabel  {"Re(z)", "Im(z)"},
AspectRatio  1, GridLines  Automatic, PlotRange  {{- 3, 3}, {- 3, 3}},
Epilog  {Blue, Circle[{0, 0}, 2]}, PlotLabel  "Roots of z^4 = 16 i"]
Roots of z^4 = 16 i are: -2 (-1)1/8 , 2 (-1)1/8 , -2 (-1)5/8 , 2 (-1)5/8 
O u t [ ] =
Roots of z^4 = 16 i
Im(z)
3

Re(z)
-3 -2 -1 1 2 3

-1

-2

-3
[Link] 11

I n [ ] : = (*Q10:Ellipse centered at origin with axes 6 and 4,


rotated by Pi/3 and shifted to (-1,2)*)Clear[t, x, y, xr, yr]

a = 3;
b = 2;

theta = Pi / 3;

h = - 1;
k = 2;

x[t_] := a Cos[t];
y[t_] := b Sin[t];

xr[t_] := h + x[t] × Cos[theta] - y[t] × Sin[theta];


yr[t_] := k + x[t] × Sin[theta] + y[t] × Cos[theta];

Print["Transformed ellipse equations:"];

Print["x(t) = ", FullSimplify[xr[t]]];


Print["y(t) = ", FullSimplify[yr[t]]];

ParametricPlot[{{x[t], y[t]}, {xr[t], yr[t]}}, {t, 0, 2 Pi}, PlotStyle  {Blue, Red},


AxesLabel  {"x", "y"}, AspectRatio  1, GridLines  Automatic,
PlotRange  {{- 6, 6}, {- 4, 8}}, PlotLabel  "Original and Transformed Ellipse"]
Transformed ellipse equations:
3 Cos[t]
x(t) = -1 + - 3 Sin[t]
2
3
y(t) = 2 + 3 Cos[t] + Sin[t]
2
12 [Link]

O u t [ ] =
Original and Transformed Ellipse
y
8

x
-6 -4 -2 2 4 6

-2

-4

(*Q.11 Show that the transformation w=1/z maps the half-plane Re(z)>1 to a disk*)
z = x+I*y

a1 = RegionPlot[x > 1, {x, - 5, 5}, {y, - 5, 5}, Axes  True, BoundaryStyle  Dashed]

a2 = Graphics[{Blue, Disk[{1 / 2, 0}, 1 / 2]}]

Show[a1, a2]

sol = Solve[(u - 1 / 2) ^ 2 + v ^ 2  1 / 4, v]

p1 = Plot[v /. sol, {u, - 2, 2}, AspectRatio  Automatic, PlotStyle  Red]

Show[p1, a2]
O u t [ ] =

x+y
[Link] 13

O u t [ ] =

-2

-4

-4 -2 0 2 4

O u t [ ] =
14 [Link]

O u t [ ] =

-2

-4

-4 -2 0 2 4

O u t [ ] =

v  - u - u2 , v  u - u2 

O u t [ ] =

0.4
0.2

-2 -1 1 2
-0.2
-0.4

O u t [ ] =

0.4
0.2

-2 -1 1 2
-0.2
-0.4

I n [ ] : = (*Q.12 Ellipse with semi-axes 5 and 3 and rotation by π/4*)


a1 = ParametricPlot[{5 * Cos[t], 3 * Sin[t]}, {t, 0, 2 * Pi}]

a2 = ParametricPlot[{5 * Cos[t] * Cos[Pi / 4] - 3 * Sin[t] * Sin[Pi / 4],


5 * Cos[t] * Sin[Pi / 4] + 3 * Sin[t] * Cos[Pi / 4]},
{t, 0, 2 * Pi}, ColorFunction  "Rainbow"]

Show[a1, a2, PlotRange  {{- 7, 7}, {- 7, 7}}]


[Link] 15

O u t [ ] =

-4 -2 2 4

-1

-2

-3

O u t [ ] =
16 [Link]

O u t [ ] =

I n [ ] : = (*Q13:Show that w=iz+1 maps right half-plane to upper half-plane*)


Clear[x, y, u, v, z, w]

z = x + I y;
w = I z + 1;

u = ComplexExpand[Re[w]];
v = ComplexExpand[Im[w]];

Print["u = ", u];


Print["v = ", v];

leftPlot = RegionPlot[x > 0, {x, - 5, 5}, {y, - 5, 5},


Axes  True, AspectRatio  1, PlotLabel  "z-plane: Re(z) > 0"]

rightPlot = RegionPlot[v > 0, {u, - 5, 5}, {v, - 5, 5},


Axes  True, AspectRatio  1, PlotLabel  "w-plane: Im(w) > 0"]

Show[{leftPlot, rightPlot}]
u = 1-y

v = x
[Link] 17

O u t [ ] =
z-plane: Re(z) > 0

-2

-4

-4 -2 0 2 4

O u t [ ] =
w-plane: Im(w) > 0

-2

-4

-4 -2 0 2 4
18 [Link]

O u t [ ] =
z-plane: Re(z) > 0

-2

-4

-4 -2 0 2 4

I n [ ] : = (*Q14:Under w=3z+2i,show disk maps to disk w-(3+2i) <6*)Clear[x, y, u, v, z, w];

originalDisk = Graphics[{Blue, Opacity[0.4], Disk[{1, 0}, 2]}, Axes  True];

imageDisk = Graphics[{Red, Opacity[0.4], Disk[{3, 2}, 6]}, Axes  True];

Show[{Show[originalDisk, PlotRange  {{- 4, 4}, {- 4, 4}}],


Show[imageDisk, PlotRange  {{- 5, 12}, {- 6, 10}}]}, PlotRange  All]
O u t [ ] =
8

-2 2 4 6 8

-2

-4
[Link] 19

I n [ ] : = (*Q15:Plot grid and image under w=1/z*)Clear[x, y]

zPlane = ContourPlot[{x  - 2, x  0, x  2, y  - 2, y  0, y  2},


{x, - 5, 5}, {y, - 5, 5}, Axes  True, PlotLabel  "z-plane"]

u[x_, y_] := x / (x ^ 2 + y ^ 2);


v[x_, y_] := - y / (x ^ 2 + y ^ 2);

wPlane = ContourPlot[
{u[x, y]  - 2, u[x, y]  0, u[x, y]  2, v[x, y]  - 2, v[x, y]  0, v[x, y]  2},
{x, - 5, 5}, {y, - 5, 5}, Axes  True, PlotPoints  100, PlotLabel  "w-plane"]

GraphicsRow[{zPlane, wPlane}]
O u t [ ] =
z-plane

-2

-4

-4 -2 0 2 4
20 [Link]

O u t [ ] =
w-plane

-2

-4

-4 -2 0 2 4

O u t [ ] =

z-plane w-plane

4 4

2 2

0 0

-2 -2

-4 -4

-4 -2 0 2 4 -4 -2 0 2 4
[Link] 21

I n [ ] : = (*Q16:Evaluate ∫ _C 1/z^2 dz*)Clear[t, z, f]

z[t_] := 2 Exp[I t];

f[z_] := 1 / z ^ 2;

int = FullSimplify[f[z[t]] × z '[t]];

Print["Integrand = ", int];

val = FullSimplify[Integrate[int, {t, 0, Pi}]];

Print["Integral value = ", val];


1
Integrand = ( Cos[t] + Sin[t])
2
Integral value = 1

I n [ ] : = (*Q.17 Plot image of vertical lines under w=1/z*)


z = x+I*y

a1 = ContourPlot[{x  - 1, x  0, x  1},
{x, - 5, 5}, {y, - 5, 5}, Axes  True, AxesLabel  {x, y}]

a2 = ContourPlot[{Re[1 / (x + I * y)]  - 1, Re[1 / (x + I * y)]  0, Re[1 / (x + I * y)]  1},


{x, - 5, 5}, {y, - 5, 5}, Axes  True, AxesLabel  {u, v}]

GraphicsRow[{a1, a2}]
O u t [ ] =

x+y
O u t [ ] =
y

0 x

-2

-4

-4 -2 0 2 4
22 [Link]

O u t [ ] =
x

0 1-y

-2

-4

-4 -2 0 2 4

O u t [ ] =

y x

4 4

2 2

0 x 0 1-y

-2 -2

-4 -4

-4 -2 0 2 4 -4 -2 0 2 4
[Link] 23

I n [ ] : = (*Q18:Evaluate ∫ _L e^z dz*)ClearAll[z, t, f]

f[z_] := Exp[z];

(*Line from z=1 to z=3+i*)


z[t_] := 1 + t (2 + I);

integrand = FullSimplify[f[z[t]] × z '[t]];

Print["Integrand = ", integrand];

val = FullSimplify[Integrate[integrand, {t, 0, 1}]];

Print["Integral = ", val];

curve[t_] := {Re[z[t]], Im[z[t]]};

ParametricPlot[curve[t], {t, 0, 1}, PlotStyle  Purple, AxesLabel  {"Re(z)", "Im(z)"},


AspectRatio  1, GridLines  Automatic, PlotLabel  "Contour L"]
Integrand = (2 + ) 1+(2+) t

Integral =  -1 + 2+ 


O u t [ ] =
Contour L
Im(z)

1.0

0.8

0.6

0.4

0.2

Re(z)
1.5 2.0 2.5 3.0
24 [Link]

I n [ ] : = (*Q19:Laurent series of f(z)=1/(z^2-1)*)ClearAll[z, f]

f[z_] := 1 / (z ^ 2 - 1);

series = Normal[Series[f[z], {z, 0, 10}]];

Print["f(z) = ", f[z]];


Print["Series expansion = ", series];

Plot[{f[x], series}, {x, - 0.9, 0.9}, PlotStyle  {Red, Blue},


PlotLegends  {"f(x)", "Series"}, AxesLabel  {"x", "y"}, PlotRange  All]
1
f(z) =
-1 + z2
Series expansion = -1 - z2 - z4 - z6 - z8 - z10
O u t [ ] =
y

x
-0.5 -1 0.5

-2

f(x)
-3 Series

-4

-5
[Link] 25

I n [ ] : = (*Q20:Image of z+2i <1 under w=(1+2i)z-i*)


originalDisk = Graphics[{Blue, Opacity[0.4], Disk[{0, - 2}, 1]}, Axes  True];

imageDisk = Graphics[{Red, Opacity[0.4], Disk[{4, - 3}, Sqrt[5]]}, Axes  True];

Show[{originalDisk, imageDisk}, PlotRange  All]


O u t [ ] =

-1

-2

-3

-4

-1 1 2 3 4 5 6

You might also like