\input{stddefs.tex}
\usepackage{manfnt}
\usepackage{html}
\begin{document}
\title{Maxima Tips (Version 0.23.0)}
\maketitle
\section{はじめに(copy right など)}
この文書はもともと(主として Linux 版の) Maxima について、
使い方を Maima Tips としてまとめたものを下敷きにして、
maxima だったらどうなるかについてまとめたものです。
%その機能をもとに書いています。 なので
過去のバージョンとはそぐわないところがあるかもしれません。
この文書は書きかけです。


この文書は GNU Free Documentation License (version 1.1 あるいはそれ以降) に
従います。


\begin{verbatim}
     (c) Copyright 2024-2026 Yoshifumi Tsuchimoto
      Permission is granted to copy, distribute and/or modify this document     
      under the terms of the GNU Free Documentation License, Version 1.1        
      or any later version published by the Free Software Foundation;           
      with no Invariant Sections, with no  Front-Cover Texts,
      and with no Back-Cover Texts.
      A copy of the license is included in the section entitled "GNU            
      Free Documentation License".                                              
                                                                              

\end{verbatim}



\section{関連リンク}
\subsection{web のサイト(ここではよく参照したサイトをご紹介します)}
ponpoko さまの
\htmladdnormallink{Maxima Manual}
{http://fe.math.kobe-u.ac.jp/MathLibre-doc/ponpoko/MaximaManualBeta.pdf}
はとても参考になります。


\htmladdnormallink{逸見豊先生のpdfテキスト(を土基が勝手にアップしたもの)}{http://www.math.kochi-u.ac.jp/docky/kogi/kogi2018_1/keisankisuugaku/maxima/maxima101.pdf}
も良いかもしれません。

\htmladdnormallink{wikibooks}
{https://ja.wikibooks.org/wiki/Maxima}
もこの頃良くなっているようです。

\htmladdnormallink{gemini さん}
{https://gemini.google.com/}
を始めとする AIさんに聞くことも最近は有効のようです。
\subsection{Maxima利用におけるGoogle AIの注意点(Google AIさん自身に聞いた答えです。)}

Google AIを数式処理ソフトMaximaの入力補助として利用する際、特に以下の点にご注意ください。

\begin{itemize}
    \item \textbf{構文の正確性に関する注意（Syntax Accuracy）}
          AIが提案するコードや構文は、一般的な数学表記や他のプログラミング言語の慣習に基づいている場合があります。
          Maximaは独自の厳密なコマンド体系を持っているため、AIの出力をそのまま貼り付けるとエラーが発生する可能性があります。
          必ずMaximaの\htmladdnormallink{maxima.sourceforge.net}{公式ドキュメント}やマニュアルと照らし合わせ、構文の微調整（例：関数の引数、大文字・小文字の区別、終端記号\text{`;`や`\$`}の有無など）を行ってください。

    \item \textbf{AI機能へのアクセス方法（Accessing the AI Features）}
          Google AIの機能を利用するには、ユーザーが[google.com](https://www.google.com)にアクセスするか、モバイルアプリなどの特定のインターフェースを使用する必要があります。
          これらの機能は通常のGoogle検索結果画面に常に表示されるとは限らないため、使用方法をユーザーに明確に伝える必要があります。

    \item \textbf{学習と検証の必要性（Learning and Verification）}
          AIは強力な補助ツールですが、万能ではありません。
          生成された結果が意図した数学的処理に対応しているか、またMaxima上で正確に機能するかどうかを検証する責任はユーザーにあります。
          AIの利用は、Maxima自体の習熟度を高めるための学習プロセスの一部として捉えることを推奨します。
\end{itemize}

\section{使わせてくれそうなサイト様}
\htmladdnormallink{sagecell.sagemath.org}
{https://sagecell.sagemath.org/}

使うとき:
(必要ならclear ボタンを押して先に書かれているものを消したあと)
計算したい事項をコピペのあと
Language ボタンを Maxima に変更(もしくは確認の上)

Evaluate ボタンを押せばよい。



\section{一般的な注意}
Maxima は、
大文字、小文字を区別します。




\subsection{起動の仕方と終了の仕方(control-D,quit())}
kterm や rxvt のコマンドラインから、
\begin{verbatim}

maxima

\end{verbatim}
と打てば Maxima が起動します。

control-D (control キーを押しながら d キーを押す)と打つと終ります。

もしくは

\begin{verbatim}

quit();

\end{verbatim}
と打つのも maxima を終了する方法です。
こちらのほうが由緒正しい終わりかたという気がしますね。



\subsection{プログラムを作って読み込ませる。(batch)}
Maxima のプロンプトにいろいろいれて、
遊ぶこともできますが、やはり慣れたエディタでプログラムを
書いていった方が楽です。

プログラムを読み込むには、
\begin{verbatim}

batch("xx.mac");



\end{verbatim}
などと、batch コマンドをMaxima のプロンプトにいれればOKです。
あるいは、Maxima を起動するときに -b オプションの引数として
指定することもできます。
\begin{verbatim}

maxima -b  xx.mac

\end{verbatim}
てな感じです。
\subsubsection{拡張子は .macを}
なおmaximaのプログラムを書いたファイルには、拡張子として \verb+.mac+ を使うのが
いいようです。 

\subsubsection{コメント行 ( /*...*/)}
Maxima では /* で始まって、 */ で終わる部分はコメントとみなされます。

(コメントとはそのプログラムを読む人間のために書かれた
文章で、コンピュータにとってはあってもなくても同じ、
という類のものです。
Maxima に限らず、どんなプログラムでも、簡単な使い方や
プログラムを使うためのポイントなどの
コメントをいれておくことは大事です。)

これは C(++) ではおなじみですね。

\subsection{ゴワサンで願いましては (kill(all);, reset();)}
今まで計算して来た結果を全て一旦破棄して、
もう一度一番始めから計算したい時があります。
そのようなとき、maxima を一旦終了してもう一度起動してもよいのですが、
\begin{verbatim}

kill(all);

\end{verbatim}

としてやるほうが maxima の再起動をしなくてすむ分時間の節約になります。
(もっとも、これは maxima にメモリリークがないと仮定しての話で、
どうしても気になる時にはやはり maxima を再起動してやる方が
安心のような気もします。)
とりあえず reset()では不十分でした。
(本稿の version が古い版は間違っていました。)
あと、kill(all); だけではmodulus は消えないようなので注意が必要かもしれません。
\begin{verbatim}
kill(all);	ユーザーが作成したもの（変数、関数、配列、ルールなど）を消去する。
reset();	システム側の設定（数値精度の設定や表示オプションなど）をデフォルトに戻す。
\end{verbatim}
場合によっては2行とも書いておけば安全という状況もあるかもしれません。

%\subsection{今まで入力した行の再利用(history,HISTORY)}
%MuPAD の Linux ターミナル版では、カーソルの上下キーを
%使えば、MuPAD セッションを始めてから今までに入力した行
%(いわゆるヒストリ) を呼び出して使うことができます。
%
%(この機能はとても有用で、MuPAD を本格的に使いたい方はこれ一つとっても
%Linux をインストールして Linux 版を使う価値があると思います。)
%
%MuPAD が覚えているヒストリの量は HISTORY という変数で決まっていて、
%デフォルトは 20 です。これでは少なすぎると感じる方は（私がそうでした)、
%\begin{verbatim}
%
%HISTORY:=100:
%
%\end{verbatim}
%などとして HISTORY の量を増やすと良いでしょう。
%ただしこれをするともちろん消費するメモリの量は増えてしまいます。
%
%ヒストリを直接操作するには history()という関数を使えばよいようです。
%詳しくは 
%\begin{verbatim}
%
%? history
%
%\end{verbatim}
%でご確認ください。
%\subsection{表示の幅を変更する(TEXTWIDTH) }
%mupad は 75行を目安に行を区切って表示するため、
%大きな行列の計算等を行った結果を表示する際に見にくくなってしまいます。
%そのようなときには kterm や rxvt などの大きさを大きくして、
%さらに TEXTWIDTH を大きめに設定してやれば良いでしょう。
%
\subsection{バッチ処理を意図的に止める(error)(邪道?)}

maxima のバッチ処理を途中で意図的に止めたいときがあります。
その場合は
\begin{verbatim}
error(0);
\end{verbatim}
など、error 行を書いておけば良いかもしれません。(邪道?)
asir でいうと end\$ 行であるとか、C(++)でいうと return(0); であるとか、
それに当たるものがほしいところです。とりあえず土基は error 使ってみてます。

\subsection{maxima の出力の形式(見かけ)を変える (display2d:)}
maxima はべき乗や行列をできるだけ見栄えよく出力しようとしますが、
場合によってはこれがあだになります。(カットアンドペーストなどで
maxima の出力をあらためて入力したい時など。)
そのような時には
display2d という変数を false にするとよろしい。
\begin{verbatim}
display2d: false;
\end{verbatim}

\subsection{(La)TeX 的な出力(tex())}

\begin{verbatim}
A:=...;
tex(A);
\end{verbatim}
などなど。

多分 前小節のdisplay2d を false にするやり方のほうが有用な気がします。

*このごろは tex より latex の方が世間的に(検索する際もseo対策的な意味で)通じやすいような気がするので latex をオモテに出したセクションのタイトルにしていますが、まあほんとうは tex ですね。

\section{計算}
\subsection{文(;)}
Maxima で何かを計算させるには、まず文の終りの記号(;)を覚えることが必要です。
\begin{verbatim}

3+4;

\end{verbatim}
と打ち込んで、Enterを押すと、
 $3+4$ が計算できます。これぐらいなら暗算のほうが速いので、
満足できないという向きには、$100$ の階乗などはいかがでしょうか？
\begin{verbatim}

 100!; (Enter を押す)

93326215443944152681699238856266700490715968264381621468592963895217599993\
22991560894146397615651828625369792082722375825118521091686400000000000000\
0000000000

\end{verbatim}
これが一瞬で出てくるのだからなかなか素晴らしいでしょう。

実は、文の終り方にはもう一つ方法があります。"\$" で終る方法です。
これは、「計算はしなきゃいけないけれどもした結果を出力はしなくてよい」
ときに使います。

そんなことがあり得るのでしょうか?その代表的な例が、次の節で述べる「値の設定」
です。
\subsection{値を設定(代入)(:)}
変数 $x$ に値を設定するには、":" という記号を用いて、
\begin{verbatim}

x:10;

\end{verbatim}
などとします。

\subsection{maxima に黙って計算させる(\$)}
前節の例のように、
\begin{verbatim}

x:10;

\end{verbatim}
と ";" で終ると、maxima は御丁寧にも "10" という値を
返してきますから、それがうっとうしいような場合には、
\begin{verbatim}

x:10$

\end{verbatim}
とやればよいのです。 maxima は黙って $x$ に $10$ を代入してくれます。

\subsection{定義を解除する。(kill)}
Xに 10 という値を一旦代入してみたけど、やっぱり $X$ はただの変数として
使いたい、というときには、kill というのを使います。

\begin{verbatim}
X:10;
kill (X);

\end{verbatim}

\subsection{関数を定義する(:=, define)}
\begin{verbatim}

f(x):=x^2; 
g(x,y):=x^2+y^2-1;

\end{verbatim}
などなど。

define も使えるようですが、そっちは土基はあんまり使っていません。
(つまり詳しくありません。)

とりあえず
\htmladdnormallink{wikibooks の記述へのlink を貼っておきます}
{https://ja.wikibooks.org/wiki/Maxima/関数を定義する}
詳しくはそちらにどうぞ。
\subsubsection{引数の変数,引数でない変数}
\begin{itemize}
\item
関数の変数としては引数の変数と引数でない変数のどちらも使えます。

\item
 引数でない変数を関数で使う際には、その変数の値については関数実行時の maxima の状況が使われるようです。
\item
 引数の変数を関数で使う際には、その変数の値については関数実行時の
 maxima の状況に関係せず実際に与えた引数の値が使われます。

\end{itemize}

例:
\begin{verbatim}
f(x):=print([x,y]);


f(3);
(%o1)
	[3,y];

x:5;
y:4;
f(3);
(%o2)
	[3,4];

kill(y);
f(3);
(%o3)
	[3,y];


\end{verbatim}



\subsection{さまざまな演算(+,-,*,/,＾,sqrt,exp,log,cos,sin,\%pi,\%e,\%i)}
ここでは基本的なものについてずらずら列挙するにとどめましょう。
\begin{verbatim}

四則演算
x+y    x と yの和
x-y    x と yの差
x*y    x と yの積
x/y    x を yで割った商(一般には分数)
主な関数
x^y    x の y乗
sqrt(x)  x の平方根
exp(x)   x の指数関数 
log(x)    x の自然対数
cos(x)   余弦関数
sin(x)   正弦関数

定数
%pi       円周率 
%e        自然対数の底
%i        虚数単位
\end{verbatim}
\subsection{整数の演算(divide,mod,quotient,gcd,factorial,binomial,next\_prime)}
\begin{verbatim}
divide(x,y)				x を y で割った商と余りのリスト
mod(x,y)        			x を y で割った余り
quotient(x,y)				x を y で割った商
inv_mod(x,y)				x の mod y での 逆元
gcd(a,b)				a,b の最大公約数
n!  (factorial(n) と書いてもよい)	n の階乗   
binomial(n,r)				二項係数  
next_prime(n)				n より大きい最小の素数
\end{verbatim}
\subsection{クロネッカーのデルタ (kron\_delta)}
\begin{verbatim}
kron_delta(i,j)
i=j のとき1, そうでないとき0
i,j としては配列もつかえる。

(%i27) kron_delta([1,2],[1,2]);
(%o27)                                 1
(%i28) kron_delta([1,2],[1,3]);
(%o28)                                 0

\end{verbatim}
\subsection{整数に丸める(entier, ceiling,floor)}
\begin{verbatim}
floor(x)
entier(x)	x 以下の最大の整数
\end{verbatim}
Maximaのコンテキストでは、floor と entier は同じ動作をします。
どちらを使っても結果は同じです。
\begin{verbatim}
ceiling(x)	x 以上の最小の整数
\end{verbatim}

\subsection{約数(divisors)}
\begin{verbatim}

divisors(15)	15 以下の最大の整数

 {1, 3, 5, 15}

\end{verbatim}

\subsection{素数関連(next\_prime,primep)}
\begin{verbatim}

primep(n)      n が 素数ならば TRUE を、そうでなければ FALSE を返す。

next_prime(n)   n 以上の最小の素数。

\end{verbatim}

\subsection{乱整数(random)}



乱整数を発生するには random を使います。

\begin{verbatim}

random(n)     /* 0 から n までの乱数(整数)を発生 */

\end{verbatim}

\subsection{分母(denom)、分子(num)}
分数の形の答えがでてきたときなどに、役立つかもしれません。
\begin{verbatim}
denom(f)  /* f の分母 */

num(f)  /* fの分子 */

\end{verbatim}


\subsection{複素数の演算(realpart,imagpart,abs,carg)}
Maxima は複素数もかなり器用に扱えます。


\begin{verbatim}

%i	 虚数単位
realpart(z)    zの実部
imagpart(z)    zの虚部
abs(z)   zの絶対値
carg(z)   zの偏角
\end{verbatim}

Maxima はオイラーの公式なども知っているので、複素数のexp,cos,sin等も
気がねなしに使えます。
\begin{verbatim}

 realpart(exp(1+%i));

			    %e cos(1)

\end{verbatim}

複素数 $z$ に対する対数も Maxima では計算できます。
\begin{verbatim}

 realpart(log(1+%i));
                                    log(2)
                                    ------
                                      2


\end{verbatim}

定義はつぎの通りです。
$$
\log(z)=\log(|z|)+(\text{ $z$ の偏角 })\times \% i 
$$

但し、偏角 $ \theta$ の範囲は $ -\pi<\theta \leq \pi$ です。


\begin{verbatim}

       float(log(-1));
                             3.141592653589793 %i
       float(log(-1-0.1*%i));
                  .004975165426583965 - 3.041924001098631 %i
       float(log(-1-0.0000000000000000001*%i));
                            - 3.141592653589793 %i

\end{verbatim}


%\subsubsection{仮定する(assume, unassume)}
%例えば、$a,b$ が実数のとき、$(a+b \sqrt{-1})^5$ の実部、虚部を
%計算したいとします。このようなときには MuPAD に、$a,b$ が実数であると
%仮定させて、Re, Im を用いればよろしい。
%
%\begin{verbatim}
%assume (a, Type::Real); // a は実数と仮定
%assume (b, Type::Real); // b も実数と仮定
%z:=(a+b*I)^5;
%Re(z);  // z の実部
%Im(z);  // z の虚部
%
%\end{verbatim}
%
%という具合です。
%
%仮定を解除したい場合には、unassume を使います。
%
%\begin{verbatim}
%
%unassume (a); // a についての仮定を解除
%
%\end{verbatim}
%
%
%
\subsection{式を簡単にする}
\subsubsection{式を展開する(expand)}
前節までの説明だけで、多分簡単な式の計算などは自由にできると思いますが、
一つだけ覚えておきたいのは、expand という命令です。
これは、与えられた式を展開して、簡単にします。
例えば、$(x+y)^2$ は、そのままでは、
\begin{verbatim}

(x+y)^2;
                                        2
                                 (x + y)

\end{verbatim}
と、この形のままで処理しようとしますが、expand を使うと、
次のように展開してくれます。
\begin{verbatim}

expand((x+y)^2);

                                       2    2
                              2 x y + x  + y

\end{verbatim}
expand が有効なのは文字式だけではありません。
例えば、
\begin{verbatim}

x:(1+sqrt(5))/2;
y:(1-sqrt(5))/2;

\end{verbatim}
としたあと、$xy$ を計算しようとして、x*y を入力すると、
\begin{verbatim}

 x*y;

                   (1 - SQRT(5)) (SQRT(5) + 1)
                   ---------------------------
                                4


\end{verbatim}

という具合になり、歯がゆい思いをすることになります。
こういうときは、expand を用いてやればいいのです。
\begin{verbatim}

 expand(x*y);       

                                    -1

\end{verbatim}
ああすっきり。

\subsubsection{特定の変数について整理する(collectterms)}

\begin{verbatim}

collectterms(f,x)

\end{verbatim}
で f を xについて整理できます。
\begin{verbatim}

collectterms(f,x,y,z)

\end{verbatim}
のように多変数についても同様に使えます。



%\subsubsection{根号のある式を簡単にする(radsimp)}
%
%\subsubsection{分数を通分してまとめる(normal)}
%
%\subsubsection{分数の分母(denom)、分子(numer)}
%
%
%\subsection{関数(fun, func, proc)}
%MuPAD の古いバージョンでは、関数を使うには三つの方法がありました。
%\begin{enumerate}
%\item fun
%\item func
%\item proc
%\end{enumerate}
%MuPAD 2.0 以降では fun と func は廃止されて、
%proc 一本になっています。
%
%
%\subsubsection{fun(古い)}
%fun は関数を記述するもっとも基本的な方法で、
%変数は args(1), args(2),... というふうに固定されています。
%
%\begin{verbatim}
% f:= fun(sin(args(1)^2 + args(2)^2)): f(x, y);
%
%      sin(x^2 + y^2)
%
%\end{verbatim}
%
%block 文を使えば1行で書くには難しい関数を書くこともできますが、
%このようなときには普通 proc を使った方がいいでしょう。
%
%
%
%\subsubsection{func(古い)}
%fun では変数名が固定されていたのに対して、
%func を使えば関数の変数名を自分で決めることができます。
%
%例えば $n$ の関数 $f(n)$ を定義するには、次のようにします。
%\begin{verbatim}
%
% f:=func((x^n+y^n-2)/4,n);
%
%\end{verbatim}
%
%つぎのように、$f(3)$ がちゃんと計算できていることを確かめられます。
%\begin{verbatim}
%
% f(3);
%
%                                3    3
%                               x    y
%                               -- + -- - 1/2
%                               4    4
%
%\end{verbatim}
%\begin{verbatim}
%
%x:=3+2*sqrt(2);
%y:=3-2*sqrt(2);
%
%\end{verbatim}
%としてから、
%\begin{verbatim}
%
%expand(f(3));
%
%\end{verbatim}
%とやってやると、答え $49$ が求まります。
%(expand を忘れると、
%\begin{verbatim}
%
%                            1/2 3       1/2     3
%                    (3 - 2 2   )    (2 2    + 3)
%                    ------------- + ------------- - 1/2
%                          4               4
%
%\end{verbatim}
%となってしまうので注意。)
%
%なお、$f$ を3変数 $(n,x,y)$ の関数として定義するには、
%\begin{verbatim}
%
% f:=func((x^n+y^n-2)/4,n,x,y);
%
%\end{verbatim}
%としてやればよいわけです。
%\subsubsection{proc}
%「手続き」(procedure) を定義するには proc をつかいます。
%(C言語などでいうところの「関数」に近いものです。)
%
%proc のなかでは local 変数(proc の中のみで通用する一時的な変数)が使えます。
%書式は次の通り。
%\begin{verbatim}
%proc(変数名)
%local (local変数名);
%...
%...
%begin
%...
%...
%...
%...
%end_proc:
%
%\end{verbatim}
%
%どういうわけか local 宣言は ";" で終らせる必要がある
%(":" で終らせることはできない)ようです。
%
%\begin{verbatim}
%f:=proc(x,y,z)
%local l; 		// l は local 変数
%begin
%l:=x^2+y^2+z^2:
%return(sqrt(l)):            //sqrt(l) を返す
%end_proc:
%
%\end{verbatim}
%\subsubsection{ proc の省略したかきかた(``→'')}
%proc は便利ですが、書くのが面倒です。
%そこで、簡単な関数については ``\verb+->+'' という記号を用いた
%略記法を用いるとよいでしょう。(キーボードの「マイナス」の記号に
%つづけて「大なり」の記号を打ちます。
%たとえば、
%\begin{verbatim}
%
%f:=x -> log(x)
%
%\end{verbatim}
%とやれば、$f(a)=log(a)$ となります。
%
%
\subsection{代入・置換(subst)}

代入・置換は subst を使って行います。
たとえば、

\begin{verbatim}

p:x^2+y^2+z^2;
                                2    2    2
                               x  + y  + z


subst(3,x,p);   /* p の x を 3 に置き換える (つまり x=3 を pに代入) */

                                 2    2
                                y  + z  + 9

\end{verbatim}

という具合です。

最近ネットで発見しましたが、もっとわかりやすい書き方があるようです。
上の例で言えば
\begin{verbatim}

p:x^2+y^2+z^2;
                                2    2    2
                               x  + y  + z


subst([x=3],p);   /*  x=3 を pに代入 */

                                 2    2
                                y  + z  + 9


/* のような書き方です。複数の代入を一度にこなすのも易しく、 */
subst([x=3,y=4],p);   /* x=3,y=4 を pに代入 */

                                2
                               z  + 25
/* など。 */

\end{verbatim}
次の書き方も応用が効きやすいでしょう。

\begin{verbatim}
eq1:x=3;
eq2:y=4;
subst([eq1,eq2],x^2+y^2+z^2);
/* もしくは等式  eq1,eq2 を上のように定義したあと*/ 
eq:[eq1,eq2];
subst(eq,x^2+y^2+z^2);

\end{verbatim}
さんくす、ネットの方々。

%みたいなことができます。まさに「単純な置き換え」ですね。
\subsection{代入して結果を計算する(ev)}
subst ではなく ev (evaluate) 関数を使うと、評価の順番を制御できます。ev は、指定された代入ルールを適用した後に式全体を評価します。
(google AI さんに教えてもらいました。)

書式としては
ev(評価したい式, 代入ルール) 
という順番になります。(subst とは順番が「逆」)

subst と比べると、 ev のほうが私の「代入」という感覚に近く感じました。(あくまで土基の主観です。)


記号は適切ではない(私的なものに過ぎない)ですが:

B()が複雑な場合、ev(B(2), S) は S の環境下で B(2) を展開・評価しますが、b2:B(2); ev(b2, S) のようにb2という変数に途中下車すると 標準環境で展開しきった b2 に対して後から S を適用する ため、特に B(x) が条件分岐や評価制御命令を含む場合に結果が異なります。
(わたしの計算例ではsubst(S,B(2)) ではわたしが期待した結果が出ました。
違いがあることには注意が必要かもしれません。)

at というのもあるらしい。要研究。

\subsection{近似計算(float)}
Maxima では、$\sqrt{2}$ などは、「二乗して2になるモノをあらわす記号」として
扱われますから、そのおおよその値を知るにはとくべつな
関数(float)を用いる必要があります。
\begin{verbatim}

 float(sqrt(2));

                                1.414213562


\end{verbatim}
三角関数の値などでも同様です。
\begin{verbatim}

 sin(1);

                                  sin(1)
 float(sin(1));

                               .8414709848

\end{verbatim}
%
%\subsubsection{近似計算の精度をかえる(DIGITS:=...)}
%近似計算の精度は DIGITS という変数の値をかえることによって
%かえられます。
%DIGITS の初期値は10で、これは有効数字10桁で計算してくれるという意味です。
%
%\begin{verbatim}
%DIGITS:=1000:
%float(sqrt(2)); //2 の平方根を1000桁計算
%1.414213562373095048801688724209698078569671875376948073176679737990732478\
%46210703885038753432764157273501384623091229702492483605585073721264412149\
%70999358314132226659275055927557999505011527820605714701095599716059702745\
%34596862014728517418640889198609552329230484308714321450839762603627995251\
%40798968725339654633180882964062061525835239505474575028775996172983557522\
%03375318570113543746034084988471603868999706990048150305440277903164542478\
%23068492936918621580578463111596668713013015618568987237235288509264861249\
%49771542183342042856860601468247207714358548741556570696776537202264854470\
%15858801620758474922657226002085584466521458398893944370926591800311388246\
%46815708263010059485870400318648034219489727829064104507263688131373985525\
%61173220402450912277002269411275736272804957381089675040183698683684507257\
%99364729060762996941380475654823728997180326802474420629269124859052181004\
%45984215059112024944134172853147810580360337107730918286931471017111168391\
%658172688941975871658215212822951848847
%
%\end{verbatim}
\section{有限リスト}
\subsection{有限列の操作(length,append,cons 等)}
有限列とは、幾つかのモノをカンマで区切って並べたものです。
例えば

\begin{verbatim}
4,1,2,6,4,1,2,6
\end{verbatim}

(数の列)や

\begin{verbatim}
X,J,A,P,A,N
\end{verbatim}

\begin{verbatim}
HEY,HEY,HEY
\end{verbatim}

(変数の列) など。その他にもいろいろなものを並べられます。

このあたりは「リスト」とも呼ばれて色々な文献(やネットに書いてありますから、
そちらをご覧になるとよいかと思います。


%\subsubsection{有限列を変数に代入する。}
%有限列を変数に代入する時は、紛れを避けるために、丸括弧で括って、
%
%\begin{verbatim}
%S:=(X,J,A,P,A,N);
%\end{verbatim}
%
%とすればよいでしょう。
%上のように $S$ を定義した後、$S,T$ の内容をみると
%\begin{verbatim}
% S,T;
%
%                            X, J, A, P, A, N, T
%
%
%\end{verbatim}
%とカンマの次に一つモノ(T)がつけ加わっていることが分かります。
%\subsubsection{列の要素を取り出す(op)}
%\begin{verbatim}
%S:=(X,J,A,P,A,N);
%\end{verbatim}
%として、\verb+S+ の二番目の要素を取り出すには、角括弧をもちいて、
%\verb+S[2]+ などとします。
%\begin{verbatim}
%S[2];
%\end{verbatim}
%
%\verb+op+ という演算子を使っても同じことができます。
%\begin{verbatim}
%op(S,2);//  S の 2番目の成分を取り出す。
%
%                                     J
%
%\end{verbatim}
%などなど。
%\subsubsection{列の長さ(nops)}
%列の長さ(成分の数)は \verb+nops+ という演算子で求められます。
%
%\begin{verbatim}
%S:=(X,J,A,P,A,N);
%
%
% nops(S);
%
%                                     6
% 
%\end{verbatim}
%
%
%
\subsection{有限リストの簡単な書き方(makelist)}
例えば $1$ から $10$ までの有限列が欲しい時に、いちいち
$$
[1,2,3,4,5,6,7,8,9,10]
$$
と入力するのは面倒です。Maxima では、これの代わりに、

\begin{verbatim}
makelist(i ,i ,1,10)
\end{verbatim}

と書くことができます。
もちろん
\begin{verbatim}

makelist(float(sin(i)),i,1,10); /* sin(1) から sin(10) までの概数を計算 */

 [.8414709848078965, .9092974268256817, .1411200080598672, 

- .7568024953079282, - .9589242746631385, - .2794154981989259, 

.6569865987187891, .9893582466233818, .4121184852417566, - .5440211108893698]

\end{verbatim}
のようなこともできます。


\subsection{有限列の和(sum)や積(product)}
\begin{verbatim}
/* f(i) を iが 1から100で和をとる。*/
sum(f(i),i,1,100); 
\end{verbatim}
%などなど。
%\subsection{リスト}
%有限列を角括弧 \verb+ [ ]+ で括ったものがリストです。
%列との一番の違いは階層化ができるかどうかという所でしょう。
%\begin{verbatim}
%
%[[1,2],[3,4],[5,6]]
%
%\end{verbatim}
%などの「リストのリスト」を考えることができるわけです。
%
%この性質を利用して、MuPAD ではリストを行列やベクトルの表現にも使っています。
%
%有限列の方で同じことをしようとすると、
%\begin{verbatim}
% ((1,2),(3,4),(5,6));
%
%                             1, 2, 3, 4, 5, 6
%
%\end{verbatim}
%となって、単に並んだ列が得られます。これはこれでうまく使えば便利です。
%
%
%\subsection{有限集合}
%有限集合は数列を \verb+{ } + で括ればよろしい。
%集合は列と違って、
%\begin{itemize}
%\item 要素の並び方を変えても同じ集合とみなす。
%\item 要素が重複している時は同じ要素は一つと考える。
%\end{itemize}
%という性質があります。つまり、
%\begin{verbatim}
%
%{1,2,3,4}={1,2,3,3,4}={2,1,3,4,1}
%
%\end{verbatim}
%
%等々という具合です。
%\subsection {リストや集合のなかから元を取り出してならべる(＄...in...)}
%$$
%S=\{2,3,4,6,12\}
%$$
%に対して、
%$$
%T=\{\pi/k ; k \in S\}
%$$
%を考えたいとき、あるいは、リストで、
%$$
%L=[\pi/2, \pi/3, \pi/4, \pi/12 ]
%$$
%を考えたいときがあります。このようなときには \verb+ in + というのをつかって、
%
%\begin{verbatim}
%S=[2,3,4,12];
%T:={float(PI/k)  $ k in S};
%L:=float(PI/k)  $ k in S;
%\end{verbatim}
%とやればよいでしょう。
%
%
\section{ループなどの制御}
%詳しくは MuPAD のディレクトリの share/demo/ 以下にあるファイルを
%ご参照ください。
%
%
%
\subsection{if 文}
\begin{verbatim}
if (条件文) then ... else ...
\end{verbatim}

条件分には例えば次のようなものがあります。
\begin{verbatim}
x = y                  xとyが等しいか
x # y                  xとyが異なっているか
x > y                  xがyより大きいか
x >= y                 xがy以上であるか
x < y                  xがyより小さいか
x <= y                 xがy以下か
\end{verbatim}


\subsection{for 文}

$i$ を(初期値)から(終り値) まで１ずつ増やして繰り返すには
\begin{verbatim}
for i : (初期値) thru (終り値) do
...;
\end{verbatim}

$i$ を(初期値)から(終り値) まで増分 k で変えて繰り返すには
\begin{verbatim}
for i : (初期値) thru (終り値)  step k do ...;
\end{verbatim}

(リスト)に含まれる $i$ に対して繰り返すには 
\begin{verbatim}
for i in (リスト) do ...;
\end{verbatim}

\subsection{do 文}
do () ; で () 内のことをずっと繰り返せます。
例えば
\begin{verbatim}
 do (print("aa"));
\end{verbatim}
とやると aa をずっと打ち続けます。
(Control-C で止まりますが、普段使う際は block や if を組み合わせるとよいでしょう。
\subsection{block と return}
for 文の do 以下には一つの命令しか書けないような気がします。
ここで登場するのがblock.
(もちろん block はよそでも使えます。)
\begin{verbatim}

block(式1, 式2, 式3, ...,最後の式);

\end{verbatim}
という一文を書くことで、式1,式2 を順に値を求める(実行させる)ことができます。
返り値は最後の式の値です。

local な変数(block 文の中だけで通用する変数)を使うこともできます。
\begin{verbatim}

block([変数1,変数2,...],式1, 式2, 式3, ...,最後の式);

\end{verbatim}
という具合です。

block 文の途中で終了したい場合は、return を使うといいようです。
block 文の返り値は return文の中の値になります。

\section{多項式}

\subsection{係数 (coeff,ratcoeff)}
$x$ の多項式 $f(x)$ に出てくる $x^n$ の係数を求めるには
\begin{verbatim}

coeff (f,x,n);

\end{verbatim}
とすればよろしい。例えば:
\begin{verbatim}

f: x^3+2*x;
coeff (f,x,1);
2

\end{verbatim}
などなど。
\begin{verbatim}

coeff(f,x^n);

\end{verbatim}
のほうが可読性が少しあがることもあるので使い勝手がよく感じられることがあるかもしれません(間違った結果を与えることも多くなってしまうので推奨しません。理由は google aimode さんに聞いてみてください。)

いずれにしても、f にあたるところは事前に expand しておかないと期待した結果とは異なる値(多くの場合0)が返ってくるので注意。

aimode さんに聞くと ratcoeff のほうが良いそうな...

\subsection{多項式の割り算(divide),商(quotient),余り(remainder)}
多項式 $f$ を $g$ で(変数VARに関して)割ったときの
商と余りは divide によって求めることができます。(VAR は明確なときは省略可能。)

\begin{verbatim}
書式:

divide(f,g, VAR);

返り値:

[商, 余り]

例:

 divide(x^2+y^2-1,y-m*(x-1),y);
                           2       2      2      2
           [y + m x - m, (m  + 1) x  - 2 m  x + m  - 1]

\end{verbatim}

商だけ取り出したいなら \verb|divide(f,g)[1]| もしくは
\verb|quotient(f,g)|,
あまりだけ取り出したいなら \verb|divide(f,g)[2]| 
もしくは \verb|remainder(f,g)| 
のようにすればよいです。



\subsection{多項式の因数分解(factor)}
多項式の因数分解には factor を使います。
\begin{verbatim}
 factor(x^5-1);

                                 4    3    2
                       (x - 1) (x  + x  + x  + x + 1)
\end{verbatim}
\subsection{法を定める(modulus), modulus(もしくは指定した整数)を法とした多項式(polymod)}
変数 \verb|modulus| の値を素数に設定することで、
$\mathbb{Z}/\text{modulus} {\mathbb {Z}}$ での因数分解を
することができます。
\begin{verbatim}
 modulus:5;
                                5

 factor(x^5-x);

                       (x - 2) (x - 1) x (x + 1) (x + 2)
\end{verbatim}

polymod() は与えた多項式をmodulus を法とした係数の多項式に直します。
(${\mathbb{Z}}$ 係数から ${\mathbb{Z}} /\text{modulus} {\mathbb{Z}}$係数へ。)
\begin{verbatim}

modulus:5;
                                5

polymod(73*x^2+19*x+11);
                                     2
                                - 2 x  - x + 1
\end{verbatim}



\verb|polymod(多項式p,法m)| と、法をその都度与えることも可能です。
(簡単に言えば $p$ の各係数を $m$ で割った余りを係数に持つ多項式です。)

\verb|modulus| を設定したくなくなった場合には、その値を \verb|false| にします。
\begin{verbatim}
 modulus:false;
	  	false
 factor(x^5-x);
                                             2
                         (x - 1) x (x + 1) (x  + 1)
\end{verbatim}

\subsection{(注意):expt(a,b)とは}

maxima に計算させると expt という表示が出てくる場合があります。

expt(a,b) とは $a^b$ のことです。
(maxima の出力にだけ現れて、入力には使えません。)

expt という関数を定義して使おうとすると混乱する(土基だけかもしれぬが...)
ので注意が必要かもしれません。

\section{有理式}

有理式(分数式)も使えます。

\subsection{分子 (num),分母(denom)}



\subsection{グレブナ基底}

まず 
\begin{verbatim}

load(grobner);

\end{verbatim}
してgrobner パッケージをロードします。

\begin{verbatim}

VARS:[r1,r2,r3,f1,f2,f3];

\end{verbatim}
などとして関係する変数を列挙します。と同時に、グレブナ基底の計算の際に特別の意味を持つ、変数の順序を決定します。

あとは, $L$ にイデアルの生成元のリストを定義して、
\begin{verbatim}

poly_grobner(L,VARS);

\end{verbatim}
とやれば、Lで生成されるイデアルのグレブナ基底が基底が求まります。

ちょっと続けてみましょう。
\begin{verbatim}

B:poly_grobner(L,VARS);
poly_normal_form(f,B,VARS);

\end{verbatim}
とやれば、Lで生成されるイデアルのグレブナ基底が基底を Bと置いて、
$B$ に関して $f$ を「割ったあまり」が poly\_normal\_form として求まります。

poly\_normal\_form は定数倍の差を除いてしか答えを出さないこともあるようです。
\subsubsection{/R/}
/R/ (Canonical Rational Expression / 有理形式)
意味: 多項式の比（有理式）として最適化された形式です。
発生タイミング: rat() 関数を使用したときや、grobner パッケージでの計算、fullratsimp() を実行したときなどに表示されます。
これを取り去るには \verb|ratdisrep| を使えば良いらしい。

\section{微積分}
\subsection{微分(diff)}
$f(x)$ を $x$ で微分する際には、

\begin{verbatim}

diff(f(x),x);

\end{verbatim}
とやればよろしい。
\begin{verbatim}

diff(sin(x),x);

                                  cos(x)

\end{verbatim}
\begin{verbatim}

diff(sin(x),x,2);    	/* x で sin(x) を二階微分 */

                                  -sin(x)

\end{verbatim}

\subsection{積分(integrate)}
\begin{verbatim}
integrate (sin(x),x); /*  sin(x)を x について不定積分 */

\end{verbatim}
\begin{verbatim}
integrate (sin(x),x,0,%pi ); /*  sin(x)を x について 0 から πまで定積分 */

\end{verbatim}


\subsection{テイラー展開(taylor)}

\begin{verbatim}
\taylor(exp(x),x,0,5));
                               2    3    4    5
                              x    x    x    x
     /T/              1 + x + -- + -- + -- + --- + . . .
                              2    6    24   120
\end{verbatim}
\subsubsection{/T/}
\verb|/T/| は
特定の変数のまわりで展開された「べき級数」であることを示します。
%テイラー展開を明示するための符号らしく、
これを取り去るには \verb|ratdisrep| を使えば良いらしい。
%これを取り去るには \verb|trunc| を使えば良いらしい。
%...が効果の程は今のところよくわからない。trunc を用いなくても
%式としてはmaxima でそのまま使える模様。


多変数も可能のもよう。
\begin{verbatim}
ratdisrep(taylor(exp(x+y),[x,y],[0,0],5));
                   2            2    3        2      2      3
                  y  + 2 x y + x    y  + 3 x y  + 3 x  y + x
      1 + x + y + --------------- + -------------------------
                         2                      6
    4        3      2  2      3      4
   y  + 4 x y  + 6 x  y  + 4 x  y + x
 + -----------------------------------
                   24
    5        4       2  3       3  2      4      5
   y  + 5 x y  + 10 x  y  + 10 x  y  + 5 x  y + x
 + ----------------------------------------------- + . . .
                         120

\end{verbatim}
%\subsection{積分(int)}
%$f(x)$ を $x$ で積分する際には、 $int$ を使って、
%\begin{verbatim}
%
%int(f(x),x);
%
%\end{verbatim}
%とやればよろしい。
%\begin{verbatim}
%
%int(x^3/(1+x^2),x);
%                                2       2
%                              x    log(x  + 1)
%                              -- - ----------
%                               2        2
%
%
%
%\end{verbatim}
%
%定積分もできます。例えば
%$$
%\int_{-1}^1 \frac{1}{x^2+1}
%$$
%を実行するには、
%
%\begin{verbatim}
%
%int (1/(x^2+1), x=-1..1); 
%
%                                    PI
%                                    --
%                                     2
%\end{verbatim}
%などとすればよろしい。
%
%\subsection{高階微分(diff と ＄との併用)}
%有限列を生成する＄記号と、diff や int を組み合わせれば、
%高階微分や多重積分を簡単に計算させることができます。
%\begin{verbatim}
%
% diff(x^100,x $ i=1..10);  // 10階微分
%
%                                               90
%                         62815650955529472000 x
%
%\end{verbatim}
%などなど。
%
\section{線型代数}
%\subsection{線型代数まわりの関数をエクスポートする(export(linalg);)}
%行列を扱うときには線型代数に使ういくつかの関数をあらかじめ
%エクスポートしておいた方が便利です。いろいろなことをする前に
%忘れずに
%\begin{verbatim}
%
%export(linalg);
%
%\end{verbatim}
%しておくとよいでしょう。
%\def\chuuiLinalg{これらの関数はlinalg パッケージに入っているので、
%もしあらかじめ export(linalg)していない場合には
%(たとえば trace ならば linalg::trace などのように)linalg:: を先頭にくっつけて
%やる必要があります。念のため。}
%
\subsection{行列の入力(matrix())}
行列をmaxima に入力してやるには、matrix を使います。
\begin{verbatim}
A:matrix([1,2],[3,4],[5,6]);
                                   [ 1  2 ]
                                   [      ]
                                   [ 3  4 ]
                                   [      ]
                                   [ 5  6 ]

\end{verbatim}

単位行列の何倍かを与えるには \verb+diagmatrix+ を使えます...がおすすめしません。
ident と diag\_matrix のほうが可読性がマシのような気がします。

\begin{verbatim}
 diagmatrix(3,x);
                                  [ x  0  0 ]
                                  [         ]
                                  [ 0  x  0 ]
                                  [         ]
                                  [ 0  0  x ]


\end{verbatim}

\subsection{転置行列(transpose)}

行列 $A$ の転置行列は transpose(A) で得られます。

\subsection{行列としての縦ベクトル、横ベクトルを入力する。(matrix() の注意。)}

横ベクトルは
\begin{verbatim}
matrix([1,2,3]);
\end{verbatim}

とやればいいので楽かと思います。

縦ベクトルは

\begin{verbatim}
matrix([1],[2],[3]);
\end{verbatim}

とやるのも一法ですが、transpose を用いて

\begin{verbatim}
transpose(matrix([1,2,3]));
\end{verbatim}

とやるほうが楽だと感じることもあるかもしれません。


\subsection{単位行列(ident)}
$n$ 次の単位行列を与えるには ident(n) を用います。

\begin{verbatim}
ident(3);
                                  [ 1  0  0 ]
                                  [         ]
                                  [ 0  1  0 ]
                                  [         ]
                                  [ 0  0  1 ]
\end{verbatim}

\subsection{対角行列(diag\_matrix)}
対角成分が $a,b,c$ であるような対角行列は
\verb+diag_matrix(a,b,c)+ を使えばよろしい。

\begin{verbatim}
       diag_matrix(3,4,5);
                                  [ 3  0  0 ]
                                  [         ]
                                  [ 0  4  0 ]
                                  [         ]
                                  [ 0  0  5 ]

\end{verbatim}

\noindent ※ diag\_matrix と diagmatrix (アンダースコアがついているかどうか)
は使用法が異なりますので注意が必要です。(diagmatrix(n,x)は n次のスカラー行列
(対角成分がすべて xの対角行列)の意味で使われます。)
個人的にはアンダースコアなしの diagmatrix は「有害だから名前を変えたらいいのに」ぐらいに思っています。


\subsection{行列を与える(genmatrix)}
行列を与えるのには genmatrix を用いるといいでしょう。
いくつかのオプションがあります。

\noindent その1 一般の係数の行列を作る。
\begin{verbatim}
genmatrix(a,3,4);
                        [ a      a      a      a     ]
                        [  1, 1   1, 2   1, 3   1, 4 ]
                        [                            ]
                        [ a      a      a      a     ]
                        [  2, 1   2, 2   2, 3   2, 4 ]
                        [                            ]
                        [ a      a      a      a     ]
                        [  3, 1   3, 2   3, 3   3, 4 ]

\end{verbatim}
もちろん、a のところを別の変数名にすることもできます。


\noindent その2 
行と列の式で書かれた行列を与える
予め2変数関数(下の例では h)を与えておいて、
genmatrix(h,サイズ) のようにすれば良い:
\begin{verbatim}
h[i,j]:=i+j;
                           h     := i + j
                            i, j
genmatrix(h,3,4);
                                [ 2  3  4  5 ]
                                [            ]
                                [ 3  4  5  6 ]
                                [            ]
                                [ 4  5  6  7 ]
genmatrix(h,3,4,0,0);  /* i,j の範囲はこのように変えられます。*/

                               [ 0  1  2  3  4 ]
                               [               ]
                               [ 1  2  3  4  5 ]
                               [               ]
                               [ 2  3  4  5  6 ]
                               [               ]
                               [ 3  4  5  6  7 ]
(%i8)


\end{verbatim}




\subsection{(行と列の式で書かれた行列を与える別法)(apply('matrix,)を利用する)}

あまり見慣れない記号アポストロフ ' を使うしちょっとむずかしいかもしれません。
とりあえず例を載っけておきましょう。 makelist をうまく使うと良いと思います。
\begin{verbatim}

apply('matrix,makelist(makelist(f(i,j),i,1,3),j,2,5));
                         [ f(1, 2)  f(2, 2)  f(3, 2) ]
                         [                           ]
                         [ f(1, 3)  f(2, 3)  f(3, 3) ]
                         [                           ]
                         [ f(1, 4)  f(2, 4)  f(3, 4) ]
                         [                           ]
                         [ f(1, 5)  f(2, 5)  f(3, 5) ]

\end{verbatim}

もちろん $f$ のところを具体的な関数に
変えれば色々できるところです。
たとえば $f$ として  \verb|kron_delta(i,j) * a(i) |
を与えれば対角行列をこの方法で与えることもできます。

\subsection{行列の演算(+,-, . ,invert )}
\begin{verbatim}
四則演算
A+B    A と Bの和
A-B    A と Bの差
A . B    A と Bの積
invert(A)    A の逆行列 
\end{verbatim}
\vskip\baselineskip

\subsubsection{
***危険な*** \dbend ***曲がり角***}

\vskip\baselineskip

 行列の乗法、逆行列には注意が必要です。(* や \verb+^(-1)+ を用いると
期待されるのと違う計算が行われます。)
もう一度:

行列 \verb+A+ と \verb+B+ の　積は \verb+A . B+です。
 行列 A の逆行列は 
\verb+invert(A)+ です。

さらに、行列のべき乗を計算するには、\verb+^^+ (タイプミスではなく、ハット記号を2つ並べて書く)を用いる必要があるので、ムチャグチャ注意が必要です。



\begin{verbatim}
A ^^ 2	 Aの2乗。
A ^^ 3	 Aの3乗
\end{verbatim}


マニュアルより:
\begin{verbatim}
- "."は行列(非可換)乗法向けのDOT演算子である。
"."がこの意味で使われる場合、
両側にA . Bの様にSpaceを入れておくべきである。
こうすると小数点との区別が明瞭 になる。
APROPOS(DOT);を実行すると
DOT演算子に影響を与えるスイッチのリストが 得られる。
\end{verbatim}

こんな説明では物足りないぐらい、とにかくご注意を。

\vskip\baselineskip

 危険な　曲がり角　終わり。

\vskip\baselineskip


\subsection{行列の行ベクトル(row) 、列ベクトル(col)}
行列 $A$ の $3$ 行目は
$$
row(A,3)
$$
で、$4$列目は
$$
col(A,4)
$$
でそれぞれ得られます。


%
\subsection{正方行列の諸量 (lengthもしくはmatrix\_size, determinant,charpoly,mattrace)}
\begin{verbatim}
A:matrix([1,2],[3,4],[5,6]);
                                   [ 1  2 ]
                                   [      ]
                                   [ 3  4 ]
                                   [      ]
                                   [ 5  6 ]
length(A);  /* 行数   */
3
length(A[1]); /* 列の数 */ 
2

matrix_size(A);
[3,2]

\end{verbatim}
行列は行ベクトルのリストとして実現されているようなので、 length 
を上のようにうまくつかえばサイズが求められます。


その他に:
\begin{verbatim}
determinant(A)		A の 行列式
charpoly(A,x)			A の特性多項式(変数をxとする。つまり=determinant(A-x* \ident(n))
mattrace (A)		A のトレース
\end{verbatim}

determinant は標準の関数ですが、
mattrace は load("nchrpl") してからでないと使えません。
\subsection{余因子行列(adjoint)}
A の余因子行列は adjoint(A) です。:
\begin{verbatim}
A:matrix([1,2,3],[4,5,6],[7,8,1]);
                                  [ 1  2  3 ]
                                  [         ]
                                  [ 4  5  6 ]
                                  [         ]
                                  [ 7  8  1 ]
adjoint(A);
                              [ - 43   22   - 3 ]
                              [                 ]
                              [  38   - 20   6  ]
                              [                 ]
                              [ - 3    6    - 3 ]
A.adjoint(A);
                                [ 24  0   0  ]
                                [            ]
                                [ 0   24  0  ]
                                [            ]
                                [ 0   0   24 ]
\end{verbatim}


\subsection{ランク(rank),対応する階段行列 (echelon)}
\verb|rank(A)| で  行列 A の階数がだせます。
行列 \verb|A| から 行基本変形で得られる階段行列は
\verb| echlon(A)|
で得ることができます。

\subsection{ブロック区分けされた行列を使う(addcol,addrow)}
(mupad ではstackmatrix とか concatmatrixとやるところのもの。)

縦への連結(row を並べる)は addrow(A, B)
つまり 
$$\text{addrow} (A,B)=
\begin{pmatrix}
A \\
B
\end{pmatrix}
$$、
横への連結(column をならべる)は addcol(A, B) です。つまり
addcol(A,B)=(A B)です。
(ここのところ、土基はすぐ間違えるます。
(お確かめの上、お使いください。)

\subsection{部分行列(submatrix)}
$A$ が行列のとき、 $summatrix(i_1,i_2,\dots i_s, A, j_1,j_2,\dots, j_t)$ は
$A$ から $i_1,\dots,i_s$ 行目と $j_1,\dots j_t$ 行目を全て消去してできる $A$の　部分行列をあたえます。



\subsection{Jordan の標準形関係 (dispJordan など)}
とりあえず例だけ置いときます。 詳細はググってください。。

\begin{verbatim}
load("diag"); 

U:dispJordan([[1,5]]);

                               [ 1  1  0  0  0 ]
                               [               ]
                               [ 0  1  1  0  0 ]
                               [               ]
                               [ 0  0  1  1  0 ]
                               [               ]
                               [ 0  0  0  1  1 ]
                               [               ]
                               [ 0  0  0  0  1 ]


\end{verbatim}

など。

\subsection{固有値、固有ベクトル(eigenvectors)}
\begin{verbatim}
eigenvectors(A);

\end{verbatim}
(A の固有値その重複度、固有ベクトルが一気に羅列されます。)

\begin{verbatim}
[[固有値1,固有値2,...],[固有値1の重複度,固有値2の重複度...]]
\end{verbatim}
という情報(リスト)がまず1つめに来て、次に
\begin{verbatim}
[[固有値1に属する固有ベクトルのリスト],[固有値2に属する固有ベクトルのリスト],[...],...[...]]
と続くようです。
\end{verbatim}



\section{微分形式をあつかう(Cartan パッケージ)}

\begin{verbatim}
if get('cartan,'version)=false then load("cartan");
(もしくは単に) load("cartan");

\end{verbatim}
としておいて cartan パッケージをload することでこの節の内容のことが行えます。

詳しくは \verb|load("cartan") | のあと \verb|demo(cartan)| すれば
詳しい解説が行われます。
\subsection{外微分するべき座標の指定(init\_cartan)}
\begin{verbatim}
	init_cartan([x,y,z]);	
\end{verbatim}
とすれば、座標関数 $x,y,z$に関する外微分を行えるようになります。
\verb| [dx, dy, dz]| が外微分のbasis ということになります。
\subsection{外微分の基底( cartan\_basis)}
外微分の基底の双対基底に関する成分のリストとしてtangent vector fieldを
使うことができます。

\begin{verbatim}
cartan_basis;
\end{verbatim}
と打つことで 現在の基底を知ることができます。


\subsection{外微分(ext\_diff)}
\subsection{内部積《contractionとも言う》($|$)}
\begin{verbatim}
my_vec:[1,0]; /* cartan_basis に関する  双対基底 での表示 */
my_vec| omega
\end{verbatim}
などなど。
\subsection{外積(〜)}
微分形式 a と b の外積は \verb| a ~ b | で扱えます。
\section{グラフの描画}
\subsection{平面上のグラフを描く(plot2d)}
平面上のグラフを描くには plot2d を用います。
\begin{verbatim}

plot2d(cos(x),[x,-1,1]) ;
/* cos(x) のグラフを $-1\leq x\leq 1$ の範囲で描く。 */

\end{verbatim}

たくさん描くこともできます。
\begin{verbatim}

plot2d([sin(x),cos(x)],[x,-1,1]); 
/* sin(x) のグラフと cos(x)のグラフを重ねて描く。 */

\end{verbatim}

\begin{verbatim}
 plot2d([parametric,cos(t),sin(2*t),[t,0,10],[nticks,1000]]);
\end{verbatim}


\subsubsection{折れ線グラフを描く(plot2d([discrete,...]))}
折れ線を描くには、次のような命令を使います。

\begin{verbatim}

 plot2d([discrete,list1]),numer;

\end{verbatim}

但しlist1 は点のリストです。makelist などを使えば上手に
使えるでしょう。 numer は、「数値的に扱うように」というmaximaのスイッチで、
グラフを描くときには必須と言っても良いでしょう。

例:(i=1,..500 についてi の約数の個数をリストし、プロットする。 
\begin{verbatim}

 list1:makelist([i,length(divisors(i))/i],i,1,500);
 plot2d([discrete,list1]),numer;

\end{verbatim}

あるいは、plot2d する前に計算結果に float をつけてもよろしい

\begin{verbatim}

 list2:makelist([i,float(length(divisors(i)))/i],i,1,500);
 plot2d([discrete,list2]);

\end{verbatim}


\subsubsection{折れ線グラフを描く(2)(openplot\_curves,xgraph\_curves)}

折れ線を描くには、次のような命令も使えます。
(tcl/tk の wish を外部コマンドとして使用します。)

\begin{verbatim}

openplot_curves([[x_1,y_1],[x_2,y_2],...,[x_n,y_n]]);

\end{verbatim}
\verb+[[x_1,y_1],[x_2,y_2],...,[x_n,y_n]]+ は点のリストで、
これを直接入力するのは実際には容易でないので、
makelist などを援用するとよいでしょう。




\begin{verbatim}

openplot_curves([makelist([i,float(length(divisors(i))/i)],i,1,500)]);


\end{verbatim}

xgraph がインストールされている場合には xgraph\_curves という命令も使えます。

\begin{verbatim}

xgraph_curves([makelist([i,float(length(divisors(i))/i)],i,1,500)]);


\end{verbatim}

\subsubsection{折れ線グラフや関数のグラフを重ねる}

例を示します。あとは類推してください。
本稿の折れ線グラフの例とlog(x)/x のグラフを並べたものです。

\begin{verbatim}

list1:makelist([i,float(length(divisors(i))/i)],i,1,500);
plot2d([log(x)/x,[discrete,list1]],[x,1,500]);

\end{verbatim}

関数を複数と折れ線も複数を並べることもできます。
(以下の例は例として以外にはそんなに面白い例ではありませんが...)

\begin{verbatim}
 list1:makelist([i,float(length(divisors(i))/i)],i,1,500);
 list2:makelist([i,float(length(divisors(i))/15)],i,1,500);
plot2d([log(x)/x,x/500,[discrete,list1],[discrete,list2]],[x,1,500]);
\end{verbatim}

\includegraphics[scale=1]{"2.png"}

%
%
%\subsection{陰関数のグラフ(plot::implicit)}
%(注意: plot::implicit は(筆者の記憶が正しければ)古いバージョンの MuPAD では
%命令が違ったはずです。そのような MuPAD をお持ちの場合には別途マニュアル等で
%ご確認下さい。)
%
%陰関数を描くには、 plot::implicit という命令を用います。
%ただし、plotfunc2d などと違って、 plot::implicit は画面にデータを
%書き出すのではなく、メモリ内に(多くの点の集まりとして)「描く」ので、
%目でグラフをみるためにはメモリ内のそれらのデータを
%画面に「描く」操作 (plot)をする必要があります。
%\begin{verbatim}
%
%plot(plot::implicit(x^2+y^2-1,x=-2..2,y=-2..2)); // 円を描く
%
%\end{verbatim}
%
%この例では、$x^2+y^2=1$ を満たす $(x,y)$ を、$-2\leq x\leq 2, -2 \leq y\leq 2$ 
%の範囲で見つけてきて、それを描画しています。
%$x,y$ の範囲を指定しないとエラーになってしまいますのでご注意を。
%
%\subsection{リストを折れ線グラフに描く(plot::data)}
%リスト \verb+ L=[10,20,30,50,-5] + などを折れ線グラフに描くには、
%
%\begin{verbatim}
%
%plot(plot::data(L));
%
%\end{verbatim}
%とすればよろしい。
%
%\subsection{2次元のグラフ (plot2d)}
%\subsubsection{曲線を書く(plot2d([Mode=Curve,[f(t),g(t)],t=[t0,t1])) }
%\subsubsection{折れ線(多角形)を書く(polygon)}
%正方形を描いてみましょう。
%\begin{verbatim}
%
%shikaku:=polygon(point(0,0),point(1,0),point(1,1),point(0,1),Closed=TRUE);
%
%plot2d([Mode=List,[shikaku]]);
%
%\end{verbatim}
%point(a,b) は二次元の点 $(a,b)$ をさし、上の例では
%それらを結んだ多角形として shikaku を定義しています。
%shikaku を plot2d に噛ませれば四角形が表示されるわけです。
%
%\subsubsection{たくさんの曲線を同時に描く}
%plot2d の引数にたくさん曲線のデータを並べれば、それで曲線を複数
%同時に描くことができます。
%\begin{verbatim}
%
%plot2d([Mode=Curve,[k*cos(t),k*sin(t)],t=[0,2*PI]] $ k=1..10);
%
%\end{verbatim}
%
%\subsubsection{描画する範囲を決める(ViewingBox=[xmin..xmax,ymin..ymax])}
%plot2d は、グラフのどこ( xy 平面上のどの部分)を描画するかを
%自動的に決定しますが、それがうまくない場合には、ViewingBox= なるオプションで
%指定します。
%
%\subsubsection{縦横の縮尺比をそろえる／そろえない(Scaling=Constrained/UnConstrained)}
%
%グラフの縦横の縮尺比をそろえるためには、Scaling=Constrained なるオプションを
%指定します。
%円や、正方形などの縦横の比が大事なものについては指定したほうがよいでしょう。
%
%
%
%\subsubsection{色,線の太さなど}
%描画の際、次のようなオプションを指定することができます。
%\begin{verbatim}
%LineStyle=DashedLines  //こう指定するとグラフが点線になる。
%FontSize=24, //文字の大きさ
%Labeling=FALSE, //座標軸に変数名を書くか否か
%ViewingBox=[0,0.3,0,0.3], //どの範囲を描画するか
%Axes=Origin,     // こう指定すると「座標軸」を描く。
%AxesOrigin=[0,0],  // 「座標軸」のまじわるところをどこにするか。
%LineWidth=50,    //線の太さ
%Color=[Flat,[r,g,b]]    //色の指定。r,g,b は [0,1] に収まらなければならない。
%\end{verbatim}
%
%
%
\subsection{3次元空間内のグラフ(plot3d)}
例を挙げるにとどめます。


\subsubsection{plot3dで曲面を描く}

2変数($u,v$) についての関数のグラフを書いてみましょう:

\begin{verbatim}
plot3d([u,v,u*v],[u,-2,2],[v,-2,2]);
\end{verbatim}

特別なケースとして、未使用の変数をあえて付け加えることで曲線もかけます。
\begin{verbatim}

plot3d([u,u^2,u^3],[u,-2,2],[v,-2,2]);

\end{verbatim}

\subsubsection{例題: 複素数変数指数関数 $\exp(z)$ のグラフ}
(実際には $\exp(z)$ の実部のみ。) $z$:複素数。
\begin{verbatim}

h1:exp(z);
h2:exp(z)*%i;
h3:z;
h4:z*%i;
/* z=u+ v i として実際にグラフを描いてみる。*/

declare(u,real);
declare(v,real);


/*代入 */

k1:realpart(subst(z=u+%i*v,h1));
k2:realpart(subst(z=u+%i*v,h2));
k3:realpart(subst(z=u+%i*v,h3));
k4:realpart(subst(z=u+%i*v,h4));

/* 描画 */

plot3d([k1,k3,k4],[u,-1,1],[v,-4,4]);
\end{verbatim}
\includegraphics[scale=1]{"3.png"}


\subsubsection{ちょっと四次元風に}
前小節のやつは exp(z) の実部だけだったので、虚部を変えるとどうなるかわかるように複数のグラフを並べてみました。
\begin{verbatim}
h1:exp(z);
h2:exp(z)*%i;
h3:z;
h4:z*%i;
/* z=u+ v i として実際にグラフを描いてみる。*/
/* 今回は (realpart(exp(z))+C*imagpart(z),z) (C=-1..4) の描画である。 */
declare(u,real);
declare(v,real);


/*代入 */

k1:realpart(subst(z=u+%i*v,h1));
k2:realpart(subst(z=u+%i*v,h2));
k3:realpart(subst(z=u+%i*v,h3));
k4:realpart(subst(z=u+%i*v,h4));

/* 描画 */

F:[k1+C*k2,k3,k4];
RANGE:[[u,-1,1],[v,-4,4]];

G1:[];

for j:-1 thru 4 do 
G1:append(G1,[subst([C=j],F)],RANGE);
done;
plot3d(G1);
\end{verbatim}

\includegraphics[scale=1]{"4.png"}

\section{if 文 につきものの property}

\subsection{integerp,numberp,primep}
\begin{verbatim}
integerp(x);
\end{verbatim}
と書けば x が整数のときtrue, そうでないとき false を返します。
if 文と組み合わせると使えるときもあるかもしれません。
\begin{verbatim}
primep(x);
\end{verbatim}
とやれば、x が素数のときだけ true を返すわけです。
このように、「なんとかp 」という関数がいくつかあります。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\section{GNU Free Documentation License}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{GNU Free Documentation License}
\begin{verbatim}
		GNU Free Documentation License
		   Version 1.1, March 2000

 Copyright (C) 2000  Free Software Foundation, Inc.
     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.


0. PREAMBLE

The purpose of this License is to make a manual, textbook, or other
written document "free" in the sense of freedom: to assure everyone
the effective freedom to copy and redistribute it, with or without
modifying it, either commercially or noncommercially.  Secondarily,
this License preserves for the author and publisher a way to get
credit for their work, while not being considered responsible for
modifications made by others.

This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense.  It
complements the GNU General Public License, which is a copyleft
license designed for free software.

We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does.  But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book.  We recommend this License
principally for works whose purpose is instruction or reference.


1. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work that contains a
notice placed by the copyright holder saying it can be distributed
under the terms of this License.  The "Document", below, refers to any
such manual or work.  Any member of the public is a licensee, and is
addressed as "you".

A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject.  (For example, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.)  The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.

The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.

The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.

A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, whose contents can be viewed and edited directly and
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters.  A copy made in an otherwise Transparent file
format whose markup has been designed to thwart or discourage
subsequent modification by readers is not Transparent.  A copy that is
not "Transparent" is called "Opaque".

Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML designed for human modification.  Opaque formats include
PostScript, PDF, proprietary formats that can be read and edited only
by proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML produced by some word processors for output
purposes only.

The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page.  For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.


2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License.  You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute.  However, you may accept
compensation in exchange for copies.  If you distribute a large enough
number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and
you may publicly display copies.


3. COPYING IN QUANTITY

If you publish printed copies of the Document numbering more than 100,
and the Document's license notice requires Cover Texts, you must enclose
the copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover.  Both covers must also clearly and legibly identify
you as the publisher of these copies.  The front cover must present
the full title with all words of the title equally prominent and
visible.  You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.

If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a publicly-accessible computer-network location containing a complete
Transparent copy of the Document, free of added material, which the
general network-using public has access to download anonymously at no
charge using public-standard network protocols.  If you use the latter
option, you must take reasonably prudent steps, when you begin
distribution of Opaque copies in quantity, to ensure that this
Transparent copy will remain thus accessible at the stated location
until at least one year after the last time you distribute an Opaque
copy (directly or through your agents or retailers) of that edition to
the public.

It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.


4. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it.  In addition, you must do these things in the Modified Version:

A. Use in the Title Page (and on the covers, if any) a title distinct
   from that of the Document, and from those of previous versions
   (which should, if there were any, be listed in the History section
   of the Document).  You may use the same title as a previous version
   if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities
   responsible for authorship of the modifications in the Modified
   Version, together with at least five of the principal authors of the
   Document (all of its principal authors, if it has less than five).
C. State on the Title page the name of the publisher of the
   Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
   adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license notice
   giving the public permission to use the Modified Version under the
   terms of this License, in the form shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections
   and required Cover Texts given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section entitled "History", and its title, and add to
   it an item stating at least the title, year, new authors, and
   publisher of the Modified Version as given on the Title Page.  If
   there is no section entitled "History" in the Document, create one
   stating the title, year, authors, and publisher of the Document as
   given on its Title Page, then add an item describing the Modified
   Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for
   public access to a Transparent copy of the Document, and likewise
   the network locations given in the Document for previous versions
   it was based on.  These may be placed in the "History" section.
   You may omit a network location for a work that was published at
   least four years before the Document itself, or if the original
   publisher of the version it refers to gives permission.
K. In any section entitled "Acknowledgements" or "Dedications",
   preserve the section's title, and preserve in the section all the
   substance and tone of each of the contributor acknowledgements
   and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
   unaltered in their text and in their titles.  Section numbers
   or the equivalent are not considered part of the section titles.
M. Delete any section entitled "Endorsements".  Such a section
   may not be included in the Modified Version.
N. Do not retitle any existing section as "Endorsements"
   or to conflict in title with any Invariant Section.

If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant.  To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.

You may add a section entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.

You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version.  Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity.  If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.


5. COMBINING DOCUMENTS

You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice.

The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy.  If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections entitled "History"
in the various original documents, forming one section entitled
"History"; likewise combine any sections entitled "Acknowledgements",
and any sections entitled "Dedications".  You must delete all sections
entitled "Endorsements."


6. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.


7. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, does not as a whole count as a Modified Version
of the Document, provided no compilation copyright is claimed for the
compilation.  Such a compilation is called an "aggregate", and this
License does not apply to the other self-contained works thus compiled
with the Document, on account of their being thus compiled, if they
are not themselves derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one quarter
of the entire aggregate, the Document's Cover Texts may be placed on
covers that surround only the Document within the aggregate.
Otherwise they must appear on covers around the whole aggregate.


8. TRANSLATION

Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections.  You may include a
translation of this License provided that you also include the
original English version of this License.  In case of a disagreement
between the translation and the original English version of this
License, the original English version will prevail.


9. TERMINATION

You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License.  Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License.  However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.


10. FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time.  Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.  See
http://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation.  If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.


ADDENDUM: How to use this License for your documents

To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:

      Copyright (c)  YEAR  YOUR NAME.
      Permission is granted to copy, distribute and/or modify this document
      under the terms of the GNU Free Documentation License, Version 1.1
      or any later version published by the Free Software Foundation;
      with the Invariant Sections being LIST THEIR TITLES, with the
      Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
      A copy of the license is included in the section entitled "GNU
      Free Documentation License".

If you have no Invariant Sections, write "with no Invariant Sections"
instead of saying which ones are invariant.  If you have no
Front-Cover Texts, write "no Front-Cover Texts" instead of
"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.

If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
\end{verbatim}
\section{Changes}
2025/09
Changelog  を書くのをやめました。
\end{document}

