読者です 読者をやめる 読者になる 読者になる

qex 概要

以下は Maxima 5.39.0 using Lisp CMU Common Lisp 21b (21B Unicode) 上での実行です.

qex は qe コマンドを有理数冪入力対応に拡張したもの(qe extended version)であり,qex([],formula) は qex(formula) のように省略可能です.また,出力は qe と同じく整数係数の多変数多項式による表示です.

平方根

(%i1) qex(y=sqrt(x));
Evaluation took 0.4700 seconds (0.8600 elapsed) using 28.694 MB.
(%o1) (y >= 0) %and (x-y^2 = 0)

複雑な式.

(%i2) qex(y=2^(2/3)/sqrt(2-2^(1/3)));
Evaluation took 0.6300 seconds (1.0100 elapsed) using 35.511 MB.
(%o2) (y > 0) %and (3*y^6-6*y^4-12*y^2-8 = 0)

不等式.

(%i3) qex(y<sqrt(x));
Evaluation took 0.5900 seconds (0.9900 elapsed) using 40.485 MB.
(%o3) (x >= 0) %and ((y < 0) %or (y^2-x < 0))

否定.

(%i4) qex(y#sqrt(x));
Evaluation took 0.4400 seconds (0.8400 elapsed) using 25.491 MB.
(%o4) (y < 0) %or (x-y^2 # 0)

絶対値.

(%i5) qex(y=abs(x));
Evaluation took 0.7100 seconds (1.2000 elapsed) using 52.369 MB.
(%o5) (y-x >= 0) %and (y+x >= 0) %and ((y-x = 0) %or (y+x = 0))

不等式.

(%i6) qex(x<=abs(x));
Evaluation took 0.4700 seconds (0.8500 elapsed) using 32.271 MB.
(%o6) true

元が2つの集合の最大値.

(%i7) qex(x=max2(a,b));
Evaluation took 1.1800 seconds (1.7000 elapsed) using 88.835 MB.
(%o7) ((b-x = 0) %or (x-a = 0)) %and (b-x <= 0) %and (x-a >= 0)

3つの場合.

(%i8) qex(x=min2(min2(a,b),c));
Evaluation took 2.4100 seconds (3.5600 elapsed) using 249.620 MB.
(%o8) ((b-x = 0) %or (c-x = 0) %or (x-a = 0))
  %and (b-x >= 0) %and (c-x >= 0) %and (x-a <= 0)

値域.

(%i9) qex([[E,x]],y=2/sqrt(x)+abs(x));
Evaluation took 1.0100 seconds (1.7000 elapsed) using 69.622 MB.
(%o9) y-3 >= 0

値域.

(%i10) qex([[E,x]],y=abs(x)+abs(x-1)+abs(x-2)+abs(x-3));
Evaluation took 3.1500 seconds (25.8000 elapsed) using 237.202 MB.
(%o10) y-4 >= 0

値域.

(%i11) qex([[E,x]],y=max2(x,min2(2-x,3-x)));
Evaluation took 1.4100 seconds (2.0700 elapsed) using 89.527 MB.
(%o11) y-1 >= 0

不等式.

(%i12) qex(abs(a+b)<=abs(a)+abs(b));
Evaluation took 0.9400 seconds (1.4900 elapsed) using 80.652 MB.
(%o12) true

不等式.

(%i13) qex(min2(a,b)<=max2(x,a-x)+min2(x,b-x));
Evaluation took 1.3800 seconds (1.7700 elapsed) using 134.412 MB.
(%o13) true

相加平均と相乗平均との大小関係.

(%i14) qex([[A,a],[A,b]],(a>=0 %and b>=0) %implies sqrt(a*b)<=(a+b)/n);
Evaluation took 2.5200 seconds (3.1200 elapsed) using 252.836 MB.
(%o14) (n-2 <= 0) %and (n > 0)

等式となる条件.

(%i15) qex("%and"(a>=0,b>=0,sqrt(a*b)=(a+b)/2));
Evaluation took 0.6700 seconds (1.1000 elapsed) using 57.813 MB.
(%o15) (a >= 0) %and (b-a = 0)

一様連続性.

(%i16) qex([[A,e]],(0<e) %implies (qex([[E,d]],(0<d) %and (qex([[A,x],[A,y]],(abs(x-y)<d) %implies (abs(x^(2/3)-y^(2/3))<e))))));
Evaluation took 6.2100 seconds (24.2100 elapsed) using 586.517 MB.
(%o16) true

拡張された量化子.

(%i17) qex([[X2,x]],abs(abs(abs(x^2-1)-a)-1)=x+1);
Evaluation took 4.8000 seconds (10.2200 elapsed) using 333.388 MB.
(%o17) (((a-3 < 0) %and (4*a-5 > 0)) %or ((a-1 < 0) %and (4*a+3 > 0))
                                     %or (a+1 < 0) %or (4*a-13 > 0))
  %and (a-3 # 0) %and (a-1 # 0) %and (a+1 # 0) %and (a+3 > 0)
  %and (4*a-13 # 0) %and (4*a-5 # 0) %and (4*a+3 # 0)

簡約.

(%i18) nnss(%);
Evaluation took 4.8300 seconds (8.3800 elapsed) using 186.479 MB.
(%o18) ((a-3 < 0) %and (4*a-5 > 0)) %or ((a-1 < 0) %and (4*a+3 > 0))
                                    %or (4*a-13 > 0)
                                    %or ((a+1 < 0) %and (a+3 > 0))

整理.(13/4 < a) が最初に来るのは %or が勝手に sort するためです.

(%i19) l2r(%);
Evaluation took 0.1400 seconds (0.1400 elapsed) using 4.450 MB.
(%o19) (13/4 < a) %or ((-3 < a) %and (a < -1)) %or ((-3/4 < a) %and (a < 1))
                  %or ((5/4 < a) %and (a < 3))