X=sum(f(z1[i])*(z1[i+1]-z1[i])foriinrange(0,N-1))Y=sum(f(z2[i])*(z2[i+1]-z2[i])foriinrange(0,N-1))X+Y# Approximation of the integral sums
dc1(t)=c1.diff(t)# derivative of c1(t)dc2(t)=c2.diff(t)# derivative of c2(t)answer1=integrate(f(c1(t))*dc1(t),(t,start,stop))answer2=integrate(f(c2(t))*dc2(t),(t,start,stop))answer=answer1+answer2answer# final solution of adding the two integrals
e^(I + 1) - 1
float(answer.real_part())+float(answer.imag_part())*I# check if answer from parametrization agrees with approximation by taking its floating-point value