Lab 5 command lines 1. y1:=x->x^2;y2:=x->8-3*x^2; solutions:=solve(y2(x)=y1(x),x); a:=solutions[1];b:=solutions[2]; plot([y1(x),y2(x)],x=a..b,color=[green,orange],thickness=2); Int(Int(f(x,y), y=y1(x)..y2(x)), x=a..b): %=value(%); x1:=y->2*y^2; x2:=y->10*y-5*y^2; solutions:=solve(x1(y)=x2(y),y); c:=solutions[1];d:=solutions[2]; implicitplot({x=x1(y),x=x2(y)},x=0..5,y=c..d,thickness=2); Int(Int(f(x,y),x=x1(y)..x2(y)),y=c..d): %=value(%); implicitplot({x=1,y=x-1,y=3},x=1..4,y=0..3); 2. restart:with(linalg):with(plots): E:=[(x,y)->(y^2-x^2+2*x*y)/(x^2+y^2)^2,(x,y)->(y^2-x^2-2*x*y)/(x^2+y^2)^2]; r1:=[t->1-2*t,t->1]; r2:=[t->cos(Pi*t),t->sin(Pi*t)+1]; r3:=[t->sqrt(2)*cos(Pi*(2*t+1)/4),t->sqrt(2)*sin(Pi*(2*t+1)/4)]; r4:=[t->sqrt(2)*cos(Pi*(1-6*t)/4),t->sqrt(2)*sin(Pi*(1-6*t)/4)]; r:=r1; v:=D(r); EE:=simplify(E(op(r(t)))); u:=simplify(EE[1]*v(t)[1]+EE[2]*v(t)[2]); Int(u,t=0..1)=value(Int(u,t=0..1)); c1:=plot([op(r1(t)),t=0..1],x=-1.2..1.2,y=0..2.2,color=red,thickness=3): c2:=plot([op(r2(t)),t=0..1],x=-1.2..1.2,y=0..2.2,color=blue,thickness=3): c3:=plot([op(r3(t)),t=0..1],x=-1.2..1.2,y=0..2.2,color=green,thickness=3): c4:=plot([op(r4(t)),t=0..1],x=-2.5..2.5,y=-1.8..2.2,color=black,thickness=3): display(c1,c2,c3,c4); g:=(x,y)->int(E[1](x,y),x)+c(y); g(x,y); w:=diff(g(x,y),y); Diff(c(y),y)=solve(w=E[2](x,y),diff(c(y),y)); c(y):=int(solve(w=E[2](x,y),diff(c(y),y)),y); g(x,y):=simplify(g(x,y)); simplify(evalm(grad(g(x,y),[x,y]) - E(x,y))); c5:=fieldplot(E(x,y),x=-1.2..1.2,y=0.9..2.2,axes=none,arrows=slim,color=x): display(c5); c6:=contourplot(g(x,y),x=-1.2..1.2,y=0.9..2.2): display(c5,c6); 3. restart:with(plots): m:=(x,y)->-y/(x^2+y^2);n:=(x,y)->1/(x^2+y^2); a:=t->cos(2*Pi*t);b:=t->sin(2*Pi*t); Int(m(a(t),b(t))*D(a)(t),t=0..1)+Int(n(a(t),b(t))*D(b)(t),t=0..1):%=value(%); Int(Int(diff(n(x,y),x),x=-sqrt(1-y^2)..sqrt(1-y^2)),y=-1..1) - Int(Int(diff(m(x,y),y),x=-sqrt(1-y^2)..sqrt(1-y^2)),y=-1..1):%=value(%);