Next: , Previous: Introduction to Series, Up: Sums Products and Series   [Contents][Index]

28.3 Functions and Variables for Series

オプション変数: cauchysum

デフォルト値: false

上限としてinfを持つ和同士を掛ける時、 もしsumexpandtrue、かつ、cauchysumtrueなら、 通常の積ではなくCauchy積が使われます。 Cauchy積では、 内側の和のインデックスは、独立に変化するのではなく、外側のインデックスの関数です。

例:

(%i1) sumexpand: false$
(%i2) cauchysum: false$
(%i3) s: sum (f(i), i, 0, inf) * sum (g(j), j, 0, inf);
                      inf         inf
                      ====        ====
                      \           \
(%o3)                ( >    f(i))  >    g(j)
                      /           /
                      ====        ====
                      i = 0       j = 0
(%i4) sumexpand: true$
(%i5) cauchysum: true$
(%i6) ''s;
                 inf     i1
                 ====   ====
                 \      \
(%o6)             >      >     g(i1 - i2) f(i2)
                 /      /
                 ====   ====
                 i1 = 0 i2 = 0
関数: deftaylor (f_1(x_1), expr_1, …, f_n(x_n), expr_n)

deftaylorは、 ある変数x_iの関数f_iそれぞれに関して、 expr_iをゼロの回りのTaylor級数と定義します。 expr_iは、典型的には、x_iの多項式か和です; deftaylorは、もっと一般的な式も問題なく受け付けます。

powerseries (f_i(x_i), x_i, 0)は、 deftaylorで定義された級数を返します。

deftaylorは、 関数f_1, ..., f_nのリストを返します。 deftaylorは、引数を評価します。

例:

(%i1) deftaylor (f(x), x^2 + sum(x^i/(2^i*i!^2), i, 4, inf));
(%o1)                          [f]
(%i2) powerseries (f(x), x, 0);
                      inf
                      ====      i1
                      \        x         2
(%o2)                  >     -------- + x
                      /       i1    2
                      ====   2   i1!
                      i1 = 4
(%i3) taylor (exp (sqrt (f(x))), x, 0, 4);
                      2         3          4
                     x    3073 x    12817 x
(%o3)/T/     1 + x + -- + ------- + -------- + . . .
                     2     18432     307200
オプション変数: maxtayorder

デフォルト値: true

maxtayordertrueの時、 (切り詰められた)Taylor級数の代数操作の間、 taylorは、厳密とわかっているできるだけ多くの項を保とうとします。

関数: niceindices (expr)

exprの中の和や積のインデックスを改名します。 niceindicesは、 その名前が被加数や非積数の中に現れないなら、 インデックスそれぞれをniceindicespref[1]の値に改名しようとします。 現れた場合、 niceindicesは、 未使用の変数が見つかるまでniceindicesprefの次の要素を順に試します。 もしリスト全部が使い果たされたら、 例えば, i0, i1, i2, ....というように、 niceindicespref[1]の値に整数を追加することで、 追加のインデックスが構成されます。

niceindicesは式を返します。 niceindicesは引数を評価します。

例:

(%i1) niceindicespref;
(%o1)                  [i, j, k, l, m, n]
(%i2) product (sum (f (foo + i*j*bar), foo, 1, inf), bar, 1, inf);
                 inf    inf
                /===\   ====
                 ! !    \
(%o2)            ! !     >      f(bar i j + foo)
                 ! !    /
                bar = 1 ====
                        foo = 1
(%i3) niceindices (%);
                     inf  inf
                    /===\ ====
                     ! !  \
(%o3)                ! !   >    f(i j l + k)
                     ! !  /
                    l = 1 ====
                          k = 1
オプション変数: niceindicespref

デフォルト値: [i, j, k, l, m, n]

niceindicesprefは、 niceindicesが和や積のインデックスの名前を取ってくる リストです。

The elements of niceindicesprefの要素は、 niceindicesによって強制されませんが、 通常、変数名です。

例:

(%i1) niceindicespref: [p, q, r, s, t, u]$
(%i2) product (sum (f (foo + i*j*bar), foo, 1, inf), bar, 1, inf);
                 inf    inf
                /===\   ====
                 ! !    \
(%o2)            ! !     >      f(bar i j + foo)
                 ! !    /
                bar = 1 ====
                        foo = 1
(%i3) niceindices (%);
                     inf  inf
                    /===\ ====
                     ! !  \
