学習環境
- Surface、Surface ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro 10.5 + Apple Pencil
- MyScript Nebo - MyScript(iPad アプリ(iOS))
- 参考書籍
微分積分学 (ちくま学芸文庫) (吉田 洋一(著)、筑摩書房)のI.(微分法)、1.(関数)、問2の解答を求めてみる。
また、
コード
Python 3
#!/usr/bin/env python3
from sympy import pprint, symbols, plot, Rational
print('2.')
x = symbols('x')
f = 1 - x ** 2 / 2 + x ** 4 / 24
g = x - x * 3 / 6 + x ** 5 / 120
for h in [f.subs({x: -x}), f, f.subs({x: -x}) == f,
g.subs({x: -x}), -g, g.subs({x: -x}) == -g]:
pprint(h)
print()
colors = ['red', 'green', 'blue', 'brown', 'orange',
'purple', 'pink', 'gray', 'skyblue', 'yellow']
p = plot(f, g,
ylim=(-10, 10),
legend=True,
show=False)
for o, color in zip(p, colors):
o.line_color = color
p.show()
p.save('sample2.png')
入出力結果(Bash、cmd.exe(コマンドプロンプト)、Terminal、Jupyter(IPython))
C:\Users\...>py sample2.py
2.
4 2
x x
── - ── + 1
24 2
4 2
x x
── - ── + 1
24 2
True
5
x x
- ─── - ─
120 2
5
x x
- ─── - ─
120 2
True
c:\Users\...>
0 コメント:
コメントを投稿