学習環境
- Surface、Surface ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro 10.5 + Apple Pencil
- MyScript Nebo - MyScript(iPad アプリ(iOS))
- 参考書籍
解析入門(上) (松坂和夫 数学入門シリーズ 4) (松坂 和夫(著)、岩波書店)の第5章(各種の初等関数)、5.4(三角関数(続き)、逆三角関数)、問題4の解答を求めてみる。
また、
よって帰納法により 成り立つ。
(証明終)
コード
Python 3
#!/usr/bin/env python3 from sympy import pprint, symbols, sqrt, sin, exp, Derivative, pi, plot print('4.') x = symbols('x') n = symbols('n', integer=True) f = exp(x) * sin(x) d = Derivative(f, x, 1) d1 = d.doit() g = sqrt(2) ** n * exp(x) * sin(x + n * pi / 4) for o in [d, d1]: pprint(o.factor()) print() ns = range(1, 6) p = plot(*[d1.subs({n: n0}) for n0 in ns], *[g.subs({n: n0}) for n0 in ns], (x, -5, 5), ylim=(-5, 5), show=False, legend=False) colors = ['red', 'green', 'blue', 'brown', 'orange', 'purple', 'pink', 'gray', 'skyblue', 'yellow'] for o, color in zip(p, colors): o.line_color = color for t in zip(p, colors): pprint(t) print() p.show() p.save('sample4.png')
入出力結果(Bash、cmd.exe(コマンドプロンプト)、Terminal、Jupyter(IPython))
C:\Users\...>py sample4.py 4. d ⎛ x ⎞ ──⎝ℯ ⋅sin(x)⎠ dx x (sin(x) + cos(x))⋅ℯ (cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), red) (cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), green) (cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), blue) (cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), brown) (cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), orange) (cartesian line: sqrt(2)*exp(x)*sin(x + pi/4) for x over (-5.0, 5.0), purple) (cartesian line: 2*exp(x)*cos(x) for x over (-5.0, 5.0), pink) (cartesian line: 2*sqrt(2)*exp(x)*cos(x + pi/4) for x over (-5.0, 5.0), gray) (cartesian line: -4*exp(x)*sin(x) for x over (-5.0, 5.0), skyblue) (cartesian line: -4*sqrt(2)*exp(x)*sin(x + pi/4) for x over (-5.0, 5.0), yello w) C:\Users\...>
0 コメント:
コメントを投稿