(%o3)                ! !   >    f(i j q + p)
                     ! !  /
                    q = 1 ====
                          p = 1
関数: nusum (expr, x, i_0, i_1)

R.W. Gosperによる決定手続きを使って、 xに関するexprの不定超幾何総和を実行します。 exprと結果は、 整数べき、階乗、二項式、有理関数の積として表現可能でなければいけません。

用語「定」と「不定和」は、 「定」と「不定積分」へ類似して使われています。 不定に和を取ることは、 ただ、例えば0からinfまででなく、 変数の長さの区間上の和に関して、シンボリックな結果を与えることを意味します。 例えば、二項級数の一般的な部分和に関する公式はないので、 nusumはそれができません。

nusumunsumは、有限積の和と差について少し知っています。 unsumも参照してください。

例:

(%i1) nusum (n*n!, n, 0, n);

Dependent equations eliminated:  (1)
(%o1)                     (n + 1)! - 1
(%i2) nusum (n^4*4^n/binomial(2*n,n), n, 0, n);
                     4        3       2              n
      2 (n + 1) (63 n  + 112 n  + 18 n  - 22 n + 3) 4      2
(%o2) ------------------------------------------------ - ------
                    693 binomial(2 n, n)                 3 11 7
(%i3) unsum (%, n);
                              4  n
                             n  4
(%o3)                   ----------------
                        binomial(2 n, n)
(%i4) unsum (prod (i^2, i, 1, n), n);
                    n - 1
                    /===\
                     ! !   2
(%o4)              ( ! !  i ) (n - 1) (n + 1)
                     ! !
                    i = 1
(%i5) nusum (%, n, 1, n);

Dependent equations eliminated:  (2 3)
                            n
                          /===\
                           ! !   2
(%o5)                      ! !  i  - 1
                           ! !
                          i = 1
関数: pade (taylor_series, numer_deg_bound, denom_deg_bound)

分子と分母の次数の和がべき級数の切り詰めレベル以下の 与えられたTaylor級数展開、すなわち、「最良」近似を持ち 加えて指定された次数範囲を満たす、有理関数すべてのリストを返します。

taylor_seriesは1変数Taylor級数です。 numer_deg_bounddenom_deg_boundは、 分子と分母上の次数範囲を指定する 正の整数です。

taylor_seriesは Laurent級数も可能です。 次数範囲は、infも可能で、 総次数が、冪級数の長さ以下の有理関数すべてを返すことになります。 総次数は numer_deg_bound + denom_deg_boundとして定義されます。 べき級数の長さは "truncation level" + 1 - min(0, "order of series")として定義されます。

(%i1) taylor (1 + x + x^2 + x^3, x, 0, 3);
                              2    3
(%o1)/T/             1 + x + x  + x  + . . .
(%i2) pade (%, 1, 1);
                                 1
(%o2)                       [- -----]
                               x - 1
(%i3) t: taylor(-(83787*x^10 - 45552*x^9 - 187296*x^8
                   + 387072*x^7 + 86016*x^6 - 1507328*x^5
                   + 1966080*x^4 + 4194304*x^3 - 25165824*x^2
                   + 67108864*x - 134217728)
       /134217728, x, 0, 10);
                    2    3       4       5       6        7
             x   3 x    x    15 x    23 x    21 x    189 x
(%o3)/T/ 1 - - + ---- - -- - ----- + ----- - ----- - ------
             2    16    32   1024    2048    32768   65536

                                  8         9          10
                            5853 x    2847 x    83787 x
                          + ------- + ------- - --------- + . . .
                            4194304   8388608   134217728
(%i4) pade (t, 4, 4);
(%o4)                          []

このべき級数展開を持つ次数4の 分子/分母の有理関数はありません。 一般的に、 解くのに十分な数の未知の係数を持つために、 その和が少なくともべき級数の次数になるまで 分子の次数と分母の次数を増やさなければいけません。

(%i5) pade (t, 5, 5);
                     5                4                 3
(%o5) [- (520256329 x  - 96719020632 x  - 489651410240 x

                  2
 - 1619100813312 x  - 2176885157888 x - 2386516803584)

               5                 4                  3
/(47041365435 x  + 381702613848 x  + 1360678489152 x

                  2
 + 2856700692480 x  + 3370143559680 x + 2386516803584)]
関数: powerseries (expr, x, a)

