obsah.mw

Načtení balíků a procedur 

> restart;
 

> with(plots):with(plottools):
 

Warning, the name changecoords has been redefined 

Warning, the assigned name arrow now has a global binding 

> read("srafovani.txt"):
 

Příklad 1 

Určete obsah množiny ohraničené grafy funkcí f: y=-x^2-2*x+2a g: y=x^2+x-3. 

> g:=x->x^2+x-3;
 

(Typesetting:-mprintslash)([g := proc (x) options operator, arrow; x^2+x-3 end proc], [proc (x) options operator, arrow; x^2+x-3 end proc]) 

> f:=x->-x^2-2*x+2;
 

(Typesetting:-mprintslash)([f := proc (x) options operator, arrow; -x^2-2*x+2 end proc], [proc (x) options operator, arrow; -x^2-2*x+2 end proc]) 

> solve(f(x)=g(x));
 

(-5)/2, 1 

> plot({f(x), g(x)}, x=-3..2, scaling=constrained);
 

Plot 

> v:=plot({f(x), g(x)}, x=-3..2, scaling=constrained):
 

> pic:=shadein(f,g,[-5/2,1], gray):
 

> display({v,pic});
 

Plot 

> m:=Int(f(x)-g(x), x=-5/2..1);
 

(Typesetting:-mprintslash)([m := Int(-2*x^2-3*x+5, x = (-5)/2 .. 1)], [Int(-2*x^2-3*x+5, x = (-5)/2 .. 1)]) 

> value(m);
 

343/24 

Příklad 2 

Vypočtěte obsah kruhu o poloměru r>0. 

> assume(r>0);
 

> f:=x->sqrt(r^2-x^2);
 

(Typesetting:-mprintslash)([f := proc (x) options operator, arrow; sqrt(r^2-x^2) end proc], [proc (x) options operator, arrow; sqrt(r^2-x^2) end proc]) 

> g:=x->-sqrt(r^2-x^2);
 

(Typesetting:-mprintslash)([g := proc (x) options operator, arrow; -sqrt(r^2-x^2) end proc], [proc (x) options operator, arrow; -sqrt(r^2-x^2) end proc]) 

> m:=Int(f(x)-g(x), x=-r..r);
 

(Typesetting:-mprintslash)([m := Int(2*(r^2-x^2)^(1/2), x = -r .. r)], [Int(2*(r^2-x^2)^(1/2), x = -r .. r)]) 

 

> value(m);
 

r^2*Pi 

Příklad 3 

Určete obsah množiny ohraničené grafy funkcí f: y=-x^2+3*x a g: 2* 

> f:=x->-x^2+3*x;
 

(Typesetting:-mprintslash)([f := proc (x) options operator, arrow; -x^2+3*x end proc], [proc (x) options operator, arrow; -x^2+3*x end proc]) 

> g:=x->2*x^3-x^2-5*x;
 

(Typesetting:-mprintslash)([g := proc (x) options operator, arrow; 2*x^3-x^2-5*x end proc], [proc (x) options operator, arrow; 2*x^3-x^2-5*x end proc]) 

> solve(f(x)=g(x));
 

0, 2, -2 

> plot({f(x), g(x)}, x=-2.5..2.5);
 

Plot 

> pic:=shadein(f,g,[-2,2], gray):
 

> v:=plot([f(x), g(x)], x=-2.5..2.5,color=[red, blue]):
 

> display({pic,v});
 

Plot 

> m:=Int(g(x)-f(x), x=-2..0)+Int(f(x)-g(x), x=0..2);
 

(Typesetting:-mprintslash)([m := Int(2*x^3-8*x, x = -2 .. 0)+Int(8*x-2*x^3, x = 0 .. 2)], [Int(2*x^3-8*x, x = -2 .. 0)+Int(8*x-2*x^3, x = 0 .. 2)]) 

> value(m);
 

16 

Příklad 4 

Určete obsah množiny ohraničené křivkou danou parametricky x = t-sin(t), y = 1-cos(y)a osou x. 

> plot([t-sin(t), 1-cos(t), t=0..2*Pi], scaling=constrained, filled=true, color=gray);
 

Plot 

> m:=Int((1-cos(t))*abs(Diff(t-sin(t), t)), t=0..2*Pi);
 

(Typesetting:-mprintslash)([m := Int((1-cos(t))*abs(Diff(t-sin(t), t)), t = 0 .. 2*Pi)], [Int((1-cos(t))*abs(Diff(t-sin(t), t)), t = 0 .. 2*Pi)]) 

> value(m);
 

3*Pi 

Příklad 5 

Určete obsah množiny omezené kardioidou ϱ=1+ 

> polarplot(1+cos(phi), phi=0..2*Pi, scaling=constrained);
 

Plot 

> m:=Int((1+cos(phi))^2, phi=0..2*Pi);
 

(Typesetting:-mprintslash)([m := Int((1+cos(phi))^2, phi = 0 .. 2*Pi)], [Int((1+cos(phi))^2, phi = 0 .. 2*Pi)]) 

> value(m);
 

3*Pi 

>