var('t','x','y') #Define your variables r(t) = (5*cos(t),5*sin(t)) #State your parametrization bounds = (t,0,2*pi) #Give bounds for the parametrization F(x,y) = (3*x,3*y) #State the vector field xbounds = (x,-6,6) #These bounds are useful if you want to make a good plot. ybounds = (y,-6,6) #These bounds are useful if you want to make a good plot. dr = diff(r,t) #Compute the derivative nds = vector((dr[1],-dr[0])) #Get the normal vector by swapping the order and changing the sign. dFlux=F(x=r[0],y=r[1]).dot_product(nds(t)) #Find a little bit of Flux. We dot F and nds Flux=integrate(dFlux,bounds) #Integrate a little bit of flux. print ("The flux of F=",F(x,y), " across the curve r=",r(t), " over the bounds ", bounds," is ", Flux) print ("") print ("r = (x,y) = ", r(t)) print ("dr = (dx,dy) = ", dr(t)) print ("nds = (dy,-dx) = ", nds(t)) print ("F = (M,N) = ", F(x,y)) print ("F in terms of t = ", F(x=r[0],y=r[1])) print ("dFlux = F.nds = Mdy-Ndx = ",dFlux) print ("W = integrate F.dr = ", Flux) p=parametric_plot(r(t),bounds) p+=plot_vector_field(F,xbounds,ybounds) show(p)