2017年9月9日土曜日

学習環境

数学読本〈5〉微分法の応用/積分法/積分法の応用/行列と行列式(松坂 和夫(著)、岩波書店)の第19章(細分による加法 - 積分法)、19.3(定積分の性質と計算)、リーマン和の極限としての定積分、問36.を取り組んでみる。


    1. lim n 1 n k=1 n ( 1+ k n ) 2 = 0 1 ( 1+x ) 2 dx = 0 1 ( x 2 +2x+1 )dx = [ 1 3 x 3 + x 2 +x ] 0 1 = 1 3 +1+1 = 7 3

    2. lim n 1 n k=1 n k α n α = lim n 1 n k=1 n ( k n ) α = 0 1 x α dx = [ 1 α+1 x α+1 ] 0 1 = 1 α+1

    3. lim n 1 n k=1 n n n+k = lim n 1 n k=1 n 1 1+ k n = 0 1 1 1+x dx = [ log( 1+x ) ] 0 1 =log2log1 =log2

    4. lim n 1 n k=1 n sin( k n π ) = 0 1 sin( xπ )dx = [ 1 π cos( xπ ) ] 0 1 = 1 π ( cosπcos0 ) = 1 π ( 11 ) = 2 π

    5. lim n 1 n k=0 n1 n n+k = lim n 1 n k=0 n1 n n+k = lim n 1 n k=0 n1 1 1+ k n = 0 1 1 1+x dx = 0 1 ( 1+x ) 1 2 dx = [ 2 ( x+1 ) 1 2 ] 0 1 =2( 2 1 )

コード(Emacs)

Python 3

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from sympy import pprint, symbols, summation, Limit, oo, sin, pi, sqrt

print('36.')
k, n = symbols('k n', integer=True)
α = symbols('α', positive=True)
fs = [1 / n * summation((1 + k / n) ** 2, (k, 1, n)),
      1 / n ** (α + 1) * summation(k ** α, (k, 1, n)),
      summation(1 / (n + k), (k, 1, n)),
      1 / n * summation(sin(k * pi / n), (k, 1, n)),
      1 / sqrt(n) * summation(1 / sqrt(n + k), (k, 0, n - 1))]

for i, f in enumerate(fs, 1):
    print(f'({i})')
    try:
        l = Limit(f, n, oo)
        for g in [l, l.doit()]:
            pprint(g)
            print()
        print()
    except Exception as err:
        print(type(err), err)

入出力結果(Terminal, IPython)

$ ./sample36.py
36.
(1)
    ⎛      ⎛ 2    ⎞    3    2    ⎞
    ⎜      ⎜n    n⎟   n    n    n⎟
    ⎜    2⋅⎜── + ─⎟   ── + ── + ─⎟
    ⎜      ⎝2    2⎠   3    2    6⎟
    ⎜n + ────────── + ───────────⎟
    ⎜        n              2    ⎟
    ⎜                      n     ⎟
lim ⎜────────────────────────────⎟
n─→∞⎝             n              ⎠

7/3


(2)
    ⎛          n     ⎞
    ⎜         ___    ⎟
    ⎜         ╲      ⎟
    ⎜ -α - 1   ╲    α⎟
lim ⎜n      ⋅  ╱   k ⎟
n─→∞⎜         ╱      ⎟
    ⎜         ‾‾‾    ⎟
    ⎝        k = 1   ⎠

0


(3)
<class 'NotImplementedError'> 
(4)
    ⎛  n           ⎞
    ⎜ ____         ⎟
    ⎜ ╲            ⎟
    ⎜  ╲      ⎛π⋅k⎞⎟
    ⎜   ╲  sin⎜───⎟⎟
    ⎜   ╱     ⎝ n ⎠⎟
    ⎜  ╱           ⎟
    ⎜ ╱            ⎟
    ⎜ ‾‾‾‾         ⎟
    ⎜k = 1         ⎟
lim ⎜──────────────⎟
n─→∞⎝      n       ⎠

0


(5)
    ⎛n - 1          ⎞
    ⎜ ____          ⎟
    ⎜ ╲             ⎟
    ⎜  ╲       1    ⎟
    ⎜   ╲  ─────────⎟
    ⎜   ╱    _______⎟
    ⎜  ╱   ╲╱ k + n ⎟
    ⎜ ╱             ⎟
    ⎜ ‾‾‾‾          ⎟
    ⎜k = 0          ⎟
lim ⎜───────────────⎟
n─→∞⎝       √n      ⎠

√2


$

いくつかの結果がSymPy の結果と一致しない。。

0 コメント:

コメントを投稿