変数xに関する点a (無限大のためにはinfかもしれません) の回りのexprのべき級数展開の一般形式を返します:

           inf
           ====
           \               n
            >    b  (x - a)
           /      n
           ====
           n = 0

もしpowerseriesexprを展開することができないなら、 taylorが、級数の最初のいくつかの項を与えることができます。

verbosetrueの時、 powerseriesは進捗メッセージを印字します。

(%i1) verbose: true$
(%i2) powerseries (log(sin(x)/x), x, 0);
can't expand 
                                 log(sin(x))
so we'll try again after applying the rule:
                                        d
                                      / -- (sin(x))
                                      [ dx
                        log(sin(x)) = i ----------- dx
                                      ]   sin(x)
                                      /
in the first simplification we have returned:
                             /
                             [
                             i cot(x) dx - log(x)
                             ]
                             /
                    inf
                    ====        i1  2 i1             2 i1
                    \      (- 1)   2     bern(2 i1) x
                     >     ------------------------------
                    /                i1 (2 i1)!
                    ====
                    i1 = 1
(%o2)                -------------------------------------
                                      2
オプション変数: psexpand

デフォルト値: false

psexpandtrueの時、 拡張有理関数展開が完全に展開されて表示されます。 スイッチratexpandは同じ効果を持ちます。

psexpandfalseの時、 多変数式がちょうど有理関数パッケージにあるかのように表示されます。

psexpandmultiの時、 変数に関する同じ総次数の項は一緒にまとめられます。

関数: revert (expr, x)
関数: revert2 (expr, x, n)

これらの関数は、 変数xに関するゼロの回りのTaylor級数exprの反転を返します。 revertは、 exprの最高次数と等しい次数の多項式を返します。 revert2は、次数nの多項式を返します。 nは、exprの次数よりも大きい値も小さい値も同じ値も取り得ます。

load ("revert")はこれらの関数をロードします。

例:

(%i1) load ("revert")$
(%i2) t: taylor (exp(x) - 1, x, 0, 6);
                   2    3    4    5     6
                  x    x    x    x     x
(%o2)/T/      x + -- + -- + -- + --- + --- + . . .
                  2    6    24   120   720
(%i3) revert (t, x);
               6       5       4       3       2
           10 x  - 12 x  + 15 x  - 20 x  + 30 x  - 60 x
(%o3)/R/ - --------------------------------------------
                                60
(%i4) ratexpand (%);
                     6    5    4    3    2
                    x    x    x    x    x
(%o4)             - -- + -- - -- + -- - -- + x
                    6    5    4    3    2
(%i5) taylor (log(x+1), x, 0, 6);
                    2    3    4    5    6
                   x    x    x    x    x
(%o5)/T/       x - -- + -- - -- + -- - -- + . . .
                   2    3    4    5    6
(%i6) ratsimp (revert (t, x) - taylor (log(x+1), x, 0, 6));
(%o6)                           0
(%i7) revert2 (t, x, 4);
                          4    3    2
                         x    x    x
(%o7)                  - -- + -- - -- + x
                         4    3    2
