2019年9月25日水曜日

学習環境

解析入門 原書第3版 (S.ラング(著)、松坂 和夫(翻訳)、片山 孝次(翻訳)、岩波書店)の第4部(級数)、第15章(級数)、6(べき級数)の練習問題6を求めてみる。


  1. lim n 1 log n 1 n = lim n log n - 1 n = 1

    よって、収束半径は1。

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, summation, oo, Limit, plot, log

print('6.')

n, m, x = symbols('n, m, x')
an = 1 / log(n)
f = summation(an * x ** n, (n, 2, m))

s = Limit(abs(an) ** (1 / n), n, oo)

for o in [s, s.doit(), 1 / s.doit(), f.subs({m: oo})]:
    pprint(o)
    print()

ms = range(2, 12)
fs = [f.subs({m: m0}) for m0 in ms]
p = plot(*fs,
         (x, -2, 2),
         ylim=(-2, 2),
         legend=False,
         show=False)
colors = ['red', 'green', 'blue', 'brown', 'orange',
          'purple', 'pink', 'gray', 'skyblue', 'yellow']

for s, color in zip(p, colors):
    s.line_color = color

for o in zip(fs, colors):
    pprint(o)
    print()

p.show()
p.save('sample6.png')

入出力結果(Bash、cmd.exe(コマンドプロンプト)、Terminal、Jupyter(IPython))

$ ./sample6.py
6.
        __________
       ╱ │  1   │ 
lim n ╱  │──────│ 
n─→∞╲╱   │log(n)│ 

1

1

  ∞         
 ____       
 ╲          
  ╲      n  
   ╲    x   
   ╱  ──────
  ╱   log(n)
 ╱          
 ‾‾‾‾       
n = 2       

⎛  2              ⎞
⎜ ____            ⎟
⎜ ╲               ⎟
⎜  ╲      n       ⎟
⎜   ╲    x        ⎟
⎜   ╱  ──────, red⎟
⎜  ╱   log(n)     ⎟
⎜ ╱               ⎟
⎜ ‾‾‾‾            ⎟
⎝n = 2            ⎠

⎛  3                ⎞
⎜ ____              ⎟
⎜ ╲                 ⎟
⎜  ╲      n         ⎟
⎜   ╲    x          ⎟
⎜   ╱  ──────, green⎟
⎜  ╱   log(n)       ⎟
⎜ ╱                 ⎟
⎜ ‾‾‾‾              ⎟
⎝n = 2              ⎠

⎛  4               ⎞
⎜ ____             ⎟
⎜ ╲                ⎟
⎜  ╲      n        ⎟
⎜   ╲    x         ⎟
⎜   ╱  ──────, blue⎟
⎜  ╱   log(n)      ⎟
⎜ ╱                ⎟
⎜ ‾‾‾‾             ⎟
⎝n = 2             ⎠

⎛  5                ⎞
⎜ ____              ⎟
⎜ ╲                 ⎟
⎜  ╲      n         ⎟
⎜   ╲    x          ⎟
⎜   ╱  ──────, brown⎟
⎜  ╱   log(n)       ⎟
⎜ ╱                 ⎟
⎜ ‾‾‾‾              ⎟
⎝n = 2              ⎠

⎛  6                 ⎞
⎜ ____               ⎟
⎜ ╲                  ⎟
⎜  ╲      n          ⎟
⎜   ╲    x           ⎟
⎜   ╱  ──────, orange⎟
⎜  ╱   log(n)        ⎟
⎜ ╱                  ⎟
⎜ ‾‾‾‾               ⎟
⎝n = 2               ⎠

⎛  7                 ⎞
⎜ ____               ⎟
⎜ ╲                  ⎟
⎜  ╲      n          ⎟
⎜   ╲    x           ⎟
⎜   ╱  ──────, purple⎟
⎜  ╱   log(n)        ⎟
⎜ ╱                  ⎟
⎜ ‾‾‾‾               ⎟
⎝n = 2               ⎠

⎛  8               ⎞
⎜ ____             ⎟
⎜ ╲                ⎟
⎜  ╲      n        ⎟
⎜   ╲    x         ⎟
⎜   ╱  ──────, pink⎟
⎜  ╱   log(n)      ⎟
⎜ ╱                ⎟
⎜ ‾‾‾‾             ⎟
⎝n = 2             ⎠

⎛  9               ⎞
⎜ ____             ⎟
⎜ ╲                ⎟
⎜  ╲      n        ⎟
⎜   ╲    x         ⎟
⎜   ╱  ──────, gray⎟
⎜  ╱   log(n)      ⎟
⎜ ╱                ⎟
⎜ ‾‾‾‾             ⎟
⎝n = 2             ⎠

⎛  10                 ⎞
⎜ ____                ⎟
⎜ ╲                   ⎟
⎜  ╲      n           ⎟
⎜   ╲    x            ⎟
⎜   ╱  ──────, skyblue⎟
⎜  ╱   log(n)         ⎟
⎜ ╱                   ⎟
⎜ ‾‾‾‾                ⎟
⎝n = 2                ⎠

⎛  11                ⎞
⎜ ____               ⎟
⎜ ╲                  ⎟
⎜  ╲      n          ⎟
⎜   ╲    x           ⎟
⎜   ╱  ──────, yellow⎟
⎜  ╱   log(n)        ⎟
⎜ ╱                  ⎟
⎜ ‾‾‾‾               ⎟
⎝n = 2               ⎠

/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sympy/plotting/experimental_lambdify.py:233: UserWarning: The evaluation of the expression is problematic. We are trying a failback method that may still work. Please report this as a bug.
  warnings.warn('The evaluation of the expression is'
$ 

0 コメント:

コメントを投稿