Loading [MathJax]/jax/output/CommonHTML/jax.js

2019年6月19日水曜日

学習環境

解析入門 原書第3版 (S.ラング(著)、松坂 和夫(翻訳)、片山 孝次(翻訳)、岩波書店)の第4部(級数)、第14章(テイラーの公式)、補充問題22の解答を求めてみる。


  1. ddxtanx=cos2x+sin2ycos2x=1cos2xd2dx2tanx=2cosxsinxcos4x=2sinxcos3xd3dx3tanx=2·cosxcos3x+(sinx)3(cos2x)sinxcos6x=2·cos2x+3sin2xcos4xtanx=x+23!x3+tan(x2)=x2+13x6+(tanx)2=x2+2·23!x4+=x2+23x4+limx0tanx2tan2x=1

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, plot, Limit, tan

print('22.')

x = symbols('x')
f = tan(x ** 2) / tan(x) ** 2

for dir in ['+', '-']:
    l = Limit(f, x, 0, dir=dir)
    for o in [l, l.doit()]:
        pprint(o)
        print()

p = plot(tan(x), tan(x ** 2), tan(x) ** 2, f,
         (x, -5, 5),
         ylim=(-5, 5),
         legend=True,
         show=False)
colors = ['red', 'green', 'blue', 'brown', 'orange',
          'purple', 'pink', 'gray', 'skyblue', 'yellow']

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


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

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

C:\Users\...>py sample22.py
22.
     ⎛   ⎛ 2⎞⎞
     ⎜tan⎝x ⎠⎟
 lim ⎜───────⎟
x─→0⁺⎜   2   ⎟
     ⎝tan (x)⎠

1

     ⎛   ⎛ 2⎞⎞
     ⎜tan⎝x ⎠⎟
 lim ⎜───────⎟
x─→0⁻⎜   2   ⎟
     ⎝tan (x)⎠

1


C:\Users\...>

0 コメント:

コメントを投稿