Question: Plotting contour integral diagrams

 I am writing notes on complex analysis, I need to use figures of contour paths to integrate on them, i want to create something like this

I tried to plot the contour for 
\oint_{|z|=2} \frac{1}{z^2+1}\,dz
I need to have connecting lines all around because the poles can not be isolated

with(plots); circle1 := plot([2*cos(t), 2*sin(t), t = 0 .. 2*Pi], color = blue, thickness = 2); circle2 := plot([(1/2)*cos(t), 1+(1/2)*sin(t), t = 0 .. 2*Pi], color = "Green", thickness = 2); circle3 := plot([(1/2)*cos(t), -1+(1/2)*sin(t), t = 0 .. 2*Pi], color = "Red", thickness = 2); sing1 := plottools[disk]([0, 1], 0.2e-1, color = white); sing2 := plottools[disk]([0, -1], 0.2e-1, color = white); label1 := textplot([.1, 1.1, "z = i"], font = [Arial, Bold, 12]); label2 := textplot([.1, -1.1, "z = -i"], font = [Arial, Bold, 12])

display(circle1, circle2, circle3, sing1, sing2, label1, label2, scaling = constrained, labels = ["Re", "Im"])

 
 

restart; f := proc (z) options operator, arrow; 1/(z^2+1) end proc; z := 2*exp(I*t); dz := diff(z, t); integrand := f(z)*dz; simplify(integrand); value(Int(integrand, t = 0 .. 2*Pi))

0

(1)

Download CIF.mw

Please Wait...