学習環境
- Surface Go、タイプ カバー、ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro + Apple Pencil
- MyScript Nebo(iPad アプリ(iOS))
- 参考書籍
数学読本〈1〉数・式の計算/方程式/不等式 (松坂 和夫(著)、岩波書店)の第2章(文字と記号の活躍 - 式の計算)、2.1(整式)、展開公式の問8-(1)、(2).を取り組んでみる。
コード(Emacs)
Python 3
#!/usr/bin/env python3
from sympy import pprint, symbols
print('8.')
x, a, b = symbols('x, a, b')
ts = [(x + 2) ** 3,
(2 * a - 3 * b) ** 3]
for i, t in enumerate(ts, 1):
print(f'({i})')
for s in [t, t.expand()]:
pprint(s)
print()
print()
入出力結果(Terminal, Jupyter(IPython))
$ ./sample8.py
8.
(1)
3
(x + 2)
3 2
x + 6⋅x + 12⋅x + 8
(2)
3
(2⋅a - 3⋅b)
3 2 2 3
8⋅a - 36⋅a ⋅b + 54⋅a⋅b - 27⋅b
$
0 コメント:
コメントを投稿