関数: taylor (expr, x, a, n)
関数: taylor (expr, [x_1, x_2, ...], a, n)
関数: taylor (expr, [x, a, n, 'asymp])
関数: taylor (expr, [x_1, x_2, ...], [a_1, a_2, ...], [n_1, n_2, ...])
関数: taylor (expr, [x_1, a_1, n_1], [x_2, a_2, n_2], ...)

taylor (expr, x, a, n)は、 式exprを、変数xaの周りのTaylorもしくはLaurent級数を (x - a)^nまで展開します。

もしexprが形式f(x)/g(x) の形であり、 g(x)n次まで項を持たないなら、 taylorg(x)2 n次まで展開しようとします。 もしまだ0でない項がないなら、 taylorは、展開の次数がn 2^taylordepth以下である限り g(x)の展開の次数を倍にしていきます。

taylor (expr, [x_1, x_2, ...], a, n) は、すべての変数x_1, x_2, ...について 点(a, a, , ...)の周りでn次までのべき級数を返します。

taylor (expr, [x_1, a_1, n_1], [x_2, a_2, n_2], ...)は、変数x_1, x_2, ...について 点(a_1, a_2, ...)の回りで n_1次, n_2次, ....まで展開したべき級数を返します。

taylor (expr, [x_1, x_2, ...], [a_1, a_2, ...], [n_1, n_2, ...])は、 変数x_1, x_2, ...について、 点(a_1, a_2, ...)の回りで n_1次, n_2次, ....まで展開したべき級数を返します。

taylor (expr, [x, a, n, 'asymp])は、 exprx - aの負のべき乗展開を返します。 最高次の項は(x - a)^-nです。

maxtaylordertrueの時、 (丸められた)Taylor級数の代数操作の間、 talyorは正確とわかっている限り多くの項を保とうとします。

psexpandtrueの時、 拡張有理関数式は、フルに展開されて表示されます。 スイッチratexpandは同じ効果を持ちます。 psexpandfalseの時、 有理関数パッケージかのように多変数式が表示されます。 psexpandmultiなら、同じ総次数の項が一緒にグループ化されます。

展開を制御するには、taylor_logexpandスイッチも参照してください。

例:

(%i1) taylor (sqrt (sin(x) + a*x + 1), x, 0, 3);
                           2             2
             (a + 1) x   (a  + 2 a + 1) x
(%o1)/T/ 1 + --------- - -----------------
                 2               8

                                   3      2             3
                               (3 a  + 9 a  + 9 a - 1) x
                             + -------------------------- + . . .
                                           48
(%i2) %^2;
                                    3
                                   x
(%o2)/T/           1 + (a + 1) x - -- + . . .
                                   6
(%i3) taylor (sqrt (x + 1), x, 0, 5);
                       2    3      4      5
                  x   x    x    5 x    7 x
(%o3)/T/      1 + - - -- + -- - ---- + ---- + . . .
                  2   8    16   128    256
(%i4) %^2;
(%o4)/T/                  1 + x + . . .
(%i5) product ((1 + x^i)^2.5, i, 1, inf)/(1 + x^2);
                         inf
                        /===\
                         ! !    i     2.5
                         ! !  (x  + 1)
                         ! !
                        i = 1
(%o5)                   -----------------
                              2
                             x  + 1
(%i6) ev (taylor(%, x,  0, 3), keepfloat);
                               2           3
(%o6)/T/    1 + 2.5 x + 3.375 x  + 6.5625 x  + . . .
(%i7) taylor (1/log (x + 1), x, 0, 3);
                               2       3
                 1   1   x    x    19 x
(%o7)/T/         - + - - -- + -- - ----- + . . .
                 x   2   12   24    720
(%i8) taylor (cos(x) - sec(x), x, 0, 5);
                                4
                           2   x
(%o8)/T/                - x  - -- + . . .
                               6
(%i9) taylor ((cos(x) - sec(x))^3, x, 0, 5);
(%o9)/T/                    0 + . . .
(%i10) taylor (1/(cos(x) - sec(x))^3, x, 0, 5);
                                               2          4
            1     1       11      347    6767 x    15377 x
(%o10)/T/ - -- + ---- + ------ - ----- - ------- - --------
             6      4        2   15120   604800    7983360
            x    2 x    120 x

                                                          + . . .
(%i11) taylor (sqrt (1 - k^2*sin(x)^2), x, 0, 6);
               2  2       4      2   4
              k  x    (3 k  - 4 k ) x
(%o11)/T/ 1 - ----- - ----------------
                2            24

                                    6       4       2   6
                               (45 k  - 60 k  + 16 k ) x
                             - -------------------------- + . . .
                                          720
(%i12) taylor ((x + 1)^n, x, 0, 4);
                      2       2     3      2         3
                    (n  - n) x    (n  - 3 n  + 2 n) x
(%o12)/T/ 1 + n x + ----------- + --------------------
                         2                 6

                               4      3       2         4
                             (n  - 6 n  + 11 n  - 6 n) x
                           + ---------------------------- + . . .
                                          24
(%i13) taylor (sin (y + x), x, 0, 3, y, 0, 3);
               3                 2
              y                 y
(%o13)/T/ y - -- + . . . + (1 - -- + . . .) x
              6                 2

                    3                       2
               y   y            2      1   y            3
          + (- - + -- + . . .) x  + (- - + -- + . . .) x  + . . .
               2   12                  6   12
(%i14) taylor (sin (y + x), [x, y], 0, 3);
                     3        2      2      3
                    x  + 3 y x  + 3 y  x + y
(%o14)/T/   y + x - ------------------------- + . . .
                                6
(%i15) taylor (1/sin (y + x), x, 0, 3, y, 0, 3);
          1   y              1    1               1            2
(%o15)/T/ - + - + . . . + (- -- + - + . . .) x + (-- + . . .) x
          y   6               2   6                3
                             y                    y

                                           1            3
                                      + (- -- + . . .) x  + . . .
                                            4
                                           y
(%i16) taylor (1/sin (y + x), [x, y], 0, 3);
                             3         2       2        3
            1     x + y   7 x  + 21 y x  + 21 y  x + 7 y
(%o16)/T/ ----- + ----- + ------------------------------- + . . .
          x + y     6                   360
オプション変数: taylordepth

デフォルト値: 3

もしまだ非ゼロ項がないなら、 展開の次数がn 2^taylordepth以下である限り、 taylorは、 g(x)の展開の次数を倍にします。

関数: taylorinfo (expr)

Taylor級数exprについての情報を返します。 戻り値はリストのリストです。 リストそれぞれは、変数名、展開点、展開次数から成ります。

もしexprがTaylor級数でないなら、 taylorinfofalseを返します。

例:

(%i1) taylor ((1 - y^2)/(1 - x), x, 0, 3, [y, a, inf]);
                  2                       2
(%o1)/T/ - (y - a)  - 2 a (y - a) + (1 - a )

         2                        2
 + (1 - a  - 2 a (y - a) - (y - a) ) x

         2                        2   2
 + (1 - a  - 2 a (y - a) - (y - a) ) x

         2                        2   3
 + (1 - a  - 2 a (y - a) - (y - a) ) x  + . . .
(%i2) taylorinfo(%);
(%o2)               [[y, a, inf], [x, 0, 3]]
関数: taylorp (expr)

もしexprがTaylor級数なら、trueを、 そうでないなら、falseを返します。

オプション変数: taylor_logexpand

デフォルト値: true

taylor_logexpandは、 taylor級数の中の対数の展開を制御します。

taylor_logexpandtrueの時、 対数すべては完全に展開されるので、対数的恒等式を含むゼロ認識問題は 展開プロセスを邪魔しません。 しかしながら、分岐情報を無視するので、この方法はいつも数学的にただしいわけではありません。

taylor_logexpandfalseに設定されている時、 生じる対数の唯一の展開は、 形式的なべき級数を得るのに必要なものです。

オプション変数: taylor_order_coefficients

デフォルト値: true

taylor_order_coefficientsは、 Taylor級数の中の係数の順序付けを制御します。

taylor_order_coefficientstrueの時、 Taylor級数の係数は標準に順序付けられます。

関数: taylor_simplifier (expr)

べき級数exprの係数を整理します。 taylorはこの関数をコールします。

オプション変数: taylor_truncate_polynomials

デフォルト値: true

taylor_truncate_polynomialstrueの時、 多項式は入力切り詰めレベルを基礎に切り詰められます。

そうでないなら、 taylorへの多項式入力は、 不定の精度を持つと考えられます。

関数: taytorat (expr)

taylor形式から標準有理式(CRE)形式に exprを変換します。 効果はrat (ratdisrep (expr))と同じですが、より速いです。

関数: trunc (expr)

一般式exprの内部表現をアノテートするので、まるでその和が切り詰められたTaylor級数かのように表示されます。 exprは別に変更されません。

例:

(%i1) expr: x^2 + x + 1;
                            2
(%o1)                      x  + x + 1
(%i2) trunc (expr);
                                2
(%o2)                  1 + x + x  + . . .
(%i3) is (expr = trunc (expr));
(%o3)                         true
関数: unsum (f, n)

最初の後方差f(n) - f(n - 1)を返します。 従って、 unsumは、ある意味、sumの逆です。

nusumも参照してください。

例:

(%i1) g(p) := p*4^n/binomial(2*n,n);
                                     n
                                  p 4
(%o1)               g(p) := ----------------
                            binomial(2 n, n)
(%i2) g(n^4);
                              4  n
                             n  4
(%o2)                   ----------------
                        binomial(2 n, n)
(%i3) nusum (%, n, 0, n);
                     4        3       2              n
      2 (n + 1) (63 n  + 112 n  + 18 n  - 22 n + 3) 4      2
(%o3) ------------------------------------------------ - ------
                    693 binomial(2 n, n)                 3 11 7
(%i4) unsum (%, n);
                              4  n
                             n  4
(%o4)                   ----------------
                        binomial(2 n, n)
オプション変数: verbose

デフォルト値: false

verbosetrueの時、 powerseriesは進捗メッセージを印字します。


Next: , Previous: Introduction to Series, Up: Sums Products and Series   [Contents][Index]