restart; # Computing the area enclosed by a parametric curve f:=piecewise(0<=t and t<1,1, 1<=t and t<2,t, 2<=t and t<3,2, 3<=t and t<=4,5-t); g:=piecewise(0<=t and t<1,-t, 1<=t and t<2,-1/t, 2<=t and t<3,-(3-t)/2, 3<=t and t<=4,0); plot([f,g,t=0..4]); A1:=-int(-1/x,x=1..2); df:=diff(f,t); A2:=-int(df*g,t=0..4); f:=cos(t)*(2+sin(5*t)); g:=sin(t)*(2+sin(5*t)); plot([f,g,t=0..2*Pi]); dg:=diff(g,t); A1:=Int(dg*f,t=0..2*Pi); value(A1); evalf(A1); df:=diff(f,t); A2:=-int(df*g,t=0..2*Pi);