学習環境
- Surface 3 (4G LTE)、Surface 3 タイプ カバー、Surface ペン(端末)
 - Windows 10 Pro (OS)
 - 数式入力ソフト(TeX, MathML): MathType
 - MathML対応ブラウザ: Firefox、Safari
 - MathML非対応ブラウザ(Internet Explorer, Google Chrome...)用JavaScript Library: MathJax
 - Pythonからはじめる数学入門(参考書籍)
 
解析入門 原書第3版 (S.ラング(著)、松坂 和夫(翻訳)、片山 孝次(翻訳)、岩波書店)の第2部(微分と基本的な関数)、第3章(微分係数、導関数)、補充問題(変化率) 1-4.を取り組んでみる。
コード(Emacs)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from sympy import symbols, Derivative, pprint, solve, sqrt, Rational
print('1.')
x, y, t = symbols('x y t')
expr = x ** 2 - y
pprint(expr)
dy = Derivative(expr, x)
dx = Derivative(expr, y)
pprint(dy)
pprint(dx)
pprint(solve(dy.doit() - 1, x, dict=True))
pprint(Derivative(t ** 3, t).subs({t: 1}).doit())
pprint(Derivative(x ** 2, t).subs({x: t ** 3, t: 1}).doit())
pprint(Derivative(x, t).subs({t: 1, x: sqrt(y), y: 4 * t}).doit())
pprint(Derivative(4 * t, t).subs({t: 1}).doit())
print('2.')
x0 = 8 - t
y0 = 6 + 2 * t
area = Rational(1, 2) * x0 * y0
pprint(Derivative(area, t).subs({t: 2}).doit())
入出力結果(Terminal, IPython)
$ ./sample1.py
1.
 2    
x  - y
∂ ⎛ 2    ⎞
──⎝x  - y⎠
∂x        
∂ ⎛ 2    ⎞
──⎝x  - y⎠
∂y        
[{x: 1/2}]
3
6
1
4
2.
1
$
						
0 コメント:
コメントを投稿