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