学習環境
- Surface 3 (4G LTE)、Surface 3 タイプ カバー、Surface ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro + Apple Pencil
- MyScript Nebo(iPad アプリ)
- 参考書籍
解析入門〈3〉(松坂 和夫(著)、岩波書店)の第14章(多変数の関数)、14.2(高次偏導関数、テイラーの定理)、問題8.を取り組んでみる。
よって、
コード(Emacs)
Python 3
#!/usr/bin/env python3
from sympy import pprint, symbols, sqrt, Derivative, Function
n = 5
xs = symbols([f'x{i}' for i in range(1, n + 1)])
r = sqrt(sum([x ** 2 for x in xs]))
f = r ** 2
s = sum([Derivative(f, x, 2) for x in xs])
for t in [f, s, s.doit()]:
pprint(t)
print()
入出力結果(Terminal, Jupyter(IPython))
$ ./sample8.py
2 2 2 2 2
x₁ + x₂ + x₃ + x₄ + x₅
2 2 2
∂ ⎛ 2 2 2 2 2⎞ ∂ ⎛ 2 2 2 2 2⎞ ∂ ⎛
────⎝x₁ + x₂ + x₃ + x₄ + x₅ ⎠ + ────⎝x₁ + x₂ + x₃ + x₄ + x₅ ⎠ + ────⎝x
2 2 2
∂x₁ ∂x₂ ∂x₃
2 2
2 2 2 2 2⎞ ∂ ⎛ 2 2 2 2 2⎞ ∂ ⎛ 2
₁ + x₂ + x₃ + x₄ + x₅ ⎠ + ────⎝x₁ + x₂ + x₃ + x₄ + x₅ ⎠ + ────⎝x₁ + x
2 2
∂x₄ ∂x₅
2 2 2 2⎞
₂ + x₃ + x₄ + x₅ ⎠
10
$
0 コメント:
コメントを投稿